Layers
Partner APIAPI referenceContent

POST /v1/projects/:projectId/content/slideshow-remix

Generate an image slideshow remixed from a discovered TikTok slideshow source.

View as Markdown
POST/v1/projects/:projectId/content/slideshow-remix
Phase 1stableidempotent
Auth
Bearer
Scope
content:write

Starts a content-generate job. Returns 202 with containerIds (single-element array — the partner surface never fans out variants) and jobId.

The source slideshow's per-slide text is extracted internally and adapted to the project's brand voice and language. Partners do not supply a hook for this format — to use a different hook, pick a different source via /content/source-recommendations.

Path parameters

  • projectId
    string (uuid)required
    The project to generate content for.

Body

Body
  • tiktokVideoId
    stringrequired
    Source TikTok slideshow id (the post-id field is named `tiktokVideoId` for shape consistency with `video-remix`). Typically pulled from `/content/source-recommendations` with `kind=slideshow`.
  • socialAccountId
    stringoptional
    Connected social-account id. Walks the wiring chain.
  • influencerId
    stringoptional
    Explicit influencer override. One of socialAccountId or influencerId is required — the influencer face is used to regenerate slides.

Request

terminal
curl -X POST https://api.layers.com/v1/projects/{projectId}/content/slideshow-remix \
  -H "Authorization: Bearer $LAYERS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "tiktokVideoId": "7234567890987654321",
    "influencerId": "inf_4a8e1bc2..."
  }'
slideshow-remix.ts
const res = await fetch(
  `https://api.layers.com/v1/projects/${projectId}/content/slideshow-remix`,
  {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.LAYERS_API_KEY}`,
      'Content-Type': 'application/json',
      'Idempotency-Key': crypto.randomUUID(),
    },
    body: JSON.stringify({
      tiktokVideoId: '7234567890987654321',
      socialAccountId: 'sac_...',
    }),
  },
);
const { jobId, containerIds } = await res.json();
const [containerId] = containerIds;
slideshow_remix.py
import os, uuid, httpx

r = httpx.post(
    f"https://api.layers.com/v1/projects/{project_id}/content/slideshow-remix",
    headers={
        "Authorization": f"Bearer {os.environ['LAYERS_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "tiktokVideoId": "7234567890987654321",
        "influencerId": "inf_4a8e1bc2...",
    },
)
job = r.json()

Responses

202Job accepted.
{
  "jobId": "job_01HZX3...",
  "kind": "content_generate",
  "status": "running",
  "containerIds": ["cnt_7d18b9a1..."],
  "locationUrl": "/v1/jobs/job_01HZX3..."
}
422Influencer required, source id invalid, or wiring resolution failed.
CodeCause
INFLUENCER_REQUIREDNeither socialAccountId (with wired influencer) nor influencerId provided.
INVALID_TIKTOK_IDtiktokVideoId doesn't resolve to a fetchable source.
NOT_A_SLIDESHOWThe id resolves to a video, not a slideshow.
ACCOUNT_NOT_WIRED / NO_CONTENT_LAYER_WIRED / INFLUENCER_NOT_WIREDWiring chain resolution failed mid-step.

Errors

CodeWhen
VALIDATIONBody shape invalid.
NOT_FOUNDsocialAccountId / influencerId not on this project.
INFLUENCER_REQUIREDNo influencer resolvable from either path.
INVALID_TIKTOK_ID / NOT_A_SLIDESHOWSource resolution failure.
IDEMPOTENCY_CONFLICTSame Idempotency-Key reused with different body.
BILLING_EXHAUSTEDOrg wallet at zero.

See also

On this page