# POST /v1/projects/:projectId/content/video-remix (/docs/api/reference/content/video-remix)



<Endpoint method="POST" path="/v1/projects/:projectId/content/video-remix" scope="content:write" phase="1">
  Starts a content-generate [job](/docs/api/concepts/jobs). Returns `202`
  with `containerIds` (single-element array — the partner surface never
  fans out variants) and `jobId`.
</Endpoint>

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`](/docs/api/reference/content/source-recommendations).

## Path parameters [#path-parameters]

<Parameters
  rows="[
  { name: 'projectId', type: 'string (uuid)', required: true, description: 'The project to generate content for.' },
]"
/>

## Body [#body]

<Parameters
  title="Body"
  rows="[
  { name: 'tiktokVideoId', type: 'string', required: true, description: 'Source TikTok video id, typically pulled from `GET /v1/projects/:id/content/source-recommendations`.' },
  { name: 'socialAccountId', type: 'string', description: 'Connected social-account id. Walks the wiring chain.' },
  { name: 'influencerId', type: 'string', description: 'Explicit influencer override. One of socialAccountId or influencerId is required — video-remix face-swaps the influencer onto the source.' },
]"
/>

## Request [#request]

<Tabs items="['curl', 'TypeScript', 'Python']">
  <Tab value="curl">
    ```sh title="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..."
      }'
    ```
  </Tab>

  <Tab value="TypeScript">
    ```ts title="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;
    ```
  </Tab>

  <Tab value="Python">
    ```py title="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()
    ```
  </Tab>
</Tabs>

## Responses [#responses]

<Response status="202" description="Job accepted.">
  ```json
  {
    "jobId": "job_01HZX3...",
    "kind": "content_generate",
    "status": "running",
    "containerIds": ["cnt_7d18b9a1..."],
    "locationUrl": "/v1/jobs/job_01HZX3..."
  }
  ```
</Response>

<Response status="422" description="Influencer required, source id invalid, or wiring resolution failed.">
  ```json
  {
    "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.                                       |
</Response>

## Errors [#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.                                     |

## See also [#see-also]

* [Source recommendations](/docs/api/reference/content/source-recommendations)
* [The jobs envelope](/docs/api/concepts/jobs)
