Layers
Partner APIAPI referenceContent

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

Generate a short-form video remixed from a discovered TikTok source.

View as Markdown
POST/v1/projects/:projectId/content/video-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 video's text overlays are extracted internally and adapted to the project's brand voice and language. Partners do not supply a hook for this format — to use different opening text, 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 video id, typically pulled from `GET /v1/projects/:id/content/source-recommendations`.
  • socialAccountId
    stringoptional
    Connected social-account id. Walks the wiring chain.
  • influencerId
    stringoptional
    Explicit influencer override. One of socialAccountId or influencerId is required — video-remix face-swaps the influencer onto the source.

Request

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

r = httpx.post(
    f"https://api.layers.com/v1/projects/{project_id}/content/video-remix",
    headers={
        "Authorization": f"Bearer {os.environ['LAYERS_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
        "tiktokVideoId": "7234567890123456789",
        "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.
{
  "error": {
    "code": "INFLUENCER_REQUIRED",
    "message": "video-remix needs an on-camera influencer. Pass socialAccountId (with a wired influencer) or influencerId.",
    "requestId": "req_..."
  }
}
CodeCause
INFLUENCER_REQUIREDNeither socialAccountId (with wired influencer) nor influencerId provided.
INVALID_TIKTOK_IDtiktokVideoId doesn't resolve to a fetchable source video.
ACCOUNT_NOT_WIRED / NO_CONTENT_LAYER_WIRED / INFLUENCER_NOT_WIREDWiring chain resolution failed mid-step.

Errors

CodeWhen
VALIDATIONBody shape invalid; tiktokVideoId missing.
NOT_FOUNDsocialAccountId / influencerId not on this project.
INFLUENCER_REQUIREDNo influencer resolvable from either path.
INVALID_TIKTOK_IDSource not fetchable.
IDEMPOTENCY_CONFLICTSame Idempotency-Key reused with different body.
BILLING_EXHAUSTEDOrg wallet at zero.

See also

On this page