# Posts

Source: https://ampost.io/docs/posts · Full reference: https://ampost.io/llms-full.txt

## Posts

A post has top-level `text`, `linkUrl` and `media` for every platform, and `options.<platform>` for per-platform changes. Every platform's options accept `text` (a text override); Instagram and Facebook add `placement`; Instagram also takes collaborators, user tags and Reel cover options; LinkedIn and TikTok add their settings.

- `linkUrl` is one link for every platform, each using it its own way: Facebook shows a link preview, but only on a feed post without media (with media the link is dropped); LinkedIn makes an article card; Bluesky a link card (with media, the link goes into the text); Pinterest makes it the Pin's destination; X, Threads, Discord and Telegram add it to the text and YouTube to the description. Instagram and TikTok ignore it (`link.supported` is false in `GET /api/platforms`).
- `firstComment` is text Ampost posts on each new post right after it publishes: a comment on Instagram, Facebook (as the Page), LinkedIn and YouTube, a reply on X, Threads and Bluesky. TikTok, Telegram, Discord and Pinterest take none (`VALIDATION_FAILED`); `firstComment.supported` and `firstComment.maxLength` in `GET /api/platforms` give each platform's rule. A top-level `firstComment` goes to every target platform, so every one must support it; `options.<platform>.firstComment` sets it for one platform, and `""` turns it off there. Instagram and Facebook stories take no comments, nor do private or made-for-kids YouTube videos (`VALIDATION_FAILED`); when YouTube makes an upload private by itself, its first comment is skipped: `firstComment.status` is `skipped` with a `reason` instead of `failed`; `firstComment.note` in `GET /api/platforms` says where a platform takes none. An X reply is an X post and counts toward X usage like one. A post still processing gets its comment once it publishes. Each account's result is `platformPosts[].firstComment` (`status` `pending`, `published`, `failed` or `skipped`, `commentId`, `error`, `reason`). A failed comment never fails the post: it stays `published`, and `posts_retry` (for that account, or without `accountIds`) posts only the comment again. `PERMISSION_MISSING` means the account was connected before Ampost asked for the comment permission; it must reconnect.
- `thread` is a list of follow-up posts Ampost publishes right after the post, in order, each a reply to the one before: `[{ "text", "media": [{ "url", "type", "altText" }] }]`, text, media or both per item. X, Bluesky and Threads take it, up to `thread.maxItems` (25) items (`thread.supported` in `GET /api/platforms`); elsewhere it is `VALIDATION_FAILED`. Each item is checked like a post on each platform (text length, media counts and types, alt text). A top-level `thread` goes to every target platform; `options.<platform>.thread` sets it for one platform (a shorter X version, say), and `[]` turns it off there. A thread and a `firstComment` cannot go to the same platform (`VALIDATION_FAILED`): add the comment as the thread's last item. Each item of an X thread is an X post and counts toward X usage like one; Threads items need the `threads_manage_replies` permission (`PERMISSION_MISSING`: reconnect the account). Each account's items are in `platformPosts[].thread` (`status` `pending`, `published`, `failed` or `deleted`, `platformPostId`, `publishedUrl`, `error`), in order. A failed item stops the chain: the post and the items before it stay published, and the account is `failed` (or `pending` while Ampost retries a retryable failure by itself) with `error.message` starting `thread[i] failed`. `posts_retry` then continues from that item, without publishing the post or the earlier items again and without counting the post again. An item whose outcome is unknown (`PUBLISH_OUTCOME_UNKNOWN`) is never sent again by itself: check the account first. `posts_unpublish` deletes the whole chain, the last item first; a chain stopped by a failure is not published, so finish it with `posts_retry` (or delete it on the platform).

