Skip to main content

Errors

Every refusal is one JSON shape: RFC 9457 Problem Details, served as application/problem+json, whatever refused it - a document definition, a plan, a missing resource, the rate limit, the server itself. Nothing is stored or billed for a refusal.

{
"type": "https://docs.docpayload.com/api-reference/errors#schema",
"title": "The definition is not on the schema",
"status": 400,
"detail": "\"tabel\" is not in this schema; this object takes: source, break, p, th, td, h1, h2, h3, h4, h5, h6, title, lang, id, ol, ul, table, image, hr, columns, svg, toc, style, header, and 8 more",
"instance": "/v1/{tenantId}/documents/generate/pdf",
"code": "SCHEMA",
"target": "document.content.0",
"requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
"isRetryable": false
}
MemberTypeDescription
typestringThe problem's identifier: this page at the code's own anchor. Two refusals with one type are the same problem
titlestringWhat the problem is, the same every time for its type
statusintegerThe HTTP status of the response
detailstringWhat is wrong in this request, for a person. Branch on code, never on this text
instancestringThe request's path
codestringThe stable error code, listed below. Match on it in code
targetstringWhere the problem is, when it is in one place: a field of the request, or a place in a document definition as dotted keys and indexes (document.content.0)
errorsobjectA form's fields and the reasons each was refused, when the request had several (VALIDATION_ERROR)
requestIdstringThe request's id, also sent as the Request-Id header: give it when contacting support
isRetryablebooleanWhether the same request may succeed when sent again
retryAfterSecondsintegerHow long to wait before retrying, when there is a known wait; also sent as the Retry-After header

A problem may carry a member of its own type besides these: retired (RETIRED), allowed (the values a field takes), resendAfterSeconds (CODE_RECENTLY_SENT). A client ignores a member it does not know (RFC 9457 3.2).

The token endpoint, POST /oauth2/token, is the one exception: its errors are OAuth 2.0's own { error, error_description }, as RFC 6749, section 5.2 defines them for any OAuth client library.

A failed render is not a refusal: it is answered 500 with the generation response itself, "status": "failed"; see Generate.

Validation errors​

A document definition is refused with 400 before anything is rendered, stored or billed: text that is not JSON, a key or a value the schema does not name, a required member missing, or a limit exceeded. The definition is read exactly as the published schema states it: a key in another case, a retired spelling or a definition without its root is refused, never guessed at. target names the place, and detail says what is wrong there and what the place takes instead.

Wrong type, for { "document": { "pageSetup": { "margin": true }, "content": [{ "p": "Hi" }] } }:

{
"type": "https://docs.docpayload.com/api-reference/errors#schema",
"title": "The definition is not on the schema",
"status": 400,
"detail": "Expected a number, CSS's spacing shorthand (\"20mm\", \"10mm 20mm\") or a list of four lengths - numbers in points or unit strings (\"0.5in\", \"12.7mm\", \"48px\", \"36pt\").",
"code": "SCHEMA",
"target": "document.pageSetup.margin"
}

Empty content, for { "document": { "content": [] } }: code EMPTY_CONTENT, target document.content.

The root key is required. A definition is written inside document, or a component inside component. A bare { "content": [...] } is refused with SCHEMA at target $, and detail says where to put it.

Resource limits​

A definition past one of the engine's resource limits is refused with a code naming the limit; the codes and their defaults are under A document past a resource limit, and every limit is on Limits.

Retired words​

Definitions written in the previous shape (documentDefinition, margins, bookmark, colNumber, tabLeader, upper-case values such as "CENTER", ...) are translated to the schema's spelling until 1 April 2027. A translated request succeeds, and its response carries two headers announcing the end:

Deprecation: @1791072000
Sunset: Thu, 01 Apr 2027 00:00:00 GMT

A word that cannot be carried without changing the document, and every old word after that date, is refused with RETIRED. target is the first word's place, and the retired list names each word, where it stands and what the schema writes instead:

{
"code": "RETIRED",
"target": "document.content.0.columns.colNumber",
"detail": "document.content.0.columns.colNumber: colNumber is retired; the schema writes columnCount; the window for the previous schema has closed.",
"retired": [
{ "path": "document.content.0.columns.colNumber", "word": "colNumber", "replacement": "columnCount", "lost": false, "reason": "CSS Multi-column 1 names it column-count" }
]
}

