# Create, schedule or publish a post

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

`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"
}
```