- Without `placement`, Instagram uses `feed` for one image, `carousel` for 2+ images and `reel` for one video; Facebook uses `feed`. A `story` disappears after 24 hours, so send it only on purpose. The defaults are `placements.defaultByMediaShape` in `GET /api/platforms`.
- `media[]` items are `{ "url", "type": "image" | "video", ...metadata }`. `type` is required and never guessed. `url` must be a public `https` URL: `http`, credentials, `localhost`, private, link-local and internal hosts fail with `VALIDATION_FAILED`. A URL Ampost cannot download (also after up to 3 checked redirects, or when it resolves to a private address) fails with `MEDIA_FETCH_FAILED`. Optional metadata: `mimeType` (inferred from the URL when omitted), `sizeBytes`, `width`, `height`, `durationSeconds`, `altText`, `thumbnailUrl`.
- `media[].altText` is the item's alt text. It goes to X, Bluesky (images and video), LinkedIn, Instagram (feed and carousel images), Threads, Facebook (feed photos), Pinterest (the first item's, as the Pin's alt text) and Discord (the attachment description). `altText` in `GET /api/platforms` gives each platform's `maxLength`, `mediaTypes`, `placements` and `firstItemOnly`; longer alt text fails with `CONTENT_TOO_LONG` (`details.field` `media[i].altText`). Alt text a platform cannot take (TikTok, Telegram, YouTube, a video on X, a story or reel) is not sent and the platform post lists a `warnings` entry.
- Ampost fits each image and video to the target platform's rules before it publishes (`media.conversion` in `GET /api/platforms`). Media within these rules is sent as it is; anything else is converted to fit them, video to H.264/AAC MP4 and images to JPEG, PNG or WebP, whichever the platform takes. Media outside a platform's aspect ratio (Instagram feed 4:5 to 1.91:1; Reels, Stories and TikTok 9:16) is fitted by `mediaFit`: `pad` (default, bars around the whole frame), `crop` (the centre) or `none` (as uploaded). The converted file goes to Ampost storage and is listed in `platformPosts[].mediaTransforms` (`url`, `operations`, `changes`); the original in `media` stays. A video conversion runs in the background, so the account stays `pending` for a minute or a few before it publishes. Ampost never trims: a video longer or shorter than the platform takes fails with `VALIDATION_FAILED`, and one that cannot be converted fails with `MEDIA_TRANSFORM_FAILED`.
- Without `scheduledFor` a new post is a `draft`. `publishNow: true` publishes it in the same call; `scheduledFor` (a future ISO 8601 time) schedules it; `useQueue: true` schedules it in the next free slot of its platform set's queue (see Posting Queues). Scheduled media is copied to Ampost storage when the post is created.
- `targets` chooses which connected accounts publish: `[{ "platformSetId", "platforms" }]`, one entry per platform set. Omit `platformSetId` to use your default set. Each platform must have an active account in its set. A set holds one account per platform, so to post to several accounts of the same platform (two Facebook Pages, several clients' Instagram) list each account's set; it is still one post.
- `platformPosts[]` has one result per account: `platform`, `accountId`, `platformSetId`, `status`, `publishedUrl`, `text` (the text live there after `posts_edit_published`, else null), `error`, `notice` (on a published account: why an unpublish or edit left it as it was), `attempts`, `nextAttemptAt`, `firstComment`, `thread`, `mediaTransforms` (media Ampost converted for that platform) and `warnings` (what the platform did differently from what was asked while the post still went out, for example a YouTube thumbnail it refused or an upload it made private). Platform errors are stored there and do not fail the request. Ampost retries retryable failures by itself (see Automatic Retries and Platform Rate Limits); `posts_retry` retries the `failed` accounts and failed first comments, or only the `accountIds` you pass.
- `posts_unpublish` deletes a published post from the platforms (every account where it is published, or only the `accountIds` you pass). Each deleted account turns `deleted`; an account the platform refused stays `published` with `notice` (`UNPUBLISH_NOT_SUPPORTED` on Instagram and TikTok, which have no delete API; `PERMISSION_MISSING` for a Threads account connected before Ampost asked for `threads_delete`, which must reconnect; Telegram refuses messages older than 48 hours). The post turns `deleted` when no account has it. `unpublish.supported` in `GET /api/platforms` says which platforms can delete.
- `posts_edit_published` replaces the text of a published post on the platforms (every account where it is published, or only the `accountIds` you pass); media and links stay. Each edited account's `platformPosts[].text` holds the new text (null means the post's text for that platform); an account the platform refused keeps its text with `notice` (`EDIT_NOT_SUPPORTED` on Instagram, Threads, TikTok, Bluesky and X, and for Facebook stories). Facebook edits only posts Ampost published; a Telegram caption under media stays limited to 1024 characters. YouTube replaces the video description (the title stays) and Pinterest the Pin description; YouTube edits and deletes share a budget of 10 a day per channel (3 on Free), past which the account gets `notice` `RATE_LIMITED`; Pinterest keeps Pin edits in beta, so an app without access gets `EDIT_NOT_SUPPORTED`. `editPublished.supported` in `GET /api/platforms` says which platforms can edit. The post's own `text` and status stay as they were.
- `metadata` is your own JSON object (at most 4096 bytes), such as your ids, set with `posts_create`. Ampost returns it on the post and in every webhook post event (see Webhooks).
- `source` is where a post was created: `api` (REST with an API key), `mcp` (an MCP tool) or `dashboard`; null for posts created before sources were recorded. Ampost sets it; requests cannot.
- Post statuses: `draft`, `scheduled`, `queued`, `posting`, `published`, `partial`, `failed`, `discarded`, `deleted` (deleted from every platform). Platform statuses: `draft` (the post is a draft; nothing publishes until you publish or schedule it), `pending` (waiting for its scheduled time, its turn in the queue, or an automatic retry at `nextAttemptAt`), `uploading`, `processing`, `publishing`, `published`, `failed`, `cancelled` (the post was discarded before this account published), `deleted` (deleted from the platform with `posts_unpublish`).
- `posts_update` merges `options` per platform: `options.facebook` replaces Facebook's options as a whole (send `text` again if you change `placement`), `null` removes them, and platforms you leave out keep theirs. `media` and `targets` replace the whole list. `options.<platform>` applies to every account of that platform.
- A created post counts once against the `postsPerMonth` quota (a 30-day period), when it is created, whatever publishes it later. `publishNow` also takes from the hourly `publishPost` limit, like `posts_publish`.
- `posts_validate` (`POST /api/posts/validate`) takes a `posts_create` request and answers what create would do, without creating, counting or publishing anything: `valid`, the post's `errors` and `warnings`, and per platform of each target its `accountId`, `valid`, `errors`, `warnings` and `mediaConversion` (what Ampost would convert, per media item). The codes are the ones `posts_create` returns. A Pinterest `options.pinterest.boardId` is checked with Pinterest (`BOARD_NOT_CHECKED` warning when Pinterest does not answer). Account health issues and account limits are errors with `publishNow` and warnings for drafts and scheduled posts; the per-account quota, the daily publish limit and the hourly `publishPost` limit are checked only with `publishNow`. It needs only `posts:read`.
- `posts_import_csv` (`POST /api/posts/bulk`) creates one post per CSV row, each with the same checks as `posts_create`. Columns: `text`, `platforms` (or `accountIds`), `platformSetId`, `scheduledFor`, `useQueue`, `linkUrl`, `media`, `text_<platform>` and `tiktok_<option>` (a TikTok row needs `tiktok_privacyLevel`, `tiktok_consent` = true and media uploaded to Ampost, which Ampost measures: an external URL carries no dimensions or duration); the dashboard's CSV export writes the same columns, so an exported file imports again. Call it with `dryRun: true` first: nothing is created and `rows[]` gives each row's `status` and `errors` (each with its `column`). Then import with an idempotency key; a bad row never stops the others, and resending the key returns the first result. A file with more rows than the plan allows fails with 400 `TOO_MANY_ROWS`. An import and a dry run each also take one token per row from the hourly `importPosts` limit, two runs of the plan's largest file an hour (e.g. a dry run and its import); a file over what is left fails with 429 `RATE_LIMITED` and creates nothing.

More create examples:

Text-only draft:

```json
{
  "targets": [
    {
      "platforms": [
        "bluesky"
      ]
    }
  ],
  "text": "Hello from the Ampost API!"
}
```

Scheduled with a link:

```json
{
  "targets": [
    {
      "platforms": [
        "facebook",
        "threads"
      ]
    }
  ],
  "text": "Webinar starts in one hour.",
  "linkUrl": "https://example.com/webinar",
  "scheduledFor": "2027-01-14T15:00:00Z"
}
```

TikTok video (TikTok needs width, height and durationSeconds on videos):

```json
{
  "targets": [
    {
      "platforms": [
        "tiktok"
      ]
    }
  ],
  "text": "Behind the scenes #buildinpublic",
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21
    }
  ],
  "options": {
    "tiktok": {
      "privacyLevel": "PUBLIC_TO_EVERYONE",
      "consent": true,
      "disableComment": false,
      "isAigc": false
    }
  }
}
```

Instagram story and Facebook feed placement:

```json
{
  "targets": [
    {
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "text": "New drop today",
  "media": [
    {
      "url": "https://cdn.example.com/drop.jpg",
      "type": "image"
    }
  ],
  "options": {
    "instagram": {
      "placement": "story"
    },
    "facebook": {
      "placement": "feed"
    }
  }
}
```

An Instagram reel with a collaborator, a tagged account, a cover image, kept out of the feed grid:

```json
{
  "targets": [
    {
      "platforms": [
        "instagram"
      ]
    }
  ],
  "text": "Behind the scenes of our launch with @studio.north",
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "durationSeconds": 24
    }
  ],
  "options": {
    "instagram": {
      "placement": "reel",
      "collaborators": [
        "studio.north"
      ],
      "userTags": [
        {
          "username": "jane.doe"
        }
      ],
      "coverUrl": "https://cdn.example.com/launch-cover.jpg",
      "shareToFeed": false
    }
  }
}
```

