Create or update up to 100 posts in one call

Embed
Preview of the card
<a href="https://indrava.forumulate.com/docs/ref-posts-bulk"><img src="https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/pages/f9e71c29-ad2a-4fe1-89b9-9f2ef890de73/social-card.svg?v=3e7ae33eec8b" alt="Create or update up to 100 posts in one call" width="600" height="315"></a>
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
posts
object[]
required
Show child parameters
id
string
parts
object[]
required
Show child parameters
text
string
required
mediaIds
string[]
= []
delaySeconds
integer
mediaUrls
string[]
targets
object[]
required
Show child parameters
channelId
string
required
parts
object[]
settings
object
= {}
action
string
required
draft | schedule | now
scheduledAt
string
tagIds
string[]
clientId
string
aiGenerated
boolean
idempotencyKey
string
allowDuplicate
boolean
{
  "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