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

# Publish a post

> Save a draft, schedule it or publish it now, write threads and first comments, repeat it, check how it went and send failed accounts again.

A post goes to one or more connected accounts at one time. This guide takes one post from a draft to the networks, then shows what to do when something fails.

## Before you start

* A key with `posts:create` and `posts:update`. Scheduling also needs `posts:schedule`, and publishing right away needs `posts:publish`. A key without those two can only save drafts. See [Authentication](https://docs.postsyncer.com/essentials/authentication.md#permissions).
* The workspace's `id` from [List workspaces](https://docs.postsyncer.com/api-reference/workspaces/list.md) and the accounts' `id`s from [List accounts](https://docs.postsyncer.com/api-reference/accounts/list.md). Pick accounts whose `needs_reconnect` is `false`.

The examples use the Halden Coffee workspace (`4815`), its X account (`16234`) and its Instagram account (`16235`).

## 1. Save a draft

A draft is saved in PostSyncer and goes nowhere. Drafts don't count toward the Free plan's 20 posts a month.

```bash theme={null}
curl -X POST "https://postsyncer.com/api/v1/posts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 4815,
    "schedule_type": "draft",
    "content": [
      {
        "text": "Latte art Fridays are back at Halden Coffee.",
        "media": ["https://cdn.postsyncer.com/examples/latte-art.jpg"]
      }
    ],
    "accounts": [{ "id": 16234 }, { "id": 16235 }]
  }'
```

It answers `201` with the post (shortened here). Keep its `id`. Each account gets a row in `platforms`, with its own `status`:

```json theme={null}
{
  "id": 92731,
  "status": "DRAFT",
  "scheduled_at": null,
  "content_version": 1,
  "platforms": [
    { "platform": "twitter", "account_id": 16234, "status": "PENDING", "posted_on": [], "notes": [] },
    { "platform": "instagram", "account_id": 16235, "status": "PENDING", "posted_on": [], "notes": [] }
  ],
  "skipped_accounts": []
}
```

`media` takes links, media library ids or both. A link is copied into the media library when the post is saved, so the post doesn't depend on it later. See [Add media to posts](https://docs.postsyncer.com/guides/media.md).

Instagram, TikTok and Pinterest need a picture or a video, and YouTube a video, before the post can be scheduled or published. So does a Google Business Profile gallery item. A draft can wait without one.

## 2. Schedule it

Update the post with `schedule_type: "schedule"` and a time. The update sends the full `content` again. Fields you leave out, such as `accounts`, keep what the post has.

```bash theme={null}
curl -X PUT "https://postsyncer.com/api/v1/posts/92731" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 4815,
    "schedule_type": "schedule",
    "schedule_for": { "date": "2030-03-15", "time": "09:00" },
    "content": [
      {
        "text": "Latte art Fridays are back at Halden Coffee.",
        "media": ["https://cdn.postsyncer.com/examples/latte-art.jpg"]
      }
    ]
  }'
```

* `schedule_for` is read in the workspace's timezone. To give this post's time in another zone, add `timezone` inside it: `"schedule_for": { "date": "2030-03-15", "time": "09:00", "timezone": "America/New_York" }`. A `timezone` outside `schedule_for` is ignored. It never changes the workspace's timezone.
* The time must be in the future, or the answer is `422`.
* With `schedule` and no `schedule_for`, a new post takes the workspace's next free queue time. An update keeps the post's time while it's still ahead, and takes the next free queue time only when that time has passed.
* When no queue time is free, `schedule` with no `schedule_for` and no time ahead answers `422` on `schedule_for`: `There are no available queue slots to schedule to. Send schedule_for with a date and time, or add queue times to the workspace.` Nothing is saved. If the key's person can't publish, the post is sent for approval instead, with the time it has, or none on a new post: the approver picks when it goes out.
* On Free, the post counts toward the 20 a month now. See [Plan limits](https://docs.postsyncer.com/plan-limits.md#how-posts-count).

The post is `SCHEDULED`, with `scheduled_at` set to `2030-03-15 09:00`.

## 3. Or publish it now

`"schedule_type": "publish_now"` sends the post right away, and the answer's `status` is `IN_QUEUE`. It can't be undone: deleting the post later doesn't remove it everywhere. See [Test safely](https://docs.postsyncer.com/test-safely.md#what-cant-be-undone) before you try it on a real audience.

If the key's person can't publish in that workspace, `schedule` and `publish_now` don't send anything. The post waits as `PENDING_APPROVAL`. See [Approve posts](https://docs.postsyncer.com/guides/approvals.md).

## Threads and first comments

`content` is a list of items. The first item is the post.

* More items make a thread on X, Threads, Bluesky and Mastodon. Every other network gets the items joined into one text.
* One item can be a first comment, with `"is_first_comment": true`. It goes under the post on Facebook, Instagram, LinkedIn and YouTube, and at the end of the thread on X, Threads, Bluesky and Mastodon. TikTok, Pinterest, Telegram and Google Business Profile have no first comment.
* `first_comment_delay` is the wait in minutes after the post goes out: `1` when you leave it out, up to `10080` (7 days).

```json theme={null}
{
  "workspace_id": 4815,
  "schedule_type": "draft",
  "content": [
    { "text": "Three things we changed in our espresso this spring." },
    { "text": "1. A lighter roast from the same farm." },
    { "text": "2. A finer grind, so each shot runs 28 seconds." },
    { "text": "Taste it at Halden Coffee this week.", "is_first_comment": true, "first_comment_delay": 10 }
  ],
  "accounts": [{ "id": 16234 }]
}
```

[Core concepts](https://docs.postsyncer.com/concepts.md#content-items) has the rules for content items.

## Settings for each network

Each account in `accounts` can carry `settings` for its network: a Pinterest board, TikTok privacy, a YouTube title, an Instagram Reel or Story. A network's settings you leave out take their defaults.

```json theme={null}
"accounts": [
  { "id": 16235, "settings": { "post_type": "REELS" } }
]
```

A Pinterest pin goes to the board in `board_id`: read the account with [Get account](https://docs.postsyncer.com/api-reference/accounts/get.md) and take an `id` from its `boards`. Without one, the pin goes to the account's first board, or to a new `My Pins` board if it has none. [Create a post](https://docs.postsyncer.com/api-reference/posts/create.md#platform-specific-settings) lists every setting, and [Platforms](https://docs.postsyncer.com/platforms/overview.md) has each network's rules.

## Repeat a post

A post can go out again on a schedule. Send these with the post:

| Field | Value |
| - | - |
| `repeatable` | `true` |
| `repeatable_times` | How many times it goes out again, `1` to `30` |
| `repeatable_gap` | The wait between repeats, `1` to `100` |
| `repeatable_gap_unit` | `minutes`, `hours`, `days`, `weeks` or `months` |
| `repeatable_accounts` | Optional: only these account ids repeat |

Repeats work on every plan. On Free, each repeat counts as a post when it goes out, and a repeat due after the 20 are used fails. To stop repeating, update the post with `"repeatable": false`.

## Check how it went

Read the post with [Get post](https://docs.postsyncer.com/api-reference/posts/get.md). The post's `status` follows its rows:

* `PUBLISHED`: every row is live. Each row has `post_url` and `analytics`.
* `PARTIALLY_FAILED`: some rows are live and some failed.
* `FAILED`: every row failed. A `FAILED` row has `error_message`, the reason in plain words.

While a row is `IN_PROGRESS`, its `progress` says what it's doing, such as preparing a video. A row's `notes` lists what went partly wrong in a published post, such as a thread item that wasn't posted. [Core concepts](https://docs.postsyncer.com/concepts.md#post-statuses) has every status.

You don't have to poll. Subscribe a [webhook](https://docs.postsyncer.com/api-reference/webhooks/create.md) to `post.published`, `post.partially_published` and `post.failed`, or to `post.account_published` and `post.account_failed` for each account. [Webhook events](https://docs.postsyncer.com/webhooks/events.md) shows what each one carries.

[Post history](https://docs.postsyncer.com/api-reference/posts/history.md) lists who changed the post, what and when, newest first.

## Send failed accounts again

Fix the cause first. If the account needs reconnecting, reconnect it (see [Connect accounts](https://docs.postsyncer.com/guides/connect-accounts.md)). If the network refused the media, change it.

Then update the post with `"schedule_type": "publish_now"`, or with `schedule` and a new time. Only the rows that failed go out again. Rows already published aren't sent twice, and on Free a post sent again doesn't count twice.

## Edit without moving the time

Leave `schedule_type` out of an update to keep when the post goes out. What happens depends on the post's status:

| Status | An update that leaves `schedule_type` out |
| - | - |
| `SCHEDULED` | Stays `SCHEDULED`, at its time while that time is ahead. A time that has passed moves to the next free queue time, or stays when none is free, and the post goes out at the next run. With no time at all, it takes the next free queue time, and answers `422` on `schedule_for` when none is free. It still needs `posts:schedule`. |
| `PENDING_APPROVAL` | Keeps waiting, at its time while that time is ahead. Otherwise it takes the next free queue time, or keeps its time (or none) when none is free. It still needs `posts:schedule`. |
| `DRAFT`, `FAILED`, `PARTIALLY_FAILED`, `REJECTED` | Becomes a `DRAFT`, at the time it had. |
| `PUBLISHED`, with repeats ahead | Stays `PUBLISHED`. The edit is what its next repeats send. |
| `PUBLISHED`, with no repeats ahead | Refused with `409`: `This post is already published, so its content cannot change. Duplicate it to post a new version.` |
| `IN_QUEUE`, `IN_PROGRESS` | Refused with `409`: `This post is being published right now, so it cannot be changed. Try again in a moment.` |

* If the key's person can't publish, an edit to a `SCHEDULED` post answers `403`, and nothing is saved: `This post is already approved and scheduled. Changing it needs a new approval: make your changes and use Request approval. Here, send the change with schedule_type: schedule to ask for a new approval.` Send the change with `"schedule_type": "schedule"` and the post goes back to `PENDING_APPROVAL` for a new approval. See [Approve posts](https://docs.postsyncer.com/guides/approvals.md#change-an-approved-scheduled-post).
* If the key's person can't publish, an edit to a `PUBLISHED`, `PARTIALLY_FAILED` or `FAILED` post with repeats ahead answers `403` too.
* `"schedule_type": "schedule"` or `"publish_now"` on a `PUBLISHED` post answers `409` with `This post is already published.`
* Send `content_version` from your last read. If someone changed the post since, the update answers `409` with `"error": "post_changed_elsewhere"` instead of overwriting their edit.

## Delete a post

[Delete post](https://docs.postsyncer.com/api-reference/posts/delete.md) removes the post from PostSyncer for good. For each account it was published to, PostSyncer asks the network to delete it, except on Instagram and TikTok, where nothing is asked: delete it there yourself. On X, Threads, Bluesky and Mastodon only a thread's first post is deleted. [Test safely](https://docs.postsyncer.com/test-safely.md#what-cant-be-undone) has the table, and what happens when a network refuses. A deleted post can't be put back.

## With MCP

The MCP tools do the same, with the same permissions: `create-post`, `update-post`, `get-post`, `list-posts`, `delete-post` and `get-post-history`. With `update-post`, leave `schedule_type` out unless the user asked to change when the post goes out. See the [MCP tools reference](https://docs.postsyncer.com/mcp/tools-reference.md).

## Related

> [card] [Create a post](https://docs.postsyncer.com/api-reference/posts/create.md)
>
> Every field of a post request.

> [card] [Add media to posts](https://docs.postsyncer.com/guides/media.md)
>
> Upload files, import links and use the library.

> [card] [Approve posts](https://docs.postsyncer.com/guides/approvals.md)
>
> Posts that wait for someone who can publish.

> [card] [Test safely](https://docs.postsyncer.com/test-safely.md)
>
> Drafts, draft-only keys and what can't be undone.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.