Composite captions onto images
const url = 'https://api.loomta.com/public/v1/slides/composite';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"slides":[{"index":0,"mediaId":"a1d4e9b2-3c5f-4a8d-b0e1-2f6c7a9d8b3e","caption":"Reason 1"},{"index":1,"mediaId":"b2e5f0c3-4d6a-4b9e-c1f2-3a7d8b0e9c4f","caption":"Reason 2"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.loomta.com/public/v1/slides/composite \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "slides": [ { "index": 0, "mediaId": "a1d4e9b2-3c5f-4a8d-b0e1-2f6c7a9d8b3e", "caption": "Reason 1" }, { "index": 1, "mediaId": "b2e5f0c3-4d6a-4b9e-c1f2-3a7d8b0e9c4f", "caption": "Reason 2" } ] }'Bakes captions onto already-uploaded images, producing new composited media. Feed the returned mediaIds into POST /posts. Does not spend AI credits.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The images to bake captions onto, one entry per slide.
object
Required. 0-based slide order in the finished carousel.
Required. A READY image media id (from POST /media or GET /media).
Required. The text baked onto this slide’s image.
Optional override. Caption font-style preset — one of the values listed. Omit to use the workspace’s configured default (which falls back to tiktok-sans).
Optional override. Base caption font size baked onto the image. Omit to use the workspace default (falls back to medium).
Examples
Minimal — inherits workspace text style + size
{ "slides": [ { "index": 0, "mediaId": "a1d4e9b2-3c5f-4a8d-b0e1-2f6c7a9d8b3e", "caption": "Reason 1" }, { "index": 1, "mediaId": "b2e5f0c3-4d6a-4b9e-c1f2-3a7d8b0e9c4f", "caption": "Reason 2" } ]}Override font style + caption size for this call
{ "slides": [ { "index": 0, "mediaId": "a1d4e9b2-3c5f-4a8d-b0e1-2f6c7a9d8b3e", "caption": "Reason 1" } ], "textStyleId": "anton", "captionSize": "large"}Responses
Section titled “Responses”The composited slide media.
object
object
Examplegenerated
{ "slides": [ { "index": 1, "mediaId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}The request body failed validation.
object
A stable, machine-readable error code to branch on.
A human-readable description.
Optional structured detail (for example Zod validation issues).
Example
{ "code": "invalid_request", "message": "The request payload is invalid.", "details": [ { "path": [ "slideCount" ], "message": "Number must be greater than or equal to 3" } ]}The API key is missing or invalid.
object
A stable, machine-readable error code to branch on.
A human-readable description.
Optional structured detail (for example Zod validation issues).
Examples
{ "code": "missing_api_key", "message": "A Bearer API key is required."}{ "code": "invalid_api_key", "message": "The API key is invalid."}