Posts

Create a source post and its publications

Omitting scheduledAt creates unscheduled destination drafts. API keys need publication:manage; supplying scheduledAt also requires publication:dispatch. Target content must match the chosen channel profile. The examples use placeholder channel IDs that must be replaced.

POST
/api/projects/{projectId}/posts

Authorization

headerAuthorizationBearer <Postdot API key>

A user-owned Postdot API key sent as Authorization: Bearer <token>. Its project scope is limited by the creator’s current access.

Path Parameters

projectId*string
Length1 <= length

Request Body

  1. body
title?|null
sourceContent*
publications*array<>
Items1 <= items

Response Body

Response for status 201

application/json
  1. response
post*
publications*array<>
Example Request
curl -X POST 'https://postbot.example/api/projects/string/posts' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "Friday collection announcement",
  "sourceContent": {
    "body": {
      "text": "Our new collection arrives on Friday.",
      "format": "plain_text"
    },
    "media": []
  },
  "publications": [
    {
      "channelId": "REPLACE_WITH_MANUAL_CHANNEL_ID",
      "deliveryMode": "manual",
      "targetContent": {
        "body": "Our new collection arrives on Friday.",
        "media": []
      }
    }
  ]
}'
Example Response
{
  "post": {
    "id": "string",
    "projectId": "string",
    "title": "string",
    "sourceContent": "string",
    "sourceRevision": -9007199254740991,
    "createdByActorId": "string",
    "createdAt": -9007199254740991,
    "updatedAt": -9007199254740991
  },
  "publications": [
    {
      "id": "string",
      "projectId": "string",
      "postId": "string",
      "channelId": "string",
      "targetRevisionId": "string",
      "deliveryMode": "manual",
      "reviewState": "compatible",
      "state": "draft",
      "scheduledAt": -9007199254740991,
      "publishedAt": -9007199254740991,
      "externalId": "string",
      "externalUrl": "string",
      "errorMessage": "string",
      "createdByActorId": "string",
      "scheduledByActorId": "string",
      "stateChangedByActorId": "string",
      "publishedByActorId": "string",
      "lastAssessedProfileVersionId": "string",
      "createdAt": -9007199254740991,
      "updatedAt": -9007199254740991,
      "profileAssessmentIssues": [
        {}
      ]
    }
  ]
}

Was this page helpful?