The same Facebook post on two Pages (one per platform set), in one call:

```json
{
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "facebook"
      ]
    },
    {
      "platformSetId": "9a4f2c7e-1d3b-4a6e-8c5f-2b7d9e1a3c50",
      "platforms": [
        "facebook"
      ]
    }
  ],
  "text": "We are hiring two engineers. Apply by Friday.",
  "linkUrl": "https://example.com/jobs",
  "publishNow": true
}
```

A post whose TikTok publish failed:

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "failed",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "youtube"
      ]
    }
  ],
  "platforms": [
    "youtube"
  ],
  "text": "Behind the scenes #buildinpublic",
  "firstComment": null,
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {},
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "mcp",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": null,
  "platformPosts": [
    {
      "platform": "youtube",
      "accountId": "8d3b6f1e-2c4a-4e7b-9f5d-1a6c8e3b2d70",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "failed",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": {
        "code": "VIDEO_PROCESSING_FAILED",
        "message": "YouTube could not process the video",
        "retryable": false,
        "platformCode": null,
        "platformSubcode": null
      },
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:04.000Z"
}
```

### Automatic Retries and Platform Rate Limits

- When a publish fails with `error.retryable: true` (the platform's rate limit, a timeout, a network error or a 5xx), Ampost publishes again by itself: up to 5 attempts in all, with exponential backoff and jitter (at most 1, 2, 4 and 8 minutes), and never before the platform's `Retry-After` or rate-limit reset. A platform that asks for a wait longer than a day fails the account at once.
- While an account waits, its `platformPosts[]` entry stays `pending` with the last `error`, `attempts` (attempts so far) and `nextAttemptAt`; the post is `posting`. No webhook fires for a retry. After the last attempt the account turns `failed` and `post.failed` or `post.partial` fires as usual. A failure that does not pass on its own (`retryable: false`, such as `AUTH_EXPIRED` or invalid media) fails at once.
- No duplicates: when the platform stopped answering after it got the publish (a timeout, a 5xx), Ampost looks for the post on the account before the next attempt, and publishes again only if it is not there. Instagram, Facebook feed posts, Threads, Bluesky, YouTube and Pinterest can be checked. On other platforms (Facebook stories and reels, LinkedIn, TikTok, X, Telegram, Discord) such an account fails with `PUBLISH_OUTCOME_UNKNOWN` instead: check the account, then call `posts_retry` only if the post is missing.
- Ampost also spreads publishes per account and per platform app, inside each platform's limits (Meta's per-account publishing limits, X's posting window, LinkedIn's and TikTok's daily caps). A burst of posts due at once publishes in turn: an account held back waits `pending` with `nextAttemptAt` and is never `failed` for it, and it does not use an attempt.
- `posts_retry` is for `failed` accounts. It starts `attempts` again from 0.
- Live per-platform publishing status (from real publish outcomes, aggregates only) and a plain explanation of retries, queueing and duplicates: `https://ampost.io/status`.

