# Import posts from CSV

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

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