Imports API
The /v1/imports/posts/csv endpoints bulk-create posts from CSV content —
the API counterpart of the app's CSV import flow. You submit a CSV (inline or
by URL), receive a job with per-row outcomes, and can retry the failed rows.
Requires authentication.
Start a CSV import
POST /api/v1/imports/posts/csv
Provide the CSV either as a URL or as a raw string — exactly one of the two.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
url | string | one of url/csv | URL pointing at the CSV file |
csv | string | one of url/csv | Raw CSV content, inline |
Each CSV row describes one post (account, caption, schedule, media, etc. — the same columns the app's importer accepts).
Example
curl -X POST https://<your-api-origin>/api/v1/imports/posts/csv \
-H "Authorization: Bearer sx_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://cdn.example.com/q3-calendar.csv" }'
Response — 200 OK
{
"data": {
"jobId": "imp_01",
"status": "completed",
"result": {
"total": 120,
"succeeded": 117,
"failed": 3
}
}
}
When the queue processes inline, the job completes synchronously and the
response already carries the per-row counts. 500 server_error if the job
cannot be created.
List import jobs
GET /api/v1/imports/posts/csv?limit=<n>&offset=<n>
Lists your import jobs (newest first) with standard pagination.
Get a job
GET /api/v1/imports/posts/csv/{id}
Returns the job summary inside data — status and the
{ total, succeeded, failed } result counts. 404 not_found for unknown or
out-of-organization jobs.
Get row outcomes
GET /api/v1/imports/posts/csv/{id}/rows?status=SUCCESS|FAILED&limit=50&offset=0
Per-row results so you can see exactly which rows failed and why.
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | — | SUCCESS or FAILED |
limit | integer | — | Page size, max 500 |
offset | integer | 0 | Skip count |
Retry failed rows
POST /api/v1/imports/posts/csv/{id}/retry
Re-queues the job's failed rows.
Response — 200 OK
{
"data": {
"jobId": "imp_02",
"retrying": true
}
}
jobId is the new retry job (null when there was nothing to retry or no
queue is attached); retrying tells you whether a retry actually started.
Pull the failed rows first, fix the CSV (typically a
platform-limit 400 — oversized media, caption too long), re-submit or
retry, then re-check counts.
Related
- Posts API — the rows become ordinary posts.
- Limits — the usual cause of failed rows.
- Scheduling — the user-facing import flow.