A post waiting for an automatic retry:

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "posting",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram"
      ]
    }
  ],
  "platforms": [
    "instagram"
  ],
  "text": "New drop at 9am",
  "firstComment": null,
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {},
  "scheduledFor": "2026-10-06T09:00:00.000Z",
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": null,
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": {
        "code": "RATE_LIMITED",
        "message": "Instagram rate limit reached: Application request limit reached",
        "retryable": true,
        "platformCode": 4,
        "platformSubcode": null
      },
      "notice": null,
      "warnings": [],
      "attempts": 2,
      "nextAttemptAt": "2026-10-06T09:02:04.000Z",
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:04.000Z"
}
```

### List platforms and their capabilities

`GET /api/platforms` · MCP tool `platforms_list` · scope `posts:read` · rate limit `apiRead` · success `200`

List every supported platform with its rules: text length, link support, scheduling, unpublish (delete a published post), editPublished (edit a published post's text), firstComment (comment posted after publish, and its length), thread (follow-up posts, and how many), media types, counts, sizes and required metadata, placements by media shape, and the JSON Schema of its `options`. `availability` is `coming_soon` for a platform that is listed but not open to every account yet: for those accounts, connecting it, posting to it and reading its posts or analytics return 403 PLATFORM_COMING_SOON. Read this instead of hardcoding platform differences, and check a post against these rules and its accounts with posts_validate before posts_create.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `limit` | query | integer | no | Page size, 1-100. Default 20. |
| `offset` | query | integer | no | Number of items to skip. Default 0. |

### List posts

`GET /api/posts` · MCP tool `posts_list` · scope `posts:read` · rate limit `apiRead` · success `200`

List your posts, newest created first, as full post objects (status, text, media, schedule, targets and `platformPosts`, the result per account). Use it to find posts: filter by `status`, `platform`, `platformSetId` (posts with an account in that set) or `search` (text match); filters combine. To read one post whose id you have, use posts_get; for views, likes and other metrics, use analytics_posts. Paginated with `limit` and `offset`; `pagination.hasMore` says whether another page exists. A key restricted to some platform sets sees only their posts. An unknown `platformSetId` is 404 PLATFORM_SET_NOT_FOUND.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `status` | query | draft \| scheduled \| queued \| posting \| published \| partial \| failed \| discarded \| deleted | no | Only posts with this status: `draft`, `scheduled`, `queued`, `posting`, `published`, `partial`, `failed`, `discarded`, `deleted`. Default: every status. |
| `platform` | query | instagram \| facebook \| linkedin \| tiktok \| threads \| twitter \| discord \| telegram \| bluesky \| youtube \| pinterest | no | Only posts with an account on this platform. Default: every platform. |
| `platformSetId` | query | string | no | Only posts with an account in this platform set (`id` from platform_sets_list). Default: every set the key can see. |
| `search` | query | string | no | Only posts whose main text contains this, case-insensitive, e.g. `launch` |
| `approvalStatus` | query | pending \| approved \| rejected | no | Approval mode: only posts with this approval status, e.g. `pending` for the posts that wait for an approver. Default: every post. |
| `limit` | query | integer | no | Page size, 1-100. Default 20. |
| `offset` | query | integer | no | Number of items to skip. Default 0. |

Example response:

```json
{
  "data": [],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 0,
    "hasMore": false
  }
}
```

### Create, schedule or publish a post

`POST /api/posts` · MCP tool `posts_create` · scope `posts:write` · rate limit `createPost` · success `201`

Create a post for one or more platforms. `targets` lists platform sets, each with its platforms; omit `platformSetId` for your default set. List several sets to reach several accounts of the same platform in one post (each set holds one account per platform); `platformPosts` then has one entry per account. Without `scheduledFor` it is a draft; set `publishNow` to publish it right away, or `scheduledFor` to publish later. `media` items are public URLs with a required `type` (REST also accepts multipart file uploads up to 4 MB per request; for larger files or files on the user's device use media_upload_create). Use `options.<platform>` for per-platform text and settings. `firstComment` is posted as a comment (a reply on X, Threads and Bluesky) on each new post right after it publishes; a failed comment leaves the post published with `platformPosts[].firstComment.status` failed. `thread` adds follow-up posts on X, Bluesky and Threads, each a reply to the one before (results in `platformPosts[].thread`). Call platforms_list (GET /api/platforms) for each platform's limits, placements and options. In approval mode, a drafts-only key or an Editor gets a draft that waits for an approver instead (see posts_submit).

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `targets` | body | object[] | yes | Where the post goes: one entry per platform set (max 10). A set holds one account per platform, so to reach several accounts of one platform (two LinkedIn accounts, several clients' Instagram) list their sets. The post gets one platformPosts entry per account. |
| `text` | body | string | no | Post text. Use `options.<platform>.text` to vary it per platform. |
| `firstComment` | body | string \| null | no | Comment Ampost posts on each new post right after it publishes (X, Threads and Bluesky: a reply). Every target platform must support it (`firstComment.supported` in GET /api/platforms); use `options.<platform>.firstComment` to set or turn it off (`""`) per platform. A failed comment does not fail the post. |
| `linkUrl` | body | string \| null | no | Link to attach. Ignored by platforms whose `link.supported` is false. |
| `media` | body | object[] | no | Images and videos, in order (at most 35; each platform's `media.maxItems` applies): `{ url, type }` plus optional metadata and `altText`. `url` is a public https URL, such as a completed media upload's `url`. The types and required fields per platform are in GET /api/platforms (`media`). |
| `mediaFit` | body | pad \| crop \| none | no | How media outside a platform's aspect ratio is fitted (`media.conversion` in GET /api/platforms), e.g. Instagram feed 4:5 to 1.91:1, Reels, Stories and TikTok 9:16, and on Pinterest a carousel's later images to the first one's ratio. pad: bars around the whole frame (white on images, black on video); crop: the centre fills the frame; none: the ratio stays as uploaded (a platform that requires one may refuse it). Default: pad. |
| `thread` | body | object[] | no | Follow-up posts published right after the post, in order, each replying to the one before (X, Bluesky, Threads). Item: `{ text, media: [{ url, type, altText }] }`, checked like a post. Every target platform must take it (`thread` in GET /api/platforms); `options.<platform>.thread` overrides it, `[]` for none. Not with `firstComment` on one platform. A failed item fails the account; posts_retry continues from it. |
| `options` | body | object | no | Per-platform options keyed by platform. Every platform accepts `text`, the platforms that take a first comment accept `firstComment` and the ones that take a thread (X, Bluesky, Threads) accept `thread`; see GET /api/platforms for the rest. |
| `scheduledFor` | body | ISO 8601 \| null | no | Publish time in the future. Null or omitted: the post is a draft (or published now with `publishNow`). |
| `publishNow` | body | boolean | no | Publish right after creating. Cannot be combined with `scheduledFor`. |
| `useQueue` | body | boolean | no | Schedule the post in the next free slot of its platform set's queue (see queue_get) instead of at `scheduledFor`. Needs exactly one target and a queue with slots. Cannot be combined with `scheduledFor` or `publishNow`. |
| `metadata` | body | object | no | Your own JSON object (max 4096 bytes), such as your ids. Returned on the post and in every webhook post event. Set on create only. |
| `Idempotency-Key` (MCP `idempotencyKey`) | header | string | no | Idempotency key (1-255 visible ASCII characters, for example a UUID). A retry with the same key and arguments within 24 hours returns the first result instead of running again. Send a new key for each new action. See Idempotency. |

Example request:

```json
{
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21
    }
  ],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "publishNow": true,
  "metadata": {
    "campaignId": "launch-2026"
  }
}
```

Example response:

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "published",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": {
    "campaignId": "launch-2026"
  },
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "17895695668004550",
      "publishedUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": {
        "status": "published",
        "commentId": "17858893269123456",
        "error": null,
        "reason": null,
        "updatedAt": "2026-10-06T09:00:04.000Z"
      },
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "108234567890123_901234567890125",
      "publishedUrl": "https://www.facebook.com/108234567890123/posts/901234567890125",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": {
        "status": "failed",
        "commentId": null,
        "error": {
          "code": "PLATFORM_ERROR",
          "message": "Facebook comment failed: the service is temporarily unavailable",
          "retryable": true,
          "platformCode": null,
          "platformSubcode": null
        },
        "reason": null,
        "updatedAt": "2026-10-06T09:00:04.000Z"
      },
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:04.000Z"
}
```

### Check a post without creating it

`POST /api/posts/validate` · MCP tool `posts_validate` · scope `posts:read` · rate limit `apiRead` · success `200`

