update_post

Changes state

Saves a new version of a post that has not gone out. Pass expected_version from get_post; a change after approval sends the post back for approval.

Permission

Scope posts:write: Create and edit drafts, and upload media. Allowed in every mode. Changing an approved post sends it back for approval.

Input

Input
NameTypeDescription
post_id Requiredstringpost_ ID
expected_version Requiredinteger1 to 9007199254740991
textstring0 to 10000 characters
account_idsstring[]1 to 20 items
variantsobject—
media_idsstring[]0 to 20 items
threadstring[]0 to 25 items
idempotency_key Requiredstring8 to 128 characters

Output

Output
NameTypeDescription
post_id Requiredstring—
version Requiredinteger-9007199254740991 to 9007199254740991
status Required"draft" | "pending_approval" | "scheduled" | "publishing" | "published" | "partially_failed" | "failed" | "cancelled"—
validation Requiredobject[]—

Example

Request

{
  "post_id": "post_…",
  "expected_version": 1,
  "text": "Lumen 2.0 is out today…",
  "idempotency_key": "launch-edit-1"
}

Response

{
  "post_id": "post_…",
  "version": 2,
  "status": "draft",
  "validation": [
    {
      "account_id": "acc_…",
      "valid": true,
      "issues": []
    }
  ]
}

Errors

Rate limit

30 calls a minute per connection, and 300 a minute across all tools.

Related tools