> ## Documentation Index
> Fetch the complete documentation index at: https://cut.pro/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Publishing to social networks

> How to publish rendered clips to TikTok, Instagram, YouTube, and more

After rendering a clip, you can publish it to one or more connected accounts with `POST /posts`. A single post can carry **multiple clips** to **multiple accounts** at once.

## Before you start

You need two things:

<CardGroup cols={2}>
  <Card icon="film" title="A rendered clip">
    The `editId` is the `edit_setting_id` that the [render](/docs/en/api-reference/quickstart) returns when complete. It is what identifies the video to publish.
  </Card>

  <Card icon="link" title="Connected accounts">
    The `connectionId` comes from `GET /connections`. Connect new accounts via OAuth inside [cut.pro](https://cut.pro). The API does not connect accounts.
  </Card>
</CardGroup>

## How the body is built

Each item in `videos` points a clip (`editId`) to one or more targets (`targets`). Each target combines a connection (`connectionId`) with the `metadata` specific to that platform (title, privacy, etc.).

```bash theme={null}
curl -X POST https://api.cut.pro/api/v1/posts \
  -H "X-Api-Key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "videos": [
      {
        "editId": "EDIT_SETTING_ID",
        "targets": [
          {
            "connectionId": "CONEXAO_TIKTOK",
            "metadata": {
              "tiktok": {
                "title": "Meu corte viral",
                "privacyLevel": "PUBLIC_TO_EVERYONE"
              }
            }
          },
          {
            "connectionId": "CONEXAO_YOUTUBE",
            "metadata": {
              "youtube": {
                "title": "Meu corte viral",
                "description": "Cortes do episódio de hoje",
                "categoryId": "22",
                "privacyStatus": "public"
              }
            }
          }
        ]
      }
    ]
  }'
```

The `metadata` changes per platform (TikTok, YouTube, Instagram, Threads, Bluesky, LinkedIn, Pinterest, Facebook). The required fields and options for each are detailed on the endpoint page **`POST /posts`**, with the interactive playground.

<Tip>
  To **schedule** instead of publishing now, send `scheduled_at` with an ISO 8601 date in the future.
</Tip>

## Track the publishing

The response includes `post_id`, `item_count`, and `status` (`pending` or `processing`). Poll `GET /posts/{id}`:

```bash theme={null}
curl https://api.cut.pro/api/v1/posts/POST_ID \
  -H "X-Api-Key: YOUR_KEY"
```

The post `status` evolves like this:

| Status       | Meaning                       |
| ------------ | ----------------------------- |
| `pending`    | In the queue, not started yet |
| `processing` | Publishing to the accounts    |
| `completed`  | All items published           |
| `partial`    | Some published, others failed |
| `failed`     | No item published             |

The `items` array shows the result per account, useful when the status is `partial`.

## When something fails

Items fail independently: a target with an error **does not bring down** the ones that already published.

* **Retry a failed item:** `POST /posts/{id}/items/{itemId}/retry`
* **Remove an item** without touching the others: `DELETE /posts/{id}/items/{itemId}`
* **Delete the whole post:** `DELETE /posts/{id}`
* **Edit before publishing** (e.g. adjust scheduling): `PATCH /posts/{id}`
