Skip to content

Errors and limits

Every error code the engine answers, with its status and what to do, and every limit in one table.

Applies to EngineCloud
View as Markdown
On this page
  1. Credentials and requests
  2. Auth
  3. OAuth
  4. The Data API
  5. Database errors
  6. SQL
  7. Installing in a database
  8. MCP
  9. Limits

Every error has the same shape. code is stable and in snake_case; message is for people and may change; hint, when present, says what to do.

JSON
{ "error": { "code": "filter_required", "message": "Updates and deletes need at least one filter", "hint": null } }
  • The OAuth endpoints (/auth/v1/oauth/token, /register, /revoke, /introspect) answer as RFC 6749 requires: { "error": "invalid_client", "error_description": "…" }.
  • MCP tools answer a refusal as a tool result with isError: true and the text <code>: <message> (<hint>), so the agent can read it and explain it.
  • Every answer carries x-sypnia-request-id. A 429 or a 503 carries Retry-After.

Credentials and requests

StatusCodeWhen
400missing_hostthe request has no Host header
401missing_api_keyneither an apikey header nor an Authorization header
401invalid_api_keythe key is not a Sypnia Data key, belongs to another project, or is unknown or revoked
401invalid_tokenthe token is malformed, expired, revoked, from another project, its user no longer exists, or it was sent with the wrong scheme (Bearer for a DPoP-bound token or the reverse)
401invalid_dpop_proofa DPoP-bound token without a proof, or with a proof made by another key
401secret_key_in_browsera secret key sent with an Origin header
401not_signed_inthe call needs a signed-in user
403invalid_rolethe token names a database role that is not allowed
403secret_key_requiredthe call needs a secret key or a service_role token
403person_requiredonly the signed-in person may do this, not a PAT, an app acting for them or a machine (changing the account, approving a device)
403scope_not_alloweda privileged scope (sql:*, auth:admin, project:admin) the account was not granted in app_metadata.scopes
403direct_accessthe engine has an origin secret and the request did not come through its CDN
403csrf_faileda cookie session call without X-Sypnia-CSRF matching the sypnia-csrf cookie
403origin_not_alloweda cookie session call from an origin not in the project’s cors_origins
404unknown_projectno project serves this host
408 or 504statement_timeoutthe statement took longer than its limit; add a filter, a limit or an index
429rate_limiteda limit was reached; Retry-After says when to try again
500internal_errora bug; the request id helps us find it
503database_unavailablethe database does not answer
503pool_exhaustedevery connection to the database is busy
503keys_unavailablea stored secret cannot be decrypted (the master key or KMS)
503aws_unavailablean AWS service the engine uses (KMS, SSM, SES) does not answer

Auth

StatusCodeWhen
400validation_faileda field is missing or out of shape; the message names it
400bad_requestthe request cannot be read
400invalid_credentialswrong e-mail or password (the same answer for an unknown e-mail)
400email_not_confirmedthe project requires confirmation and the address is not confirmed
400otp_invalid, otp_expired, otp_used, otp_attemptsa link or code is not valid, has expired, was already used, or had 5 wrong attempts
400invalid_refresh_tokenno refresh token, or not a valid one
400refresh_token_reuseda retired refresh token came back after the reuse window; the session is ended
400session_expired, session_revokedthe session reached its lifetime or inactivity limit, or was ended
400user_not_foundthe session’s user no longer exists
400invalid_grant, invalid_request, unsupported_grant_typea wrong code or verifier at /auth/v1/token, or a grant that belongs at /auth/v1/oauth/token
400invalid_code_challengea provider sign-in without an S256 code_challenge of 43 characters or more
400invalid_statea provider callback whose state is missing, wrong or expired
400provider_disabled, provider_errorthe provider is not turned on, or answered something unusable
400captcha_required, captcha_failedthe project has a CAPTCHA and the token is missing or wrong
400no_emailthe user has no e-mail for this action
400invalid_scopea PAT asks for an unknown scope
400not_allowedrevoking the secret key you are using, or deleting the Sypnia CLI client
400not_protectedrotate-protected on a key that is not protected
400invalid_session_policy, invalid_template, invalid_mail_provider, unknown_settinga setting out of range or unknown
400mail_not_configuredthe e-mail provider has no from
400invalid_client, invalid_client_metadataan unknown client, or a client definition the engine refuses (a public client with client_credentials, private_key_jwt without an Ed25519 or P-256 key)
400device_code_invalidthe device code is expired, unknown or already used
401reauthentication_neededa password or e-mail change without a recent sign-in or a valid nonce
403signup_disabledsign-ups are closed for the project
403email_provider_disablede-mail sign-in is off for the project
403user_bannedthe account is banned
403reauthentication_neededa PAT tries to change the password or the e-mail
403not_alloweda PAT tries to create another PAT
404user_not_found, identity_not_found, client_not_found, key_not_found, flow_not_found, device_code_not_foundthe thing named does not exist (a flow_not_found consent request has expired)
409email_existsanother account uses this e-mail
409email_unconfirmedan unconfirmed account uses this e-mail; confirm it first
409identity_already_existsthis provider account is linked to another user
409email_provider_requiredthe flow needs an e-mail and the project has no provider
409protected_keyrevoking a protected key; replace it with rotate-protected
422weak_passwordtoo short, missing a required kind of character, or found in known breaches
422invalid_emailnot an e-mail address
422last_identityunlinking the last way to sign in
422provider_not_availablesypnia as the e-mail provider of a project that may not use the engine’s own sender
503captcha_unavailable, provider_unavailablethe CAPTCHA service or the sign-in provider does not answer