Check a posts_create request without creating, counting or publishing anything: same input, same checks and error codes. `valid` is true when posts_create would accept it and, with `publishNow`, every account would publish. `errors` holds the post's own problems (content, schedule, plan features, the 30-day post quota, for publishNow the hourly publish limit); `targets` has one entry per platform of each target with its own `valid`, `errors` (platform set, the platform's rules for text, media, placement and options, a Pinterest `boardId` the account cannot pin to, the account it publishes through, its health, and for publishNow the per-account quota), `warnings` (`ALT_TEXT_NOT_SENT` for alt text the platform leaves out, `BOARD_NOT_CHECKED` when Pinterest did not answer the `options.pinterest.boardId` check, account issues to fix before a scheduled post publishes, a login that expires soon; account health issues carry the `accounts_get` health codes) and `mediaConversion` (what Ampost would convert on that platform, per media item). Each platform reports its first rule error, like posts_create. A request that does not fit the schema answers 400 `VALIDATION_FAILED` like posts_create. Takes no post quota, publish limit or X units.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `targets` | body | object[] | yes | Where the post goes: one entry per platform set (max 10). A set holds one account per platform, so to reach several accounts of one platform (two LinkedIn accounts, several clients' Instagram) list their sets. The post gets one platformPosts entry per account. |
| `text` | body | string | no | Post text. Use `options.<platform>.text` to vary it per platform. |
| `firstComment` | body | string \| null | no | Comment Ampost posts on each new post right after it publishes (X, Threads and Bluesky: a reply). Every target platform must support it (`firstComment.supported` in GET /api/platforms); use `options.<platform>.firstComment` to set or turn it off (`""`) per platform. A failed comment does not fail the post. |
| `linkUrl` | body | string \| null | no | Link to attach. Ignored by platforms whose `link.supported` is false. |
| `media` | body | object[] | no | Images and videos, in order (at most 35; each platform's `media.maxItems` applies): `{ url, type }` plus optional metadata and `altText`. `url` is a public https URL, such as a completed media upload's `url`. The types and required fields per platform are in GET /api/platforms (`media`). |
| `mediaFit` | body | pad \| crop \| none | no | How media outside a platform's aspect ratio is fitted (`media.conversion` in GET /api/platforms), e.g. Instagram feed 4:5 to 1.91:1, Reels, Stories and TikTok 9:16, and on Pinterest a carousel's later images to the first one's ratio. pad: bars around the whole frame (white on images, black on video); crop: the centre fills the frame; none: the ratio stays as uploaded (a platform that requires one may refuse it). Default: pad. |
| `thread` | body | object[] | no | Follow-up posts published right after the post, in order, each replying to the one before (X, Bluesky, Threads). Item: `{ text, media: [{ url, type, altText }] }`, checked like a post. Every target platform must take it (`thread` in GET /api/platforms); `options.<platform>.thread` overrides it, `[]` for none. Not with `firstComment` on one platform. A failed item fails the account; posts_retry continues from it. |
| `options` | body | object | no | Per-platform options keyed by platform. Every platform accepts `text`, the platforms that take a first comment accept `firstComment` and the ones that take a thread (X, Bluesky, Threads) accept `thread`; see GET /api/platforms for the rest. |
| `scheduledFor` | body | ISO 8601 \| null | no | Publish time in the future. Null or omitted: the post is a draft (or published now with `publishNow`). |
| `publishNow` | body | boolean | no | Publish right after creating. Cannot be combined with `scheduledFor`. |
| `useQueue` | body | boolean | no | Schedule the post in the next free slot of its platform set's queue (see queue_get) instead of at `scheduledFor`. Needs exactly one target and a queue with slots. Cannot be combined with `scheduledFor` or `publishNow`. |
| `metadata` | body | object | no | Your own JSON object (max 4096 bytes), such as your ids. Returned on the post and in every webhook post event. Set on create only. |

Example request:

```json
{
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "twitter"
      ]
    }
  ],
  "text": "Our new office, finally.",
  "media": [
    {
      "url": "https://cdn.example.com/office.png",
      "type": "image",
      "mimeType": "image/png",
      "sizeBytes": 9400000,
      "width": 4000,
      "height": 3000,
      "altText": "The team at their desks"
    }
  ],
  "thread": [
    {
      "text": "Moving day photos in the replies."
    }
  ],
  "scheduledFor": "2027-03-02T09:00:00Z"
}
```

Example response:

```json
{
  "valid": false,
  "errors": [],
  "warnings": [],
  "scheduledFor": "2027-03-02T09:00:00Z",
  "targets": [
    {
      "platform": "instagram",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "valid": false,
      "errors": [
        {
          "code": "VALIDATION_FAILED",
          "message": "\"instagram\" takes no thread; only X, Bluesky and Threads do. For a post that also goes to \"instagram\", set the thread in options.<platform>.thread of those platforms instead of thread",
          "details": {
            "platform": "instagram",
            "field": "thread"
          }
        }
      ],
      "warnings": [],
      "mediaConversion": []
    },
    {
      "platform": "twitter",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "accountId": "9a4e2c7b-3d1f-4b8a-9c6e-5f2a8d1b7c40",
      "valid": true,
      "errors": [],
      "warnings": [],
      "mediaConversion": [
        {
          "mediaIndex": 0,
          "status": "convert",
          "operations": [
            "compress"
          ],
          "changes": [
            "9.0 MB → at most 5.0 MB"
          ],
          "final": true
        }
      ]
    }
  ]
}
```

### Import posts from CSV

`POST /api/posts/bulk` · MCP tool `posts_import_csv` · scope `posts:write` · rate limit `createPost` · success `200`

Create many posts from a CSV file: one post per row, each checked like posts_create. Columns: `text`, `platforms` (space-separated, with an optional `platformSetId`) or `accountIds`, `scheduledFor` or `useQueue` (neither: a draft), `linkUrl`, `media` (space-separated public URLs; `.mp4`, `.m4v`, `.mov` and `.webm` are videos, the rest images) and `text_<platform>` for per-platform text. The dashboard's CSV export has the same columns, so an exported file imports again (its read-only columns are skipped). Send `dryRun: true` first: it checks every row without creating anything. A bad row does not stop the others; `rows[]` gives each row's `status` (`valid`, `created` or `error`) and `errors` with the column. Unknown columns are skipped with a warning. Plans import at most 50 (Free), 1,000 (Pro), 2,500 (Max) or 5,000 (Scale) rows per request. An import and a dry run each take one token per row from the hourly `importPosts` limit (two runs of the plan's largest file an hour, e.g. a dry run and its import); a file with more rows than are left fails with 429 `RATE_LIMITED` and creates nothing. Send an idempotency key with the import: a retry with the same key and file returns the first result and creates nothing new. REST also accepts multipart with the file in a part named `file`.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `csv` | body | string | yes | The CSV text: a header row, then one post per row. Columns: `text`, `platforms`, `platformSetId`, `accountIds`, `scheduledFor`, `useQueue`, `linkUrl`, `firstComment`, `media`, `altText` and `text_<platform>` (per-platform text, such as `text_linkedin`) and `tiktok_<option>` (TikTok's `options.tiktok`: `tiktok_privacyLevel`, `tiktok_consent`, `tiktok_disableComment`, `tiktok_disableDuet`, `tiktok_disableStitch`, `tiktok_brandContentToggle`, `tiktok_brandOrganicToggle`, `tiktok_isAigc`, `tiktok_inboxDraft`; a TikTok row needs `tiktok_privacyLevel` and `tiktok_consent` = true unless it is an inbox draft, and its `media` must be files uploaded to Ampost, which Ampost measures; an empty cell leaves the option out, so interactions stay off). Each row needs `platforms` (with an optional `platformSetId`; default: your default set) or `accountIds`. List cells separate items with spaces; `altText` holds one alt text per `media` URL, in order, separated by `|` (leave an item empty for none). Unknown columns are skipped with a warning. |
| `dryRun` | body | boolean | no | Check every row like posts_create does without creating anything. `valid` rows would be created. |
| `Idempotency-Key` (MCP `idempotencyKey`) | header | string | no | Idempotency key (1-255 visible ASCII characters, for example a UUID). A retry with the same key and arguments within 24 hours returns the first result instead of running again. Send a new key for each new action. See Idempotency. |

Example request:

```json
{
  "csv": "text,platforms,scheduledFor,useQueue,media,text_threads\nLaunch day,bluesky threads,2027-01-20T09:00:00Z,,https://cdn.example.com/launch.jpg,Shorter for Threads\nBehind the scenes,instagram,,true,https://cdn.example.com/team.mp4,\nDraft for later,myspace,,,,",
  "dryRun": true
}
```

Example response:

```json
{
  "dryRun": true,
  "summary": {
    "rows": 3,
    "valid": 2,
    "created": 0,
    "errors": 1
  },
  "warnings": [],
  "rows": [
    {
      "row": 2,
      "status": "valid",
      "postId": null,
      "scheduledFor": "2027-01-20T09:00:00Z",
      "errors": []
    },
    {
      "row": 3,
      "status": "valid",
      "postId": null,
      "scheduledFor": "2027-01-13T11:30:00.000Z",
      "errors": []
    },
    {
      "row": 4,
      "status": "error",
      "postId": null,
      "scheduledFor": null,
      "errors": [
        {
          "code": "VALIDATION_FAILED",
          "message": "Invalid option: expected one of \"instagram\"|\"facebook\"|\"linkedin\"|\"tiktok\"|\"threads\"|\"twitter\"|\"discord\"|\"telegram\"|\"bluesky\"|\"youtube\"|\"pinterest\"",
          "column": "platforms"
        }
      ]
    }
  ]
}
```

### Get a post

`GET /api/posts/{postId}` · MCP tool `posts_get` · scope `posts:read` · rate limit `apiRead` · success `200`

Get one post by id: its status, text, media, schedule, targets, options and `platformPosts`, one entry per account with that account's status, platform post id, `publishedUrl`, `error` or `notice`, and its first comment and thread results. Use it to follow a post you know the id of, such as after posts_create or posts_publish, or to see why an account failed; use posts_list to find posts by status, platform, set or text, and analytics_posts for metrics. 404 POST_NOT_FOUND when no post with this id is yours, or the key cannot see any of its platform sets.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |

Example response:

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "published",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": {
    "campaignId": "launch-2026"
  },
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "17895695668004550",
      "publishedUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": {
        "status": "published",
        "commentId": "17858893269123456",
        "error": null,
        "reason": null,
        "updatedAt": "2026-10-06T09:00:04.000Z"
      },
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "108234567890123_901234567890125",
      "publishedUrl": "https://www.facebook.com/108234567890123/posts/901234567890125",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": {
        "status": "failed",
        "commentId": null,
        "error": {
          "code": "PLATFORM_ERROR",
          "message": "Facebook comment failed: the service is temporarily unavailable",
          "retryable": true,
          "platformCode": null,
          "platformSubcode": null
        },
        "reason": null,
        "updatedAt": "2026-10-06T09:00:04.000Z"
      },
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:04.000Z"
}
```

### Update a post

`PATCH /api/posts/{postId}` · MCP tool `posts_update` · scope `posts:write` · rate limit `createPost` · success `200`

Change a draft or scheduled post. Send only the fields to change; `media` and `targets` replace the whole list (accounts the post keeps keep their results). `options` is merged per platform: each `options.<platform>` you send replaces that platform's options as a whole, `null` removes them, and other platforms keep theirs. Set `scheduledFor` to null to turn a scheduled post back into a draft. To change the text of a published post, use posts_edit_published. Returns the updated post. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION unless the post is a draft, scheduled or queued. In approval mode, a key or member whose posts need approval changes only drafts, and `scheduledFor` submits the draft for approval at that time (see posts_submit); an approver who sets `scheduledFor` on a waiting post approves it.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `targets` | body | object[] | no | Replaces all targets. Accounts the post keeps also keep their results. |
| `text` | body | string | no | Post text. Use `options.<platform>.text` to vary it per platform. |
| `firstComment` | body | string \| null | no | New first comment; null removes it |
| `linkUrl` | body | string \| null | no | Link to attach. Ignored by platforms whose `link.supported` is false. |
| `media` | body | object[] | no | Replaces all media |
| `mediaFit` | body | pad \| crop \| none | no | How media outside a platform's aspect ratio is fitted (`media.conversion` in GET /api/platforms), e.g. Instagram feed 4:5 to 1.91:1, Reels, Stories and TikTok 9:16, and on Pinterest a carousel's later images to the first one's ratio. pad: bars around the whole frame (white on images, black on video); crop: the centre fills the frame; none: the ratio stays as uploaded (a platform that requires one may refuse it). Default: pad. |
| `thread` | body | object[] | no | Replaces the thread; `[]` removes it |
| `options` | body | object | no | Per-platform options to change. Each platform key you send replaces that platform's options as a whole (send every field you want to keep, e.g. both `text` and `placement`); `null` removes them. Platforms you leave out keep their options. |
| `scheduledFor` | body | ISO 8601 \| null | no | New publish time; null turns the post back into a draft |

Example request:

```json
{
  "text": "Launch day (updated): Ampost publishes everywhere from one API.",
  "scheduledFor": "2027-01-12T08:00:00Z"
}
```

Example response. The scheduled post with the new text and time; the other fields stay as they were.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "scheduled",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day (updated): Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": "2027-01-12T08:00:00.000Z",
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": {
    "campaignId": "launch-2026"
  },
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-07T12:00:00.000Z"
}
```

