Import many posts from a CSV or a list of rows
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
csvrowsShow child parameters
lineidtextdatetimetimezonedraftclienttagschannelsfirstCommentlinkmediaShow child parameters
urlaltmediaIdsthumbnailUrlsettingsformatmodetimezonedryRunallOrNothingbatchKey{
"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
Example
{}Option 1
{}Option 2
{}