---
title: "Import posts from a CSV file (drafts)"
method: POST
path: "/posts/import"
tags: ["Posts"]
---

# Import posts from a CSV file (drafts)

`POST /posts/import`

## Request

- Base URL: `https://www.sociahive.com/api/v1`
- URL: `https://www.sociahive.com/api/v1/posts/import`
- Auth: one of:
  - API key in header `X-API-Key`
  - OAuth 2 (authorization code, authorization URL `/api/oauth/authorize`, token URL `/api/oauth/token`, scopes: `posts:write`)

Columns: `text` (required), `platforms` (`|`-separated), `media` (`|`-separated public https URLs; 2+ images on an Instagram row make a carousel). At most 100 rows and 1 MB. Send multipart form-data with a `file` field, or the CSV as a `text/csv` body. Every row becomes a draft; plan limits and publish checks apply when you schedule it.

## Response `201`

Import result

- object
  - `data` PostImportResult, required: Outcome of a CSV import. Every created post is a draft.
    - `created` integer, required
    - `failed` integer, required
    - `post_ids` string[], required
    - `errors` object[], required
      - `line` integer, required
      - `error` string, required

## Other responses

- `400`: Bad request — invalid parameters
- `401`: Authentication required — provide X-API-Key or Bearer token
- `403`: Insufficient scope for this operation
- `413`: CSV larger than 1 MB
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/sociahive/apis/sociahive-api.md) · [All operations](https://skmtc.dev/sociahive/apis/sociahive-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sociahive/apis/sociahive-api/revisions/791b8548d288?raw)
