Errors¶
Every refusal is an RFC 9457 problem document with the
content type application/problem+json:
{
"type": "https://github.com/tonysantana1492/pressjet/blob/main/docs/errors.md#invalid-document",
"title": "The document cannot be rendered",
"status": 422,
"code": "invalid_document",
"detail": "Invalid visual layout: unknown font family at /children/0/children/2/properties/style/fontFamily",
"requestId": "4f1c0e2a9b7d3c5e8f6a1b2c"
}
Switch on code; it never changes meaning. title is for people, detail (present for
invalid_request, invalid_document and limit_exceeded) says what is wrong and, for documents,
where, as a JSON Pointer into the layout. Details describe
structure only; they repeat no document content beyond key names the caller wrote, shortened.
The SDKs raise these as typed errors with the same fields, and retry the ones marked retried.
| Code | Status | Meaning | What to do |
|---|---|---|---|
unauthorized |
401 | No Authorization: Bearer key, or one the server does not know. |
Check the key and that it is not disabled. |
forbidden |
403 | The key may not call this operation. | Add the operation to the key's operations. |
origin_not_allowed |
403 | A publishable key was used without an allowed Origin. |
Add the origin to the key's allowedOrigins, or call from your server with a secret key. |
not_found |
404 | No such endpoint. | See spec/openapi.yaml. |
method_not_allowed |
405 | Operations take POST. |
|
unsupported_media_type |
415 | The body is not application/json. |
Set Content-Type: application/json. |
payload_too_large |
413 | The body exceeds PRESSJET_MAX_REQUEST_BYTES. |
Shrink images, or raise the limit on your server. |
request_timeout |
408 | The body took longer than the deadline to arrive. | |
rate_limited |
429 | The key spent its rate limit (RateLimit-* headers show the budget), or already has its share of requests in progress (detail says so). Retry-After says when to try again. |
Retried. Slow down, or raise the key's rateLimit or maxConcurrent. |
server_busy |
503 | Every worker is busy and the queue is full. Retry-After: 1. |
Retried. Add workers or instances. |
shutting_down |
503 | The server is stopping. | Retried. |
html_not_configured |
501 | The HTML service is disabled. | Enable the HTML Compose overlay. |
signing_not_configured |
501 | The server has no signing certificate. | Configure PRESSJET_SIGNING_P12_BASE64. |
invalid_request |
400 | The body is not JSON, lacks "version": 1, or has an unknown field. |
Read detail. |
invalid_document |
422 | The document, flow, PDF or options cannot be rendered: an unknown style, a misplaced node, a corrupt image or PDF. | Read detail; validate against the schema. |
limit_exceeded |
422 | The request is valid but exceeds a server limit: pages, nodes, pixels or output size. | Split the document or raise the limit on your server. |
render_timeout |
504 | Rendering (with its wait in the queue) passed PRESSJET_TIMEOUT_MS. The worker was replaced. |
Retried. Simplify the document or raise the deadline. |
render_failed |
502 | The worker stopped, usually by hitting its memory cap. | Retried. Raise PRESSJET_WORKER_HEAP_MB or shrink images. |
internal_error |
500 | A bug. | Report it with the requestId. |