HTTP status codes​

StatusWhenRetryable
400A definition refused, a request parameter not valid, a rule of the resource brokenNo
401Missing, invalid or expired access tokenNo
402The plan does not include API access, the monthly allowance is used up, or the account is suspended for an unpaid invoiceNo - see the plan
403Insufficient permissions, the path naming another tenant, or a key used from an address its allow-list does not nameNo
404The resource does not existNo
408The request body arrived too slowly (REQUEST_TIMEOUT)Yes - send it again
409Changed by another request at the same time (CONFLICT), a name already in use (NAME_TAKEN), or the first request with an Idempotency-Key still running (IDEMPOTENCY_KEY_IN_FLIGHT)CONFLICT: reload and retry; IDEMPOTENCY_KEY_IN_FLIGHT: wait and retry
412The resource changed since the version named in If-Match (PRECONDITION_FAILED)Read it again, then make the change on what it is now
413The request body is over 1 MBNo
429Rate limit exceededYes - wait the seconds in Retry-After
500A render that failed, or an unexpected server errorMaybe - retry once
503The render worker, database, storage, or an external service temporarily unavailableYes - see retryAfterSeconds

Error codes​

A code is part of the contract: it is never renamed, and a new one is announced in the changelog. Each code's type is this page at its anchor.

The request​

CodeStatusTitleWhen
BAD_REQUEST400The request could not be readThe request could not be read: a body cut short, a webhook that is not one
VALIDATION_ERROR400A request parameter is not validA parameter or a request member is missing, malformed or out of range; target names it, errors lists a form's fields
INVALID_CONTENT_TYPE400The body is not sent as JSONA route that reads JSON was sent another Content-Type
RULE_VIOLATION400The request breaks a rule of the resourceThe request breaks a rule of the resource (a revision named differently from its parent, say)
INVALID_TENANT_ID400The tenant id is not a valid identifierThe tenant id in the path is not an identifier
TENANT_ACCESS_ERROR400The tenant could not be resolvedThe tenant could not be resolved from the credential
METHOD_NOT_ALLOWED405The resource does not answer this methodThe path exists, not with this method
UNSUPPORTED_MEDIA_TYPE415The body is not in a media type this resource readsThe body is in a media type the route does not read
PAYLOAD_TOO_LARGE413The request is larger than the server acceptsThe request body is over its cap (1 MB through the API), or the definition's text over 16 MiB
REQUEST_TIMEOUT408The request body was not received in timeThe body arrived more slowly than the server reads one; send it again

A document definition refused​

CodeStatusTitleWhen
INVALID_JSON400The definition is not JSONThe definition is not JSON
SCHEMA400The definition is not on the schemaA key the schema does not name, a value of the wrong kind, a required member missing, or no document or component root
OUT_OF_RANGE400A value is outside its rangeA number outside the bounds its key allows
UNKNOWN_VALUE400A value is not one the key takesA word outside the set its key declares
PATTERN_MISMATCH400A value is not in the form the key takesA string not in the form its key's pattern states
MISSING_REQUIRED400A key another key requires is missingA key another key requires beside it
CONFLICTING_PROPERTIES400Two keys that exclude each other are both setTwo keys on one node that exclude each other
EMPTY_NODE400A content node is emptyA content node with no key at all ({})
EMPTY_CONTENT400The document has no contentA document whose content array is empty
RETIRED400The definition uses a retired wordA word of the previous schema that cannot be translated; retired lists every one
REFUSED400The document was refusedThe render refused the document for a reason no other code names
UNRESOLVED_COMPONENT400A component the document uses does not existA use names a component the tenant does not have
SIGNATURE_NOT_APPLIED400The signature the document asks for cannot be appliedIts certificate was not found or could not be read

A document past a resource limit​

