Skip to content

preflight_post

Checks copy against each destination network’s character limit, flags profiles that are not connected or need reconnecting, warns when a network requires media, and prices the post against the workspace balance. Publishes nothing and costs nothing.

On this page
  1. Parameters
  2. Example request
  3. Response
Category
Publishing
REST
POST/api/tools/preflight_post

Parameters

content
stringrequired
The copy to check.
targetAccounts
array<object>optional
Same shape as create_post.
platforms
array<enum>optional
Same shape as create_post.
mediaUrl
stringoptional
Media that would be attached, if any.
workspaceId
stringoptional
Workspace to act on, from list_workspaces. Omit to use the default workspace on the key.

Example request

curl -X POST "https://api.postmcpai.com/api/tools/preflight_post" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $POSTMCPAI_API_KEY" \
  -d '{
    "content": "A long announcement that runs past the X limit… https://acme.co/launch",
    "platforms": [
      "twitter",
      "linkedin"
    ]
  }'

Response

ok is false when anything in blockers[] would stop the post. warnings[] is advisory.

200 · application/json
{
  "ok": false,
  "characterCount": 316,
  "resolvedTargets": [
    {
      "platform": "twitter",
      "profileId": "tw_1293847",
      "username": "@alexj_dev"
    },
    {
      "platform": "linkedin",
      "profileId": "lin_7741903",
      "username": "postmcp-ai"
    }
  ],
  "unknownTargets": [],
  "limits": {
    "twitter": 280,
    "linkedin": 3000
  },
  "credits": {
    "cost": 56,
    "balance": 450,
    "remainingAfter": 394
  },
  "blockers": [
    "Copy is 36 character(s) over twitter’s 280-character limit."
  ],
  "warnings": [
    "Copy contains a link, which adds a one-off 50-credit surcharge."
  ]
}