Skip to content

Composite captions onto images

POST
/public/v1/slides/composite
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.

Media typeapplication/json
object
slides
required

The images to bake captions onto, one entry per slide.

Array<object>
>= 1 items <= 35 items
object
index
required

Required. 0-based slide order in the finished carousel.

integer
mediaId
required

Required. A READY image media id (from POST /media or GET /media).

string format: uuid
caption
required

Required. The text baked onto this slide’s image.

string
>= 1 characters <= 500 characters
textStyleId

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).

string
Allowed values: tiktok-sans anton montserrat poppins league-spartan
captionSize

Optional override. Base caption font size baked onto the image. Omit to use the workspace default (falls back to medium).

string
Allowed values: small medium large
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"
}
]
}

The composited slide media.

Media typeapplication/json
object
slides
required
Array<object>
object
index
integer
mediaId
string format: uuid
Examplegenerated
{
"slides": [
{
"index": 1,
"mediaId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}
]
}

The request body failed validation.

Media typeapplication/json
object
code
required

A stable, machine-readable error code to branch on.

string
message
required

A human-readable description.

string
details

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.

Media typeapplication/json
object
code
required

A stable, machine-readable error code to branch on.

string
message
required

A human-readable description.

string
details

Optional structured detail (for example Zod validation issues).

Examples
{
"code": "missing_api_key",
"message": "A Bearer API key is required."
}