CodeStatusTitleWhen
ASSETS_TOO_LARGE400The files the document names are too large togetherOver 64 MiB together
IMAGES_TOO_LARGE400The document's images are too large togetherOver 512 MiB decoded, together
NESTING_TOO_DEEP400The document nests too deeplyThe composed document nests past the limit
EQUATION_TOO_DEEP400An equation nests too deeplyOver 64 grouping levels in one equation
EQUATIONS_TOO_LARGE400The document's equations are too long togetherOver 65,536 characters of equation source
CONTENT_TOO_LARGE400Data binding added too many content nodesOver 250,000 nodes added by data binding
TOO_MANY_COMPONENTS400The document uses too many componentsOver 1,000 component uses
TABLE_TOO_LARGE400The document's tables have too many cellsOver 100,000 table cells
TOO_MANY_PAGES400The document has too many pagesOver 10,000 pages in one PDF
BARCODES_TOO_LARGE400The document's barcodes draw too many marksOver 250,000 barcode marks
SVG_TOO_LARGE400The document's svg draws too many path segmentsOver 250,000 svg path segments
TOO_MANY_BACKGROUND_TILES400A tiled background repeats too many timesOver 250,000 copies of a tiled background image
TOO_MANY_BALANCE_TRIALS400Balancing the columns took too many layoutsOver 5,000 layouts tried to balance flowing columns

Who is asking​

CodeStatusTitleWhen
UNAUTHORIZED401Authentication is requiredNo access token, or one that is invalid or expired
ACCESS_DENIED401Access deniedThe credential was refused
INVALID_CREDENTIALS401The email or password is not correctSigning in to the app
EMAIL_NOT_CONFIRMED400The email address is not confirmed yetSigning in before the confirmation mail was followed
SESSION_ENDED401The session has endedThe app's session cannot be renewed; sign in again
SESSION_RENEWED409Another request renewed the session a moment agoAnother tab renewed the session first; use its token
TWO_FACTOR_NOT_STARTED401No two-factor sign-in is in progressA code was sent with no sign-in waiting for it
TWO_FACTOR_NOT_ENABLED400Two-factor authentication is not on for this accountA two-factor step for an account without it
INVALID_TWO_FACTOR_CODE400The code is not correctA sign-in code or recovery code that is not correct
ACCOUNT_LOCKED423The account is locked for a while after failed attemptsAfter repeated failed sign-ins; it opens again on its own
INVALID_TOKEN400The link is not valid or has expiredA confirmation, reset or invitation link that is wrong or has expired
PASSWORD_INCORRECT400The current password is not correctChanging a setting that asks for the current password
PASSWORD_REJECTED400The password was not acceptedA new password the password rules refuse; detail says which
CODE_RECENTLY_SENT429A code was sent moments agoAsking for another code inside the wait; resendAfterSeconds says how long
TOO_MANY_ATTEMPTS429Too many failed attemptsRepeated failed attempts at a protected change

What the plan, the tenant or the role allows​

CodeStatusTitleWhen
API_ACCESS_NOT_IN_PLAN402The plan does not include API accessThe free plan, after its trial
MONTHLY_ALLOWANCE_REACHED402The plan's documents for the month are used upThe plan's documents for the month are used up
ACCOUNT_SUSPENDED402The account is suspended until an unpaid invoice is settledUntil an unpaid invoice is settled
FORBIDDEN403The credential does not allow thisThe token has no permission for this resource
TENANT_CLAIM_MISSING403The credential names no tenantThe token carries no tenant
TENANT_MISMATCH403The path names another tenant than the credentialThe path's {tenantId} is not the credential's tenant
IP_NOT_ALLOWED403The key is used from an address its allow-list does not nameThe tenant's IP allow-list does not name the caller's address
ROLE_RANK403The action needs a role above the caller'sGranting or changing a role above the caller's own
EMAIL_DELIVERY_NOT_ON_PLAN402The plan does not include email deliveryMailing a document on a plan without email delivery
EMAIL_DELIVERY_NOT_ENABLED403Email delivery is turned off for the organizationThe organization has not turned email delivery on
EMAIL_RECIPIENT_NOT_ALLOWED403A recipient is outside the organization's allowed domainsAn address outside the domains the organization allows
EMAIL_DELIVERY_CEILING429The organization's mails for the day are used upThe organization's daily mail ceiling is reached

The resource​