### Delete a post

`DELETE /api/posts/{postId}` · MCP tool `posts_delete` · scope `posts:write` · rate limit `createPost` · success `200`

Discard a post that has not been published, including a scheduled one. The post stays readable with status `discarded`, and its media in Ampost storage is deleted. To take a published post down from the platforms, use posts_unpublish. Returns the discarded post. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION for a post that is posting, published, discarded or deleted. In approval mode, a key or member whose posts need approval discards only drafts (403 APPROVAL_REQUIRED otherwise).

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |

Example response. A scheduled post, discarded: it will not publish.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "discarded",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "facebook"
      ]
    }
  ],
  "platforms": [
    "facebook"
  ],
  "text": "Webinar starts in one hour.",
  "firstComment": null,
  "linkUrl": "https://example.com/webinar",
  "media": [],
  "mediaFit": "pad",
  "thread": [],
  "options": {},
  "scheduledFor": "2027-01-12T08:00:00.000Z",
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": null,
  "platformPosts": [
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "cancelled",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-07T12:00:00.000Z"
}
```

### Publish a post now

`POST /api/posts/{postId}/publish` · MCP tool `posts_publish` · scope `posts:write` · rate limit `publishPost` · success `200`

Publish a draft or scheduled post to all its accounts now. Check `platformPosts` for each account's result; an account with a video may stay `processing` (the platform is still processing it) for a few minutes before it is `published`; follow it with posts_get. To publish later, set `scheduledFor` with posts_update instead; to publish again to accounts that failed, use posts_retry. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION for a post that is posting, published, discarded or deleted. In approval mode, a member whose posts need approval gets 403 APPROVAL_REQUIRED and a drafts-only key (`posts:propose`) 403 INSUFFICIENT_SCOPE (use posts_submit), and publishing a post that waits for approval approves it (403 APPROVER_ROLE_REQUIRED for anyone but an approver).

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `Idempotency-Key` (MCP `idempotencyKey`) | header | string | no | Idempotency key (1-255 visible ASCII characters, for example a UUID). A retry with the same key and arguments within 24 hours returns the first result instead of running again. Send a new key for each new action. See Idempotency. |

Example response:

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "published",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": {
    "campaignId": "launch-2026"
  },
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "17895695668004550",
      "publishedUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": {
        "status": "published",
        "commentId": "17858893269123456",
        "error": null,
        "reason": null,
        "updatedAt": "2026-10-06T09:00:04.000Z"
      },
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "108234567890123_901234567890125",
      "publishedUrl": "https://www.facebook.com/108234567890123/posts/901234567890125",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": {
        "status": "failed",
        "commentId": null,
        "error": {
          "code": "PLATFORM_ERROR",
          "message": "Facebook comment failed: the service is temporarily unavailable",
          "retryable": true,
          "platformCode": null,
          "platformSubcode": null
        },
        "reason": null,
        "updatedAt": "2026-10-06T09:00:04.000Z"
      },
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:00:04.000Z"
}
```