A flow that sends an e-mail answers 202 with {"status": "email_queued_retry"} when the provider failed and the e-mail is being retried; that is not an error.

OAuth

The token, registration, revocation and introspection endpoints answer RFC 6749, RFC 7591 and RFC 8628 errors:

CodeWhen
invalid_requesta parameter is missing or repeated
invalid_clientthe client is unknown, or its authentication failed
invalid_granta code, a refresh token or an assertion is wrong, expired, reused or issued to another client
unauthorized_clientthe client may not use this grant
unsupported_grant_typean unknown grant
invalid_scopea scope the client may not ask for
invalid_targeta resource the client may not call
invalid_dpop_proofa missing or wrong DPoP proof
use_dpop_noncerepeat with the nonce in the DPoP-Nonce header
authorization_pending, slow_downthe device flow: keep polling, or poll less often
access_deniedthe person denied the request
expired_tokenthe device code expired; start again
invalid_client_metadata, invalid_redirect_uridynamic registration refused the client’s metadata
server_errora bug or an unavailable dependency

The Data API

StatusCodeWhen
400invalid_querythe query string cannot be read: an unknown operator, in. without a list, is. with something other than null, true, false or unknown
400invalid_bodythe body is not JSON, or not an object or an array of objects
400empty_updatea PATCH that names no column
400filter_requireda PATCH or DELETE without a filter
400column_not_foundthe table has no such column
400relationship_not_foundno foreign key relates the two tables of an embedding
400embedding_too_deepembeddings go at most 4 levels deep
400generated_columnwriting a column the database generates
400not_insertableinserting into a view
400on_conflict_requiredan upsert on a table without a primary key and without on_conflict
400function_argumentsno function of that name takes these arguments
400invalid_incrementan increment that is not a number, or a column both set and incremented
400invalid_transactiona transaction with no operations or more than 100
401token_requiredGET /rest/v1/ with only a publishable key
403insufficient_scopea PAT or machine token without data:read (reads) or data:write (writes)
404table_not_found, function_not_foundno such table, view or function in the schema
405method_not_alloweda method other than GET, HEAD, POST, PATCH or DELETE
406schema_not_exposedAccept-Profile or Content-Profile names a schema that is not exposed
406not_singleasked for one object (Accept: application/vnd.pgrst.object+json) and the result has another number of rows
409expectation_failedan expect of a transaction did not hold; nothing was changed

Database errors

Postgres’s own errors come back with the database’s message, which names the constraint or the column and never data of other rows:

StatusCodePostgres
409unique_violation23505; upsert with on_conflict to update instead
409foreign_key_violation23503
400not_null_violation23502
400check_violation23514
409exclusion_violation23P01
400invalid_value22P02 and the other data errors of class 22
401 or 403permission_denied42501: a grant or a row-level security policy said no (401 when nobody is signed in)
404undefined_table, undefined_function42P01, 42883
400undefined_column, datatype_mismatch, cardinality_violation42703, 42804, 21000
405read_only_transaction25006: a write in a read-only transaction
504statement_timeout57014
409serialization_failure40001, 40P01: try again
400raised_exceptionP0001: your function raised it
400database_errorany other database error

SQL

StatusCodeWhen
400empty_querythere is no statement to run
400params_need_one_statementparams with several statements in one query
400one_statement_eachan entry of /sql/v1/transaction with more than one statement
400invalid_transaction/sql/v1/transaction with no statements or more than 100
400invalid_namea migration name that is empty, longer than 200 characters or has /
403sql_not_allowedSQL without a secret key, or with a token without an sql:* scope
403scope_requireda read with neither sql:read nor sql:write, or a migration without sql:write
409migration_checksum_mismatcha migration name already applied with other contents
409expectation_failedan expect did not hold; nothing was changed

The database errors above apply here too.

Installing in a database

sypnia-data install, and the console when it installs into your own Postgres, can answer:

CodeWhen
invalid_urlnot a postgres:// URL
postgres_too_oldthe database is older than PostgreSQL 14
invalid_identifiera role or database name that is not a plain identifier

MCP

At the HTTP level, /mcp answers 401 missing_token with the WWW-Authenticate challenge when no token comes, 405 method_not_allowed for anything but POST (there is no event stream: every answer comes in the response to the POST), 413 for a message over 1 MB, and 404 not_found on another path. A tool refusal is one of these codes:

CodeWhen
confirmation_requiredthe tool changes something and was called without confirm: true
insufficient_scopethe token lacks the scope the tool needs
rate_limitedmore than 120 tool calls in a minute
invalid_arguments, invalid_cursorthe input does not match the tool’s schema, or the cursor is not one this server gave
filters_requiredupdate or delete without filters
table_not_founddescribe_table on a table that is not exposed
project_required, ambiguous_projectan account token that reaches several projects and no project, or a name that matches several
wrong_projecta project token with a project argument naming another project
project_not_found, project_not_readyno such project for this account, or it is still being created
account_token_requiredlist_projects, get_project or create_project with a project token
org_required, org_not_found, forbiddencreate_project without org when you belong to several organizations, an unknown organization, or a role below admin
no_control_plane, control_plane_unreachablean engine without organizations, or the Cloud API did not answer
unknown_tool, unknown_resource, unknown_prompta name the server does not have
internala bug

Errors of the API a tool calls (a database error, permission_denied) come back with their own code.

Limits

LimitValueWhere
Rows per Data API response1 000 (SYPNIA_DATA_MAX_ROWS when self-hosted)The Data API
Statement time, Data API8 s for anon and authenticated, 30 s for service_roleThe Data API
Request body2 MBevery endpoint
Embedding depth4 levelsThe Data API
Operations per /rest/v1/transaction100The Data API
SQL statement time15 s by default, up to 60 s with timeout_msSQL and migrations
Rows per SQL result5 000SQL and migrations
Statements per /sql/v1/transaction100SQL and migrations
Migration name1 to 200 characters, without /SQL and migrations
Users per admin page50 by default, up to 1 000Auth endpoints
Links and codes1 hour by default (5 min to 24 h), 5 attempts per codeE-mail and passwords
Device codes10 minutes, polled every 5 sThe device flow
Client assertions5 minutes, each jti onceClient credentials
DPoP proofs60 s old at most, each jti once in 5 minutesDPoP
PAT nameup to 100 charactersTokens and API keys
MCP rows per call500, then next_cursorMCP
MCP answer size200 kB of text; fewer rows come back past itMCP
MCP calls120 per minute per caller and projectMCP
MCP request1 MBMCP
Auth rate limitsper projectBuilt-in protections
Sypnia Cloud’s free tierper organizationAddresses and limits
  1. Credentials and requests
  2. Auth
  3. OAuth
  4. The Data API
  5. Database errors
  6. SQL
  7. Installing in a database
  8. MCP
  9. Limits

    Search pages, sections and terms