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
| Name | Type | Description |
|---|---|---|
post_id Required | string | post_ ID |
expected_version Required | integer | 1 to 9007199254740991 |
text | string | 0 to 10000 characters |
account_ids | string[] | 1 to 20 items |
variants | object | — |
media_ids | string[] | 0 to 20 items |
thread | string[] | 0 to 25 items |
idempotency_key Required | string | 8 to 128 characters |
Output
| Name | Type | Description |
|---|---|---|
post_id Required | string | — |
version Required | integer | -9007199254740991 to 9007199254740991 |
status Required | "draft" | "pending_approval" | "scheduled" | "publishing" | "published" | "partially_failed" | "failed" | "cancelled" | — |
validation Required | object[] | — |
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
UNAUTHENTICATEDINSUFFICIENT_SCOPERATE_LIMITEDINTERNALVALIDATION_FAILEDNOT_FOUNDPOLICY_DENIEDSUBSCRIPTION_INACTIVEACCOUNT_NOT_ALLOWEDIDEMPOTENCY_CONFLICTVERSION_CONFLICTINVALID_STATE
Rate limit
30 calls a minute per connection, and 300 a minute across all tools.