### Unpublish a post

`POST /api/posts/{postId}/unpublish` · MCP tool `posts_unpublish` · scope `posts:write` · rate limit `publishPost` · success `200`

Take a published post down from the platforms: every account where it is published, or only the given `accountIds` (from `platformPosts[].accountId`). Each account's result is in `platformPosts`: `deleted`, or still `published` with `notice` saying why (`UNPUBLISH_NOT_SUPPORTED` on Instagram and TikTok, which have no delete API; the platform's own refusal otherwise, such as Telegram's 48-hour limit for bots). The post becomes `deleted` once no account has it; it stays readable in Ampost. YouTube deletes count in the channel's daily budget of edits and deletes (10, 3 on Free; `notice` `RATE_LIMITED` past it). Call platforms_list for `unpublish.supported` per platform. Deleting from X costs X units like a post. To discard a post that is not published yet, use posts_delete. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION when no given account has it published.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `accountIds` | body | string[] | no | Accounts to delete the post from (`platformPosts[].accountId`). Default: every account where it is published. |

Example request:

```json
{
  "accountIds": [
    "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
    "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30"
  ]
}
```

Example response. Facebook deleted the post. Instagram has no delete API, so it stays published with a `notice`.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "published",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": null,
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": null,
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "17895695668004550",
      "publishedUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
      "text": null,
      "error": null,
      "notice": {
        "code": "UNPUBLISH_NOT_SUPPORTED",
        "message": "This platform has no API to delete a published post. Delete it in the platform's own app.",
        "retryable": false,
        "platformCode": null,
        "platformSubcode": null
      },
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T10:00:01.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "deleted",
      "platformPostId": "108234567890123_901234567890125",
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T10:00:01.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-07T10:00:01.000Z"
}
```

### Edit a published post's text

`POST /api/posts/{postId}/edit-published` · MCP tool `posts_edit_published` · scope `posts:write` · rate limit `publishPost` · success `200`

Replace the text of a published post on the platforms: every account where it is published, or only the given `accountIds` (from `platformPosts[].accountId`). Text only; media and links stay. Each account's result is in `platformPosts`: an edited account's `text` holds the new text, and an account the platform refused keeps its text with `notice` (`EDIT_NOT_SUPPORTED` on Instagram, Threads, TikTok, Bluesky and X, and on Facebook stories; the platform's own refusal otherwise). Facebook edits only posts Ampost published; a Telegram caption under media stays limited to 1024 characters. YouTube and Pinterest replace the video or Pin description. YouTube edits and deletes share a budget of 10 a day per channel (3 on Free); past it the account gets `notice` `RATE_LIMITED`. Call platforms_list for `editPublished.supported` per platform. To change a draft or scheduled post, use posts_update. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION when no given account has it published.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `text` | body | string | yes | The new text. It replaces the text only; media and links stay. Each platform's `text.maxLength` applies. |
| `accountIds` | body | string[] | no | Accounts to edit the post on (`platformPosts[].accountId`). Default: every account where it is published. |

Example request:

```json
{
  "text": "Launch day. Here is what we built and why (now with the pricing link in the comments).",
  "accountIds": [
    "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
    "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30"
  ]
}
```

Example response. Facebook has the new text. Instagram has no edit API, so it keeps its text, with a `notice`.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "published",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": null,
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": null,
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "17895695668004550",
      "publishedUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
      "text": null,
      "error": null,
      "notice": {
        "code": "EDIT_NOT_SUPPORTED",
        "message": "This platform has no API to edit a published post. Edit it in the platform's own app.",
        "retryable": false,
        "platformCode": null,
        "platformSubcode": null
      },
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T10:00:01.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "108234567890123_901234567890125",
      "publishedUrl": "https://www.facebook.com/108234567890123/posts/901234567890125",
      "text": "Launch day. Here is what we built and why (now with the pricing link in the comments).",
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T10:00:01.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-07T10:00:01.000Z"
}
```

### Retry failed accounts

`POST /api/posts/{postId}/retry` · MCP tool `posts_retry` · scope `posts:write` · rate limit `publishPost` · success `200`

Publish again to the accounts that failed, or only to the given `accountIds` (from `platformPosts[].accountId`). Ampost already retries retryable failures (rate limits, timeouts, platform errors) by itself, up to 5 attempts with backoff; an account waiting for that shows `pending` with `nextAttemptAt`. Call this for an account that is `failed`, after fixing the cause. It starts `attempts` again from 0. A published account whose first comment failed (`platformPosts[].firstComment.status` failed) posts only the comment again, without publishing the post twice or counting it again. An account whose thread stopped at a failed item continues the thread from that item, without publishing the post or the earlier items again. To publish a draft or scheduled post, use posts_publish. 404 POST_NOT_FOUND for an id that is not yours; 409 INVALID_STATUS_TRANSITION unless the post is `partial` or `failed` (or only first comments failed).

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `accountIds` | body | string[] | no | Accounts to retry (`platformPosts[].accountId`). A published account whose `firstComment.status` is failed retries only the comment; an account whose thread stopped at a failed item continues the thread from that item (the post and earlier items are not published again); other accounts publish again. Default: every failed account and every failed first comment. |
| `Idempotency-Key` (MCP `idempotencyKey`) | header | string | no | Idempotency key (1-255 visible ASCII characters, for example a UUID). A retry with the same key and arguments within 24 hours returns the first result instead of running again. Send a new key for each new action. See Idempotency. |

Example request:

```json
{
  "accountIds": [
    "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30"
  ]
}
```