CodeStatusTitleWhen
NOT_FOUND404The resource does not existThe template, document, key or other resource does not exist, or is not the tenant's
FILE_NOT_FOUND404The file does not existAn asset or another stored file that does not exist
CONFLICT409It was changed by another request at the same timeChanged by another request at the same time; reload and retry
NAME_TAKEN409The name is already in useA template, folder, slug or identifier already in use; choose another
PRECONDITION_FAILED412The resource changed since it was readThe If-Match names a version that is no longer the resource's, or the resource is gone; nothing was changed. Read it again and make the change on what it is now
IDEMPOTENCY_KEY_INVALID400The Idempotency-Key is not oneThe key is not a quoted string of 1 to 255 printable ASCII characters (Retrying safely)
IDEMPOTENCY_KEY_IN_FLIGHT409A request is outstanding for this Idempotency-KeyThe first request with this key still runs; wait and send it again
IDEMPOTENCY_KEY_REUSED422The Idempotency-Key is already usedThe key was sent with another request; send a new key
RATE_LIMIT_EXCEEDED429Too many requestsWait the seconds in Retry-After
REQUEST_CANCELLED499The request was cancelledThe caller closed the request

The server and what it depends on​

CodeStatusTitleWhen
INTERNAL_ERROR500An unexpected error occurredAn unexpected server error; retry once, then contact support with the requestId
EMAIL_TEMPLATE_MISSING500A mail template is missing on the serverA mail the server sends could not be written
DATABASE_ERROR500A database error occurredA database error that will not pass on its own
FEATURE_UNAVAILABLE503This deployment does not offer the featureThis deployment does not offer the feature
RENDER_WORKER_UNAVAILABLE503The render worker is not answeringRetryable, after 30 s
DATABASE_UNAVAILABLE503The database is temporarily unavailable
DATABASE_CONNECTION_FAILED503The database could not be reached
DATABASE_TIMEOUT503The database did not answer in time
DATABASE_CONSTRAINT_VIOLATION503A database constraint refused the change
BLOB_STORAGE_ERROR503File storage is temporarily unavailable
KEY_STORE_ERROR503The key store is temporarily unavailable
STORAGE_SERVICE_ERROR503A storage service is temporarily unavailable
EXTERNAL_SERVICE_ERROR503An external service is temporarily unavailable
EXTERNAL_HTTP_SERVICE_ERROR502An external service answered with an error
EMAIL_SERVICE_ERROR503The email service is temporarily unavailable
PAYMENT_PROVIDER_UNAVAILABLE503The payment provider is temporarily unavailable
NETWORK_ERROR503A network connection failed
SERVICE_TIMEOUT503A service did not answer in time
OPERATION_TIMEOUT503The operation took too long
SERVICE_UNAVAILABLE503The service is temporarily unavailableThe server is starting, stopping or overloaded
MEMORY_EXHAUSTED507Server memory is temporarily exhausted
CONNECTION_POOL_EXHAUSTED507Database connections are temporarily exhausted

Rate limiting​

A request over a rate limit is answered 429 with RATE_LIMIT_EXCEEDED, and the Retry-After header gives the seconds to wait before the limit resets. RateLimit says which limit is spent, and the problem's violated-policies names it. The problem is retryable: its isRetryable is true, and its retryAfterSeconds holds the same seconds as the header:

HTTP/1.1 429 Too Many Requests
Retry-After: 37
RateLimit: "workspace";a=5412, "documents";a=0;w=37
Content-Type: application/problem+json

{ "code": "RATE_LIMIT_EXCEEDED", "violated-policies": ["documents"], "isRetryable": true, "retryAfterSeconds": 37, ... }

The limits themselves are listed under Rate limits.

Best practices​

  1. Check the HTTP status first, then read the body: every refusal is application/problem+json.
  2. Branch on code, never on detail or title: those are for people and may be reworded.
  3. Use target to point at the field, or the place in the definition, that was refused.
  4. Retry on 409 CONFLICT, 429 and 503 with backoff, waiting retryAfterSeconds or the Retry-After header.
  5. Do not retry on 400, 401, 402, 403, 404 or 413: fix the request first.
  6. Log requestId for server errors, and include it when contacting support.
  7. Validate locally against the JSON Schema to catch a definition's errors before sending it.