POST /v1/projects/:projectId/content/slideshow-builder
Generate a hook-driven multi-image vertical slideshow.
/v1/projects/:projectId/content/slideshow-builder- Auth
- Bearer
- Scope
- content:write
Starts a content-generate job. Returns 202
with containerIds (single-element array — the partner surface never
fans out variants), a jobId, and a locationUrl.
The format is the URL — there is no format discriminator in the body. The only required input is hook. socialAccountId and influencerId are optional axes that resolve voice / language / influencer when supplied.
slideshow-builder is the only format that allows a layerless run with neither socialAccountId nor influencerId — the workflow falls back to the project's default voice and language. Every other format requires a named on-camera actor.
Path parameters
projectIdstring (uuid)requiredThe project to generate content for.
Body
hookstringrequiredUsed verbatim as the slideshow first-slide overlay. 1–2000 chars; line breaks and emoji preserved. Pull from `/content/hooks` or send your own.socialAccountIdstringoptionalConnected social-account id. Walks the wiring chain to anchor the container on the wired content layer and use that layer's influencer voice/language.influencerIdstringoptionalExplicit influencer override. Wins over the wired influencer when both are supplied. Required for partners with no connected social account who want a non-default voice.
Resolution rules
socialAccountId | influencerId | Behavior |
|---|---|---|
| Provided | — | Walk chain. Use wired influencer's voice/language. Container anchored to the wired content layer. |
| — | Provided | Use that influencer directly. Layerless container (unassigned pool). |
| Provided | Provided | Walk chain for layer anchoring; use the override for voice/language. |
| — | — | Project default voice/language. Layerless container. |
Request
curl -X POST https://api.layers.com/v1/projects/{projectId}/content/slideshow-builder \
-H "Authorization: Bearer $LAYERS_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"hook": "wait for it...\nthis simple habit changed everything 🧠"
}'const res = await fetch(
`https://api.layers.com/v1/projects/${projectId}/content/slideshow-builder`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.LAYERS_API_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': crypto.randomUUID(),
},
body: JSON.stringify({
hook: 'wait for it...\nthis simple habit changed everything 🧠',
influencerId: 'inf_4a8e1bc2...',
}),
},
);
const { jobId, containerIds } = await res.json();
const [containerId] = containerIds;import os, uuid, httpx
r = httpx.post(
f"https://api.layers.com/v1/projects/{project_id}/content/slideshow-builder",
headers={
"Authorization": f"Bearer {os.environ['LAYERS_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"hook": "wait for it...\nthis simple habit changed everything 🧠"},
)
job = r.json()Responses
{
"jobId": "job_01HZX3...",
"kind": "content_generate",
"status": "running",
"containerIds": ["cnt_7d18b9a1..."],
"locationUrl": "/v1/jobs/job_01HZX3..."
}{
"error": {
"code": "VALIDATION",
"message": "MISSING_APP_DESCRIPTION: slideshow-builder requires projects.app_description.",
"requestId": "req_...",
"details": {
"code": "MISSING_APP_DESCRIPTION",
"format": "slideshow-builder"
}
}
}The top-level error.code is the generic VALIDATION envelope. The specific failure code lives at error.details.code — that's what partners switch on programmatically.
details.code | Cause |
|---|---|
MISSING_APP_DESCRIPTION | projects.app_description empty. Run an ingest job or PATCH /v1/projects/:id. |
ACCOUNT_NOT_WIRED | socialAccountId exists but no distribution layer references it. |
NO_CONTENT_LAYER_WIRED | Distribution layer's contentLayerSourceIds[] is empty. |
INFLUENCER_NOT_WIRED | Wired content layer has no customInfluencerId. |
{
"error": {
"code": "NOT_FOUND",
"message": "socialAccountId is not on this project.",
"requestId": "req_..."
}
}Errors
| Code | When |
|---|---|
VALIDATION | Missing hook, body shape invalid, body id set. |
NOT_FOUND | socialAccountId / influencerId not on this project. |
MISSING_APP_DESCRIPTION | Project missing app_description. |
ACCOUNT_NOT_WIRED / NO_CONTENT_LAYER_WIRED / INFLUENCER_NOT_WIRED | socialAccountId resolution failed mid-chain. |
IDEMPOTENCY_CONFLICT | Same Idempotency-Key reused with different body. |
BILLING_EXHAUSTED | Org wallet at zero. |