Example response. Facebook had failed with `AUTH_REVOKED`. After the account was reconnected, the retry published it; Instagram was already published and is not touched.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "published",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day: Ampost publishes everywhere from one API.",
  "firstComment": null,
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": null,
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "17895695668004550",
      "publishedUrl": "https://www.instagram.com/reel/C9xYz12AbCd/",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:00:04.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "published",
      "platformPostId": "108234567890123_901234567890125",
      "publishedUrl": "https://www.facebook.com/108234567890123/posts/901234567890125",
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 1,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-06T09:41:12.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-06T09:41:12.000Z"
}
```

### Submit a draft for approval

`POST /api/posts/{postId}/submit` · MCP tool `posts_submit` · scope `posts:write` · rate limit `createPost` · success `200`

Submit a draft for approval, with `proposedFor`, the time it should publish (null: as soon as it is approved; omitted: the time proposed before, if any). The post stays a draft with `approval.status` `pending`, and the workspace's approvers are emailed. Approving schedules it at `proposedFor`, or publishes it at once when the time has passed. Submit again after a rejection (read `approval.reason`) or a change: it asks again. Works with a drafts-only key (`posts:propose`). 409 INVALID_STATUS_TRANSITION unless the post is a draft.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `proposedFor` | body | ISO 8601 \| null | no | When you want it published, ISO 8601. On approval a future time schedules it, and a time already past (or none) publishes it right away. Omitted: the time proposed before, else none. |

Example request:

```json
{
  "proposedFor": "2027-01-12T08:00:00.000Z"
}
```

Example response. The draft waits for an approver, who is emailed; on approval it is scheduled at `proposedFor`.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "draft",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day (updated): Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": {
    "campaignId": "launch-2026"
  },
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-07T12:00:00.000Z",
  "approval": {
    "status": "pending",
    "proposedFor": "2027-01-12T08:00:00.000Z",
    "reason": null,
    "requestedBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
    "requestedAt": "2026-10-07T12:00:00.000Z",
    "decidedBy": null,
    "decidedAt": null
  }
}
```

### Approve a waiting post

`POST /api/posts/{postId}/approve` · MCP tool `posts_approve` · scope `posts:write` · rate limit `publishPost` · success `200`

Approve a post that waits for approval: it is scheduled at its `approval.proposedFor`, or published now when no time was proposed or the time has passed (check `platformPosts` as after posts_publish). Plan limits apply as when you schedule or publish. 403 APPROVER_ROLE_REQUIRED unless you are an Owner, Admin or Approver of the workspace; 409 NOT_PENDING_APPROVAL when the post does not wait for approval.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `Idempotency-Key` (MCP `idempotencyKey`) | header | string | no | Idempotency key (1-255 visible ASCII characters, for example a UUID). A retry with the same key and arguments within 24 hours returns the first result instead of running again. Send a new key for each new action. See Idempotency. |

Example response. The proposed time was still ahead, so the post is scheduled at it. A time already past publishes it now.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "scheduled",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day (updated): Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": "2027-01-12T08:00:00.000Z",
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": {
    "campaignId": "launch-2026"
  },
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-07T12:00:00.000Z",
  "approval": {
    "status": "approved",
    "proposedFor": "2027-01-12T08:00:00.000Z",
    "reason": null,
    "requestedBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
    "requestedAt": "2026-10-07T12:00:00.000Z",
    "decidedBy": "9c3f5a1e-7b2d-4e8f-a6c1-2d9e4b7f0a35",
    "decidedAt": "2026-10-07T15:30:00.000Z"
  }
}
```

### Reject a waiting post

`POST /api/posts/{postId}/reject` · MCP tool `posts_reject` · scope `posts:write` · rate limit `createPost` · success `200`

Reject a post that waits for approval, with a `reason` its author reads in `approval.reason`. The post stays a draft, to change and submit again. 403 APPROVER_ROLE_REQUIRED unless you are an Owner, Admin or Approver of the workspace; 409 NOT_PENDING_APPROVAL when the post does not wait for approval.

| Field | In | Type | Required | Description |
|---|---|---|---|---|
| `postId` | path | string | yes | Post id (UUID): `id` from posts_list or posts_create |
| `reason` | body | string | yes | Why it is rejected, up to 1000 characters. Stored on the post (`approval.reason`) for the proposer, its API key or agent, and sent in the `post.rejected` webhook event. |

Example request:

```json
{
  "reason": "The launch moved to 14 January. Change the date and submit it again."
}
```

Example response. The post is a draft again, with the reason for its author; change it and call posts_submit.

```json
{
  "id": "7f1c2a9e-4b1d-4c55-9a0e-2f6d8b3c1a10",
  "status": "draft",
  "targets": [
    {
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "platforms": [
        "instagram",
        "facebook"
      ]
    }
  ],
  "platforms": [
    "instagram",
    "facebook"
  ],
  "text": "Launch day (updated): Ampost publishes everywhere from one API.",
  "firstComment": "Pricing and docs: https://ampost.io",
  "linkUrl": null,
  "media": [
    {
      "url": "https://cdn.example.com/launch.mp4",
      "type": "video",
      "mimeType": "video/mp4",
      "sizeBytes": 18200000,
      "width": 1080,
      "height": 1920,
      "durationSeconds": 21,
      "altText": null,
      "thumbnailUrl": null
    }
  ],
  "mediaFit": "pad",
  "thread": [],
  "options": {
    "instagram": {
      "placement": "reel"
    },
    "facebook": {
      "text": "Launch day. Here is what we built and why."
    }
  },
  "scheduledFor": null,
  "queuePlatformSetId": null,
  "source": "api",
  "createdBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
  "metadata": {
    "campaignId": "launch-2026"
  },
  "platformPosts": [
    {
      "platform": "instagram",
      "accountId": "c41d8e2f-6a3b-4f9c-b1e5-7d2a9c4e6f80",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    },
    {
      "platform": "facebook",
      "accountId": "8d3b6f1a-2c9e-4a7d-b5f3-1e6a9c2d7b30",
      "platformSetId": "0b6e4d2a-9c3f-4e1b-8a7d-5f2c1e9b3d40",
      "status": "pending",
      "platformPostId": null,
      "publishedUrl": null,
      "text": null,
      "error": null,
      "notice": null,
      "warnings": [],
      "attempts": 0,
      "nextAttemptAt": null,
      "firstComment": null,
      "mediaTransforms": null,
      "thread": null,
      "createdAt": "2026-10-06T09:00:00.000Z",
      "updatedAt": "2026-10-07T12:00:00.000Z"
    }
  ],
  "createdAt": "2026-10-06T09:00:00.000Z",
  "updatedAt": "2026-10-07T12:00:00.000Z",
  "approval": {
    "status": "rejected",
    "proposedFor": "2027-01-12T08:00:00.000Z",
    "reason": "The launch moved to 14 January. Change the date and submit it again.",
    "requestedBy": "4e8b2d6f-1a3c-4f7e-9d5b-8c2a6e1f3b90",
    "requestedAt": "2026-10-07T12:00:00.000Z",
    "decidedBy": "9c3f5a1e-7b2d-4e8f-a6c1-2d9e4b7f0a35",
    "decidedAt": "2026-10-07T15:30:00.000Z"
  }
}
```
