Import many posts from a CSV or a list of rows

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/ref-bulk-import"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/976625df-5c2f-42e1-a35d-4b538c7fa4b1/social-card.svg?v=3e7ae33eec8b" alt="Import many posts from a CSV or a list of rows" width="600" height="315"></a>
POST http://localhost:4000/api/v1/posts/import

Send csv (the template's columns; GET /posts/import/template) or rows (the same fields as JSON, at most 500). format is how dates are written (YYYY-MM-DD HH:mm, DD/MM/YYYY, MM/DD/YYYY or ISO), read in timezone or the workspace's. mode: draft saves everything as drafts, schedule publishes at each row's time (a row without one takes the next queue slot), queue puts every row at the next free slot. A row with an id updates that post. With dryRun: true nothing is created and the answer holds each row's errors and warnings, rejected rows grouped by cause. Otherwise the valid rows are created (allOrNothing: true creates none when any row is rejected) and each row's result is returned. Send batchKey to make a retry safe. Scheduling needs the posts:publish scope.

Request body

application/json
csv
string
rows
object[]
Show child parameters
line
integer
id
string
text
string
date
string
time
string
timezone
string
draft
string
client
string
tags
string
channels
string
firstComment
string
link
string
media
object[]
Show child parameters
url
string
required
alt
string
mediaIds
string[]
thumbnailUrl
string
settings
object
format
string
YYYY-MM-DD HH:mm | DD/MM/YYYY | MM/DD/YYYY | ISO = YYYY-MM-DD HH:mm
mode
string
draft | schedule | queue = schedule
timezone
string
dryRun
boolean
allOrNothing
boolean
batchKey
string
{
  "csv": "string",
  "rows": [
    {
      "line": 0,
      "id": "string",
      "text": "string",
      "date": "string",
      "time": "string",
      "timezone": "string",
      "draft": "string",
      "client": "string",
      "tags": "string",
      "channels": "string",
      "firstComment": "string",
      "link": "string",
      "media": [
        {
          "url": "string",
          "alt": "string"
        }
      ],
      "mediaIds": [
        "string"
      ],
      "thumbnailUrl": "string",
      "settings": {}
    }
  ],
  "format": "YYYY-MM-DD HH:mm",
  "mode": "schedule",
  "timezone": "string",
  "dryRun": true,
  "allOrNothing": true,
  "batchKey": "string"
}

Code samples

cURL
curl -X POST "http://localhost:4000/api/v1/posts/import" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"csv":"string","rows":[{"line":0,"id":"string","text":"string","date":"string","time":"string","timezone":"string","draft":"string","client":"string","tags":"string","channels":"string","firstComment":"string","link":"string","media":[{"url":"string","alt":"string"}],"mediaIds":["string"],"thumbnailUrl":"string","settings":{}}],"format":"YYYY-MM-DD HH:mm","mode":"schedule","timezone":"string","dryRun":true,"allOrNothing":true,"batchKey":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 OK
Example
{}
Option 1
{}
Option 2
{}
Updated