{"openapi":"3.1.0","info":{"title":"Orsnap Render API","version":"1.0.0","summary":"Render templates to PNG, JPEG, WebP, PDF or MP4 with account API keys.","description":"A Bearer-authenticated JSON API for rendering published templates. Send an API key created in the Developers console as `Authorization: Bearer <key>`. Every key is limited to 60 requests per minute.\n\nRender creation is idempotent: `POST /api/v1/renders` requires an `Idempotency-Key` header, and replaying a key with the same body returns the original result.\n\nKey and webhook management are session-only screens (`/app/developers`), not part of this API. `GET /api/v1/webhooks` reads delivery history for the calling key's account; webhook endpoints themselves are created and disabled in the console.","contact":{"name":"Orsnap","url":"https://example.com"}},"servers":[{"url":"/","description":"The origin that serves this document."}],"security":[{"BearerAuth":[]}],"tags":[{"name":"Renders","description":"Create renders, poll their state and download files."},{"name":"Templates","description":"List published templates and read their parameter contracts."},{"name":"Logs","description":"Read the render history of the calling key."},{"name":"Webhooks","description":"Read webhook delivery attempts."}],"paths":{"/api/v1/renders":{"post":{"tags":["Renders"],"summary":"Create a render","description":"Starts a render for one template version or draft revision. In sync mode the response waits for the render (up to 25 seconds) and returns 200 with the files; if it is still running, the response is 202 with a Location header to poll. In async mode the response is always 202. The same Idempotency-Key with the same body replays the original response; a different body returns 409 IDEMPOTENCY_CONFLICT. MP4 uses the selected template's saved animation by default. Send animation overrides to customize this render.","operationId":"createRender","x-sdk":"studio.render(input) / studio.renderAsync(input)","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Unique key of 16-100 characters from A-Z, a-z, 0-9, underscore or hyphen. A UUID works. Retries of the same request must reuse the key.","schema":{"type":"string","pattern":"^[a-zA-Z0-9_-]{16,100}$"},"example":"1f0c2d8e-6a4b-4c9e-9f21-7d5b3a2c1e0f"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderRequest"},"examples":{"syncWithTextOverrides":{"summary":"Render page 1 with two text overrides","value":{"templateId":"t3f9a2c7d1e84b6f0a5c9d3e7b2f8a41","version":4,"modifications":{"headline":"Spring launch","price":"42"},"output":{"format":"png","scale":2,"pages":[1]}}},"asyncVideo":{"summary":"Queue an MP4 with request-only animation overrides","value":{"templateId":"t3f9a2c7d1e84b6f0a5c9d3e7b2f8a41","version":4,"mode":"async","modifications":{"headline":"Spring launch","price":"42"},"output":{"format":"mp4","pages":[1]},"animation":{"pages":[{"page":1,"preset":"cinema-cut","focus":"headline","durationMs":3600}]}}},"asyncToWebhook":{"summary":"Queue a PDF render and notify a webhook","value":{"templateId":"t3f9a2c7d1e84b6f0a5c9d3e7b2f8a41","version":4,"mode":"async","webhookId":"e8c4a1d6f3b9e2a5c7d0f4b8a6e1c3d9","output":{"format":"pdf"}}}}}}},"responses":{"200":{"description":"The render finished before the sync wait elapsed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderSuccess"},"example":{"data":{"id":"g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1","status":"succeeded","format":"png","pages":1,"credits":{"available":980,"reserved":0,"spent":20},"files":[{"id":"f4a2c6e8b0d1f3a5c7e9b2d4f6a8c0e1","name":"spring-launch-poster-1.png","sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","size":184320,"width":1200,"height":1600,"page":1,"url":"/api/v1/renders/g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1/files/f4a2c6e8b0d1f3a5c7e9b2d4f6a8c0e1?token=v1.4f2c...","expiresAt":"2026-11-24T13:40:00.000Z"}]},"requestId":"2b7e1516-28ae-4b7d-9c3a-6f1e2d4c5b6a"}}}},"202":{"description":"The render is queued or running. Poll the Location header or GET /api/v1/renders/{id}.","headers":{"Location":{"description":"Absolute URL of the render resource.","schema":{"type":"string","format":"uri"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderAccepted"},"example":{"data":{"id":"g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1","status":"running"},"requestId":"2b7e1516-28ae-4b7d-9c3a-6f1e2d4c5b6a"}}}},"400":{"description":"The body or idempotency key is malformed.","x-error-codes":["INVALID_JSON","REQUEST_TOO_LARGE","INVALID_REQUEST","IDEMPOTENCY_KEY_REQUIRED","IDEMPOTENCY_KEY_INVALID"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"The Bearer key is missing, unknown or revoked.","x-error-codes":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"402":{"description":"The account has no credits left for this render.","x-error-codes":["INSUFFICIENT_CREDITS"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The idempotency key or the pinned template version conflicts with current state.","x-error-codes":["IDEMPOTENCY_CONFLICT","SOURCE_CHANGED","REVISION_CONFLICT"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"The render input is invalid or the render failed. `error.issues` names the offending fields; `error.detail` carries the renderer code for RENDER_FAILED.","x-error-codes":["UNKNOWN_PARAMETER","MISSING_PARAMETER","INVALID_PARAMETER","INVALID_INPUT","OUTPUT_LIMIT","INVALID_PAGE","INVALID_CALLBACK_URL","INVALID_WEBHOOK","RENDER_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"The key passed 60 requests in one minute.","x-error-codes":["RATE_LIMITED"],"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A dependency is briefly unavailable; retry with backoff.","x-error-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/renders/{id}":{"get":{"tags":["Renders"],"summary":"Get a render","description":"Returns the current state of a render created by the calling key. Succeeded renders include fresh file links; a render still in flight returns 202 with a Location header. File URLs are short-lived and reissued by this call.","operationId":"getRender","x-sdk":"studio.getRender(id)","parameters":[{"name":"id","in":"path","required":true,"description":"Render id returned by POST /api/v1/renders.","schema":{"type":"string","pattern":"^g[a-f0-9]{32}$"},"example":"g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1"}],"responses":{"200":{"description":"The render succeeded; files are ready to download.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderSuccess"},"example":{"data":{"id":"g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1","status":"succeeded","format":"pdf","pages":2,"credits":{"available":980,"reserved":0,"spent":20},"files":[{"id":"f4a2c6e8b0d1f3a5c7e9b2d4f6a8c0e1","name":"spring-launch.pdf","sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","size":512000,"width":1200,"height":1600,"page":1,"url":"/api/v1/renders/g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1/files/f4a2c6e8b0d1f3a5c7e9b2d4f6a8c0e1?token=v1.4f2c...","expiresAt":"2026-11-24T13:40:00.000Z"}]},"requestId":"2b7e1516-28ae-4b7d-9c3a-6f1e2d4c5b6a"}}}},"202":{"description":"The render is queued or running.","headers":{"Location":{"description":"Absolute URL of the render resource.","schema":{"type":"string","format":"uri"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenderAccepted"},"example":{"data":{"id":"g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1","status":"queued"},"requestId":"2b7e1516-28ae-4b7d-9c3a-6f1e2d4c5b6a"}}}},"401":{"description":"The Bearer key is missing, unknown or revoked.","x-error-codes":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No render with this id belongs to the calling key.","x-error-codes":["NOT_FOUND"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"410":{"description":"The render's files passed their retention window.","x-error-codes":["FILE_EXPIRED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"422":{"description":"The render reached a failed terminal state.","x-error-codes":["RENDER_FAILED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"The key passed 60 requests in one minute.","x-error-codes":["RATE_LIMITED"],"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A dependency is briefly unavailable; retry with backoff.","x-error-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/renders/{id}/files/{fileId}":{"get":{"tags":["Renders"],"summary":"Download a render file","description":"Streams one rendered file. Authentication uses the Bearer key plus the short-lived `token` query parameter from the file URL. Expired links return 403 or 410; render again for fresh files.","operationId":"downloadRenderFile","x-sdk":"GET file.url with the same Bearer key","parameters":[{"name":"id","in":"path","required":true,"description":"Render id.","schema":{"type":"string","pattern":"^g[a-f0-9]{32}$"},"example":"g9b1c3d5e7f2a4b6c8d0e1f3a5b7c9d1"},{"name":"fileId","in":"path","required":true,"description":"File id from the render payload.","schema":{"type":"string"},"example":"f4a2c6e8b0d1f3a5c7e9b2d4f6a8c0e1"},{"name":"token","in":"query","required":true,"description":"Download token embedded in the file `url`.","schema":{"type":"string"}}],"responses":{"200":{"description":"The file bytes.","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"video/mp4":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"The Bearer key is missing, unknown or revoked.","x-error-codes":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The download token is missing or does not match this file.","x-error-codes":["DOWNLOAD_TOKEN_INVALID"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such render file belongs to the calling key.","x-error-codes":["NOT_FOUND"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"410":{"description":"The file passed its retention window.","x-error-codes":["FILE_EXPIRED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"The key passed 60 requests in one minute.","x-error-codes":["RATE_LIMITED"],"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A dependency is briefly unavailable; retry with backoff.","x-error-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/templates":{"get":{"tags":["Templates"],"summary":"List templates","description":"Lists the calling account's templates with their published version. Pass `nextCursor` back unchanged to read the next page.","operationId":"listTemplates","x-sdk":"studio.templates({ limit, cursor })","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"description":"`nextCursor` from the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"One page of templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateList"},"example":{"data":[{"id":"t3f9a2c7d1e84b6f0a5c9d3e7b2f8a41","name":"Spring launch poster","width":1200,"height":1600,"pages":2,"revision":7,"publishedVersion":4}],"nextCursor":"eyJvZmZzZXQiOjF9"}}}},"400":{"description":"The cursor or a query parameter is invalid.","x-error-codes":["INVALID_CURSOR","INVALID_REQUEST"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"The Bearer key is missing, unknown or revoked.","x-error-codes":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"The key passed 60 requests in one minute.","x-error-codes":["RATE_LIMITED"],"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A dependency is briefly unavailable; retry with backoff.","x-error-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/templates/{id}":{"get":{"tags":["Templates"],"summary":"Get a template contract","description":"Returns the template summary plus its parameter contract. Send exactly one of `version` (published) or `revision` (draft). The contract lists every accepted `modifications` key, its kind, default and enum options.","operationId":"getTemplate","x-sdk":"studio.template(id, { version, revision })","parameters":[{"name":"id","in":"path","required":true,"description":"Template id from GET /api/v1/templates.","schema":{"type":"string","pattern":"^t[a-f0-9]{32}$"},"example":"t3f9a2c7d1e84b6f0a5c9d3e7b2f8a41"},{"name":"version","in":"query","required":false,"description":"Published version to read. Mutually exclusive with `revision`.","schema":{"type":"integer","minimum":1},"example":4},{"name":"revision","in":"query","required":false,"description":"Draft revision to read. Mutually exclusive with `version`.","schema":{"type":"integer","minimum":1},"example":7}],"responses":{"200":{"description":"The template summary, parameter contract, and animation defaults and layer IDs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateDetail"},"example":{"id":"t3f9a2c7d1e84b6f0a5c9d3e7b2f8a41","name":"Spring launch poster","width":1200,"height":1600,"pages":2,"revision":7,"publishedVersion":4,"animation":{"pages":[{"page":1,"id":"p1","durationMs":5360,"preset":"cinema-cut","focus":"headline","layers":[{"id":"headline","type":"text","parentId":null,"label":"Headline","motion":null}]},{"page":2,"id":"p2","durationMs":4000,"preset":null,"layers":[]}]},"contract":{"templateId":"t3f9a2c7d1e84b6f0a5c9d3e7b2f8a41","version":{"kind":"published","version":4,"revision":7,"documentSha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"},"pages":[{"id":"p1","alias":"page1","name":"Cover","index":0},{"id":"p2","alias":"page2","name":"Details","index":1}],"parameters":[{"key":"headline","label":"Headline","kind":"string","type":"text","required":true,"defaultValue":"Spring launch","pageId":"p1","pageAlias":"page1","pageName":"Cover"},{"key":"price","label":"Price","kind":"string","type":"text","required":false,"defaultValue":"42","pageId":"p1","pageAlias":"page1","pageName":"Cover"}]}}}}},"400":{"description":"Exactly one of version or revision is required.","x-error-codes":["INVALID_REQUEST"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"The Bearer key is missing, unknown or revoked.","x-error-codes":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No template with this id belongs to the calling key.","x-error-codes":["NOT_FOUND"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"409":{"description":"The requested revision is not the template's current revision.","x-error-codes":["REVISION_CONFLICT","SOURCE_CHANGED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"The key passed 60 requests in one minute.","x-error-codes":["RATE_LIMITED"],"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A dependency is briefly unavailable; retry with backoff.","x-error-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/logs":{"get":{"tags":["Logs"],"summary":"List render logs","description":"Lists the renders created by the calling key, newest first. `nextCursor` is null on the last page.","operationId":"listLogs","x-sdk":"studio.logs({ limit, cursor })","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size between 1 and 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"description":"`nextCursor` from the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"One page of render logs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogList"},"example":{"data":[{"id":"r7c1e3a5b9d2f4c6e8a0b1d3f5c7e9a2b","status":"succeeded","format":"png","pages":1,"createdAt":"2026-11-17T13:40:00.000Z","durationMs":1840,"errorCode":null}],"nextCursor":null}}}},"400":{"description":"The cursor or a query parameter is invalid.","x-error-codes":["INVALID_CURSOR","INVALID_REQUEST"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"The Bearer key is missing, unknown or revoked.","x-error-codes":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"The key passed 60 requests in one minute.","x-error-codes":["RATE_LIMITED"],"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A dependency is briefly unavailable; retry with backoff.","x-error-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/api/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook deliveries","description":"Lists delivery attempts for the calling account's webhook endpoints, newest first. Endpoints are created, disabled and redelivered in the session-only Webhooks screen; this API only reads delivery history.","operationId":"listWebhookDeliveries","x-sdk":"studio.webhooks({ limit })","parameters":[{"name":"limit","in":"query","required":false,"description":"Number of deliveries to return, between 1 and 100.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Recent webhook delivery attempts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookList"},"example":{"data":[{"id":"w1a3c5e7b9d2f4a6c8e0b1d3f5a7c9e2b","requestId":"2b7e1516-28ae-4b7d-9c3a-6f1e2d4c5b6a","url":"https://example.com/hooks/studio","event":"render.succeeded","attempts":1,"deliveredAt":"2026-11-17T13:40:02.000Z","lastError":null,"createdAt":"2026-11-17T13:40:00.000Z"}]}}}},"400":{"description":"A query parameter is invalid.","x-error-codes":["INVALID_REQUEST"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"The Bearer key is missing, unknown or revoked.","x-error-codes":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"The key passed 60 requests in one minute.","x-error-codes":["RATE_LIMITED"],"headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"503":{"description":"A dependency is briefly unavailable; retry with backoff.","x-error-codes":["SERVICE_UNAVAILABLE"],"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API key from /app/developers. Send `Authorization: Bearer <key>` on every request."}},"schemas":{"ErrorCode":{"type":"string","description":"Stable machine-readable error code. The full catalog, with HTTP status and remedy, is published as `x-error-catalog` at the document root and rendered on /docs/api.","enum":["API_KEY_REQUIRED","API_KEY_INVALID","API_KEY_REVOKED","IDEMPOTENCY_KEY_REQUIRED","IDEMPOTENCY_KEY_INVALID","IDEMPOTENCY_CONFLICT","INVALID_JSON","REQUEST_TOO_LARGE","INVALID_REQUEST","INVALID_CURSOR","INSUFFICIENT_CREDITS","UNKNOWN_PARAMETER","MISSING_PARAMETER","INVALID_PARAMETER","INVALID_INPUT","INVALID_PAGE","OUTPUT_LIMIT","INVALID_CALLBACK_URL","INVALID_WEBHOOK","SOURCE_CHANGED","REVISION_CONFLICT","RENDER_FAILED","FILE_EXPIRED","DOWNLOAD_TOKEN_INVALID","NOT_FOUND","RATE_LIMITED","SERVICE_UNAVAILABLE"]},"Issue":{"type":"object","description":"One field-level problem in the request.","required":["field","code","message"],"properties":{"field":{"type":"string","description":"Request path of the offending value, for example `modifications.price`."},"code":{"type":"string","description":"Issue code, for example `INVALID_KIND` or `MISSING`."},"message":{"type":"string","description":"Human-readable explanation."}}},"Problem":{"type":"object","description":"The single error envelope used by every endpoint.","required":["error","requestId"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/Issue"}},"detail":{"type":"string","description":"Renderer-specific code, present on RENDER_FAILED."}}},"requestId":{"type":"string","description":"Identifier for this request; quote it in support requests."}}},"AnimationPreset":{"type":"string","enum":["staggered","spotlight","gentle","cinema-cut","gallery-glide","retail-punch","followspot","type-strike","offer-first","shutter-reveal"]},"AnimationFocus":{"type":"string","enum":["auto","hero","headline","message"]},"LayerTransition":{"type":"string","enum":["none","fade","slide-left","slide-right","slide-up","slide-down","scale","scale-up","scale-down","rotate","flip-x","flip-y"]},"LayerMotion":{"type":"object","additionalProperties":false,"description":"Omitted fields retain the existing explicit layer motion or use the editor defaults. A start value of null returns to absolute timing.","properties":{"showMs":{"type":"integer","minimum":0,"maximum":9999},"hideMs":{"type":["integer","null"],"minimum":1,"maximum":10000,"description":"Must follow showMs. Null leaves the layer visible until page end."},"start":{"type":["object","null"],"additionalProperties":false,"required":["mode","offsetMs"],"properties":{"mode":{"const":"after-previous"},"offsetMs":{"type":"integer","minimum":0,"maximum":10000}}},"enter":{"anyOf":[{"$ref":"#/components/schemas/LayerTransition"},{"type":"string","enum":["text-reveal","typewriter"]}],"description":"Text reveal and typewriter apply to text layers."},"enterMs":{"type":"integer","minimum":0,"maximum":10000},"ambient":{"type":"string","enum":["none","float","drift","wiggle","shake","pulse","rotate"]},"periodMs":{"type":"integer","minimum":250,"maximum":10000},"exit":{"$ref":"#/components/schemas/LayerTransition"},"exitMs":{"type":"integer","minimum":0,"maximum":10000},"strength":{"type":"integer","minimum":0,"maximum":100},"easing":{"type":"string","enum":["linear","ease-out","ease-in-out"]}}},"RenderAnimation":{"type":"object","additionalProperties":false,"required":["pages"],"description":"Optional overrides for MP4. Changes apply to the current render only.","properties":{"pages":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["page"],"properties":{"page":{"type":"integer","minimum":1,"description":"One-based template page number, included in the output page selection."},"preset":{"anyOf":[{"$ref":"#/components/schemas/AnimationPreset"},{"type":"null"}],"description":"Omit to keep the saved preset. Null clears the page preset and preserves explicit layer settings."},"focus":{"$ref":"#/components/schemas/AnimationFocus","description":"Available with Cinema Cut, Gallery Glide and Retail Punch."},"durationMs":{"type":"integer","minimum":1000,"maximum":10000},"layers":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["id","motion"],"properties":{"id":{"type":"string","description":"Layer ID from the template animation description."},"motion":{"anyOf":[{"$ref":"#/components/schemas/LayerMotion"},{"type":"null"}],"description":"An explicit override replaces this layer's inherited entrance. Null clears the explicit motion and restores page preset inheritance when available."}}}}}}}}},"TemplateAnimation":{"type":"object","required":["pages"],"properties":{"pages":{"type":"array","items":{"type":"object","required":["page","id","durationMs","preset","layers"],"properties":{"page":{"type":"integer","minimum":1},"id":{"type":"string"},"durationMs":{"type":"integer","minimum":1000,"maximum":10000},"preset":{"anyOf":[{"$ref":"#/components/schemas/AnimationPreset"},{"type":"null"}],"description":"The saved page preset. Basic presets store their settings on the layers."},"focus":{"$ref":"#/components/schemas/AnimationFocus"},"layers":{"type":"array","items":{"type":"object","required":["id","type","parentId","motion"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["text","image","group","rect","ellipse","line"]},"parentId":{"type":["string","null"]},"label":{"type":"string"},"motion":{"anyOf":[{"$ref":"#/components/schemas/LayerMotion"},{"type":"null"}]}}}}}}}}},"RenderOutput":{"type":"object","additionalProperties":false,"description":"Output options. MP4 requires scale 1 and the template background. It produces one silent H.264 clip at 24 fps for up to 30 seconds of selected pages.","properties":{"format":{"type":"string","enum":["png","jpeg","webp","pdf","mp4"],"default":"png"},"scale":{"type":"integer","enum":[1,2],"default":1,"description":"Pixel density multiplier."},"background":{"type":"string","enum":["template","transparent"],"default":"template"},"pages":{"type":"array","description":"1-based page numbers to render; omitted renders every page.","items":{"type":"integer","minimum":1},"minItems":1,"uniqueItems":true},"fileName":{"type":"string","maxLength":80,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_-]*$","description":"Base file name without extension."}}},"RenderRequest":{"type":"object","additionalProperties":false,"required":["templateId"],"description":"Send exactly one of version or revision.","properties":{"templateId":{"type":"string","pattern":"^t[a-f0-9]{32}$","description":"Template id from GET /api/v1/templates."},"version":{"type":"integer","minimum":1,"description":"Published version to render."},"revision":{"type":"integer","minimum":1,"description":"Draft revision to render."},"modifications":{"type":"object","description":"Values for the template's contract parameters, keyed by parameter key. Unknown keys return UNKNOWN_PARAMETER; kind mismatches return INVALID_PARAMETER.","additionalProperties":{"type":["string","number","boolean"]}},"output":{"$ref":"#/components/schemas/RenderOutput"},"animation":{"$ref":"#/components/schemas/RenderAnimation"},"response":{"type":"object","additionalProperties":false,"description":"Response shape options. `url` returns short-lived links.","properties":{"type":{"type":"string","enum":["url"],"default":"url"}}},"mode":{"type":"string","enum":["sync","async"],"default":"sync","description":"sync waits up to 25 seconds; async returns immediately."},"callbackUrl":{"type":"string","format":"uri","maxLength":2048,"description":"Public HTTPS endpoint called when the render finishes. Mutually exclusive with webhookId."},"webhookId":{"type":"string","pattern":"^e[a-f0-9]{32}$","description":"Active webhook endpoint of this account. Mutually exclusive with callbackUrl."}},"oneOf":[{"required":["version"]},{"required":["revision"]}],"not":{"required":["version","revision"]}},"Credits":{"type":"object","required":["available","reserved","spent"],"properties":{"available":{"type":"integer","minimum":0,"description":"Credits the account can spend now."},"reserved":{"type":"integer","minimum":0,"description":"Credits held by queued or running renders."},"spent":{"type":"integer","minimum":0,"description":"Credits spent by finished renders."}}},"RenderFile":{"type":"object","required":["id","name","sha256","size","width","height","page","url","expiresAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"size":{"type":"integer","minimum":0,"description":"Bytes."},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"page":{"type":["integer","null"],"minimum":1,"description":"Original page number for image files. Null for a combined PDF or MP4."},"url":{"type":"string","description":"Short-lived download URL. It already contains the token; send the same Bearer key."},"expiresAt":{"type":"string","format":"date-time"}}},"RenderSuccess":{"type":"object","required":["data","requestId"],"properties":{"data":{"type":"object","required":["id","status","format","pages","credits","files"],"properties":{"id":{"type":"string","pattern":"^g[a-f0-9]{32}$"},"status":{"const":"succeeded"},"format":{"type":"string","enum":["png","jpeg","webp","pdf","mp4"]},"pages":{"type":"integer","minimum":1,"description":"Number of pages rendered."},"credits":{"$ref":"#/components/schemas/Credits"},"files":{"type":"array","items":{"$ref":"#/components/schemas/RenderFile"}}}},"requestId":{"type":"string"}}},"RenderAccepted":{"type":"object","required":["data","requestId"],"properties":{"data":{"type":"object","required":["id","status"],"properties":{"id":{"type":"string","pattern":"^g[a-f0-9]{32}$"},"status":{"type":"string","enum":["queued","running","succeeded","failed","expired"]}}},"requestId":{"type":"string"}}},"TemplateSummary":{"type":"object","required":["id","name","width","height","pages","revision","publishedVersion"],"properties":{"id":{"type":"string","pattern":"^t[a-f0-9]{32}$"},"name":{"type":"string"},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1},"pages":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"publishedVersion":{"type":["integer","null"],"minimum":1,"description":"Null when the template has never been published."}}},"ParameterSpec":{"type":"object","additionalProperties":true,"required":["key","label","kind","type","required","defaultValue"],"properties":{"key":{"type":"string","description":"Key accepted in modifications."},"label":{"type":"string"},"kind":{"type":"string","enum":["string","number","boolean","color","link","asset","font","enum"]},"type":{"type":"string","description":"Document field type."},"required":{"type":"boolean"},"defaultValue":{"type":["string","number","boolean","null"]},"pageId":{"type":["string","null"]},"pageAlias":{"type":["string","null"]},"pageName":{"type":["string","null"]},"enum":{"type":"array","items":{"type":"string"}},"help":{"type":["string","null"]}}},"ParameterContract":{"type":"object","description":"Normalized template contract: the source of truth for accepted modifications.","required":["templateId","version","pages","parameters"],"properties":{"templateId":{"type":"string"},"version":{"type":"object","required":["kind","revision","documentSha256"],"properties":{"kind":{"type":"string","enum":["draft","published"]},"version":{"type":"integer","minimum":1},"revision":{"type":"integer","minimum":1},"documentSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"pages":{"type":"array","items":{"type":"object","required":["id","alias","name","index"],"properties":{"id":{"type":"string"},"alias":{"type":"string"},"name":{"type":"string"},"index":{"type":"integer","minimum":0}}}},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/ParameterSpec"}}}},"TemplateDetail":{"allOf":[{"$ref":"#/components/schemas/TemplateSummary"},{"type":"object","required":["contract","animation"],"properties":{"contract":{"$ref":"#/components/schemas/ParameterContract"},"animation":{"$ref":"#/components/schemas/TemplateAnimation"}}}]},"TemplateList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TemplateSummary"}},"nextCursor":{"type":"string","description":"Omitted on the last page."}}},"LogEntry":{"type":"object","required":["id","status","format","pages","createdAt","durationMs","errorCode"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","expired"]},"format":{"type":["string","null"]},"pages":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"durationMs":{"type":["integer","null"],"minimum":0},"errorCode":{"type":["string","null"]}}},"LogList":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LogEntry"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}}},"WebhookDelivery":{"type":"object","required":["id","requestId","url","event","attempts","deliveredAt","lastError","createdAt"],"properties":{"id":{"type":"string"},"requestId":{"type":"string"},"url":{"type":"string","format":"uri"},"event":{"type":"string","description":"Event name, for example `render.succeeded`."},"attempts":{"type":"integer","minimum":0},"deliveredAt":{"type":["string","null"],"format":"date-time"},"lastError":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}}},"WebhookList":{"type":"object","required":["data"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}}},"x-error-catalog":[{"code":"API_KEY_REQUIRED","status":"401","meaning":"No Bearer token was sent.","fix":"Send Authorization: Bearer <key>."},{"code":"API_KEY_INVALID","status":"401","meaning":"The key is unknown or malformed.","fix":"Create a key in the Developers console, or copy the one shown once at creation. Keys start with os_live_."},{"code":"API_KEY_REVOKED","status":"401","meaning":"The key was revoked.","fix":"Create a new key in the Developers console."},{"code":"IDEMPOTENCY_KEY_REQUIRED","status":"400","meaning":"The Idempotency-Key header is missing.","fix":"Send a unique key of 16-100 letters, digits, underscores or hyphens."},{"code":"IDEMPOTENCY_KEY_INVALID","status":"400","meaning":"The Idempotency-Key header has the wrong shape.","fix":"Use 16-100 letters, digits, underscores or hyphens."},{"code":"IDEMPOTENCY_CONFLICT","status":"409","meaning":"The same Idempotency-Key was reused with a different body.","fix":"Use a new Idempotency-Key for a different request."},{"code":"INVALID_JSON","status":"400","meaning":"The body is not a JSON object.","fix":"Send Content-Type: application/json with an object body."},{"code":"REQUEST_TOO_LARGE","status":"400","meaning":"The body is larger than 512 KB.","fix":"Trim modifications or split the request."},{"code":"INVALID_REQUEST","status":"400","meaning":"A field or query parameter is not supported.","fix":"Remove unknown fields; only the documented ones are accepted."},{"code":"INVALID_CURSOR","status":"400","meaning":"The pagination cursor cannot be decoded.","fix":"Start again without a cursor and follow nextCursor."},{"code":"INSUFFICIENT_CREDITS","status":"402","meaning":"The account has no credits left for this render.","fix":"Wait for the monthly allowance to reset or add credits in Billing."},{"code":"UNKNOWN_PARAMETER","status":"422","meaning":"A modification key does not exist on this template.","fix":"Read the contract from GET /api/v1/templates/:id first."},{"code":"MISSING_PARAMETER","status":"422","meaning":"A required parameter was not supplied.","fix":"Send every parameter whose contract entry says required."},{"code":"INVALID_PARAMETER","status":"422","meaning":"A value does not match its declared kind.","fix":"Numbers, colours (#rrggbb), links and enum options must match the contract."},{"code":"INVALID_INPUT","status":"422","meaning":"The request body is structurally invalid.","fix":"Read issues[].field in the response."},{"code":"OUTPUT_LIMIT","status":"422","meaning":"The render exceeds a duration, pixel or credit limit.","fix":"Select fewer pages or shorten the animation. MP4 is limited to 30 seconds."},{"code":"INVALID_PAGE","status":"422","meaning":"output.pages references a page this template does not have.","fix":"Ask for pages 1 to contract.pages.length."},{"code":"INVALID_CALLBACK_URL","status":"422","meaning":"callbackUrl is not a public https endpoint.","fix":"Use https on port 443 with a publicly resolvable host."},{"code":"INVALID_WEBHOOK","status":"422","meaning":"webhookId is unknown, belongs to another account, or the endpoint is disabled.","fix":"Pick an active endpoint in Webhooks, or send callbackUrl instead."},{"code":"SOURCE_CHANGED","status":"409","meaning":"The template changed after the request was prepared.","fix":"Send the request again with the current revision."},{"code":"REVISION_CONFLICT","status":"409","meaning":"revision does not match the template any more.","fix":"Read the template again and retry."},{"code":"RENDER_FAILED","status":"422","meaning":"The render reached a failed terminal state.","fix":"Check error.detail for the renderer code; retry with a new Idempotency-Key."},{"code":"FILE_EXPIRED","status":"410","meaning":"The rendered files passed their retention window.","fix":"Render again to get fresh files."},{"code":"DOWNLOAD_TOKEN_INVALID","status":"403","meaning":"The download token is missing, invalid or expired.","fix":"Use the url returned by the latest response."},{"code":"NOT_FOUND","status":"404","meaning":"The render or template does not belong to this key.","fix":"Check the id and use the key that created it."},{"code":"RATE_LIMITED","status":"429","meaning":"The key passed 60 requests in one minute.","fix":"Wait for Retry-After seconds."},{"code":"SERVICE_UNAVAILABLE","status":"503","meaning":"A dependency is briefly unavailable.","fix":"Retry with backoff."}]}