Create or update up to 100 posts in one call
POST
http://localhost:4000/api/v1 /posts/bulk Every entry of posts is what POST /posts takes and passes the same checks (channel rules, plan limit, approval, the workspace's rules, duplicates). The answer has one result per entry, in order: ok: true with the post's id, or ok: false with the error that POST /posts would have answered. The call itself answers 200 whenever its shape is valid.
Request body
application/json
postsobject[]
required
Show child parameters
idstring
partsobject[]
required
Show child parameters
textstring
required
mediaIdsstring[]
delaySecondsinteger
mediaUrlsstring[]
targetsobject[]
required
Show child parameters
channelIdstring
required
partsobject[]
settingsobject
actionstring
required
scheduledAtstring
tagIdsstring[]
clientIdstring
aiGeneratedboolean
idempotencyKeystring
allowDuplicateboolean
{
"posts": [
{
"id": "string",
"parts": [
{
"text": "string",
"mediaIds": [],
"delaySeconds": 0,
"mediaUrls": [
"string"
]
}
],
"targets": [
{
"channelId": "string",
"parts": [
{
"text": "string",
"mediaIds": [],
"delaySeconds": 0,
"mediaUrls": [
"string"
]
}
],
"settings": {}
}
],
"action": "draft",
"scheduledAt": "2024-01-01T00:00:00Z",
"tagIds": [
"string"
],
"clientId": "string",
"aiGenerated": true,
"idempotencyKey": "string",
"allowDuplicate": true
}
]
}Code samples
cURL
curl -X POST "http://localhost:4000/api/v1/posts/bulk" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"posts":[{"id":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0,"mediaUrls":["string"]}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0,"mediaUrls":["string"]}],"settings":{}}],"action":"draft","scheduledAt":"2024-01-01T00:00:00Z","tagIds":["string"],"clientId":"string","aiGenerated":true,"idempotencyKey":"string","allowDuplicate":true}]}'TypeScript
Python
Go
PHP
Ruby
Java
Responses
200 OK
Example
{}Option 1
{}Option 2
{}Updated