API reference

Carousels

Use with your agent

Give this prompt to your AI agent. The agent does the task for you.

Read https://thirds.ai/docs/api-reference/carousels and help me choose the right thirds.ai endpoint and write a request. Check the fields and credentials in this reference.

Render selected pages of one saved template version as images, poll each slide, retry failed slides, and download a ZIP of the files that succeeded.

See all API resources or read API keys and requests.

Endpoints

createCarousel

POST /v1/carousels

Create a carousel

Render selected pages of one saved template version as images, in the requested order. Creates one normal image job per page. The ledger reserves one credit per job, settles it on success, and releases it on failure. A successful PDF of the same pages still costs one credit through POST /v1/pdf.

Authentication: bearer API key. See authentication.

ParameterLocationRequiredRule
Idempotency-KeyheaderYes{"type":"string","minLength":1,"maxLength":255,"pattern":"^[ -~]+$"}

Request body: application/json, CarouselCreate.

StatusMeaningBody
201The carousel was created, or an earlier request with the same idempotency key and body is replayed.application/json: Carousel
400The one error envelope every backend response uses.application/json: ErrorEnvelope
401The one error envelope every backend response uses.application/json: ErrorEnvelope
403The authenticated account is suspended. The code is account_suspended.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
409The one error envelope every backend response uses.application/json: ErrorEnvelope
413The one error envelope every backend response uses.application/json: ErrorEnvelope
415The one error envelope every backend response uses.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope
503The one error envelope every backend response uses.application/json: ErrorEnvelope

getCarousel

GET /v1/carousels/{id}

Get a carousel's status

Returns the carousel with each member's own state and, once any member has succeeded, a signed archive_url for the ZIP of every succeeded file.

Authentication: bearer API key. See authentication.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^carousel_[0-9a-f]{32}$"}
StatusMeaningBody
200The carousel's current status.application/json: Carousel
401The one error envelope every backend response uses.application/json: ErrorEnvelope
403The authenticated account is suspended. The code is account_suspended.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope

retryCarousel

POST /v1/carousels/{id}/retry

Retry a carousel's failed members

Creates one new job for every member whose last attempt failed or that never reached a job. A queued, running, or already succeeded member is left untouched.

Authentication: bearer API key. See authentication.

ParameterLocationRequiredRule
idpathYes{"type":"string","pattern":"^carousel_[0-9a-f]{32}$"}
StatusMeaningBody
200The carousel after retry, with a new job for each member that was retried.application/json: CarouselRetry
401The one error envelope every backend response uses.application/json: ErrorEnvelope
403The authenticated account is suspended. The code is account_suspended.application/json: ErrorEnvelope
404The one error envelope every backend response uses.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
429The one error envelope every backend response uses.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500The one error envelope every backend response uses.application/json: ErrorEnvelope

getCarouselArchive

GET /v1/carousels/archive/{token}

Download a carousel's ZIP archive

Stream a ZIP of one carousel's succeeded members, in requested order with numbered filenames such as 01-cover.png, plus manifest.json recording that order and any failed pages. The link carries its own authority, so no other credential is read.

Authentication: no credential required.

ParameterLocationRequiredRule
tokenpathYesThe signed archive link. {"type":"string"}
StatusMeaningBody
200The ZIP archive of succeeded members plus manifest.json.application/zip: {"type":"string","format":"binary"}
403The link is genuine but its time is over.application/json: ErrorEnvelope
404The link is not valid, or the carousel has no succeeded member to archive.application/json: ErrorEnvelope
405The method is not allowed on this route.application/json: ErrorEnvelope
431The request has more than 64 headers or more than 32 KiB of header names and values.application/json: ErrorEnvelope
500An internal error occurred.application/json: ErrorEnvelope

Schemas

CarouselCreate

FieldRequiredDescription and type
template_idYesTemplateId
versionNoOmitted to use the template's latest version at creation time. {"type":"integer","minimum":1}
dataNoTemplate data applied to every selected page. Omitted to use an empty object. {"type":"object"}
formatYes{"type":"string","enum":["png","jpeg","webp"]}
pagesYes1 to 100 different canvas data-thirds-page ids in output order. {"type":"array","items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_-]{0,63}$"},"minItems":1,"maxItems":100}

Schema rules: {"type":"object","additionalProperties":false}.

CarouselMember

FieldRequiredDescription and type
positionYes{"type":"integer","minimum":0}
page_idYes{"type":"string"}
nameYes{"type":"string"}
widthYes{"type":"integer","minimum":1}
heightYes{"type":"integer","minimum":1}
stateYes{"type":"string","enum":["queued","running","succeeded","failed"]}
errorYes{"type":["object","null"],"properties":{"code":{"type":"string"}},"required":["code"],"additionalProperties":false}
download_urlYes{"type":["string","null"]}

Schema rules: {"type":"object","additionalProperties":false}.

FieldRequiredDescription and type
idYes{"type":"string","pattern":"^carousel_[0-9a-f]{32}$"}
template_idYesTemplateId
versionYes{"type":"integer","minimum":1}
formatYes{"type":"string","enum":["png","jpeg","webp"]}
created_atYes{"type":"string","format":"date-time"}
stateYes{"type":"string","enum":["queued","running","complete","partial","failed"]}
membersYes{"type":"array","items":{"$ref":"#/components/schemas/CarouselMember"}}CarouselMember
archive_urlYesA signed ZIP download link, present once any member has succeeded. {"type":["string","null"]}

Schema rules: {"type":"object","additionalProperties":false}.

CarouselRetry

Schema rules: Carousel.

Shared errors, headers, and authentication schemes are in shared types and security.

Ready to make your first file?

Start in the playground with a gallery template, or get an API key and send your first request from your own terminal.