Skip to content

DocsDevelopers

Errors and pagination

The error shape, every error code and how lists are returned.

Every failure answers the same JSON shape, so you can branch on error.code and show error.message to people.

The error shape#

Response
{
  "error": {
    "code": "invalid_request",
    "message": "fields needs a storyId",
    "details": [{ "path": "fields", "message": "fields needs a storyId" }],
    "request_id": "req_Xk1E8YGNxZDS"
  }
}

details appears on validation errors, one entry per problem. request_id is also in the X-Request-Id header; quote it when you write to us.

Codes#

StatusCodeMeaning
400invalid_requestThe body or a parameter is invalid; see details.
401unauthorizedMissing, unknown, revoked or expired API key.
402insufficient_creditsThe workspace needs more credits for this (a render, or generations past the monthly quota).
403plan_requiredThe plan does not include this (the API, 4K, translations, more brand kits).
403forbiddenThe key may not do this.
404not_foundNo such object in this key's workspace.
405method_not_allowedThat HTTP method is not supported on this path.
409conflictThe object is not in a state that allows this yet (still generating, archived), or an idempotent request is still running.
413payload_too_largeThe body is larger than the endpoint accepts.
422idempotency_mismatchThe Idempotency-Key was already used with a different body.
422unprocessableThe request is well-formed but cannot be done (for example composition code that fails the safety check).
429rate_limitedToo many requests, or the plan's AI limits for now. Wait for Retry-After.
500server_errorSomething went wrong on our side. Retry; if it keeps happening, write to us with the request id.
503not_configuredThe service is temporarily unavailable.

Pagination#

There is no pagination. List endpoints return everything in one data array: GET /v1/stories every built-in story, GET /v1/brand-kits the workspace's kits (up to 200, default first).

Request size#

Bodies are JSON (Content-Type: application/json) up to 64 KB, or 512 KB for PATCH /v1/videos/:id, which can carry a whole video document.