POST /v1/projects/:projectId/content/video-remix
Generate a short-form video remixed from a discovered TikTok source.
POST
/v1/projects/:projectId/content/video-remixPhase 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
projectIdstring (uuid)requiredThe project to generate content for.
Body
Body
tiktokVideoIdstringrequiredSource TikTok video id, typically pulled from `GET /v1/projects/:id/content/source-recommendations`.socialAccountIdstringoptionalConnected social-account id. Walks the wiring chain.influencerIdstringoptionalExplicit influencer override. One of socialAccountId or influencerId is required — video-remix face-swaps the influencer onto the source.
Request
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..."
}'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;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_..."
}
}| Code | Cause |
|---|---|
INFLUENCER_REQUIRED | Neither socialAccountId (with wired influencer) nor influencerId provided. |
INVALID_TIKTOK_ID | tiktokVideoId doesn't resolve to a fetchable source video. |
ACCOUNT_NOT_WIRED / NO_CONTENT_LAYER_WIRED / INFLUENCER_NOT_WIRED | Wiring chain resolution failed mid-step. |
Errors
| Code | When |
|---|---|
VALIDATION | Body shape invalid; tiktokVideoId missing. |
NOT_FOUND | socialAccountId / influencerId not on this project. |
INFLUENCER_REQUIRED | No influencer resolvable from either path. |
INVALID_TIKTOK_ID | Source not fetchable. |
IDEMPOTENCY_CONFLICT | Same Idempotency-Key reused with different body. |
BILLING_EXHAUSTED | Org wallet at zero. |