Skip to content

Errors

Problem details, stable codes and what to do about each one.

Errors use RFC 9457 problem details with Content-Type: application/problem+json:

{
  "type": "about:blank",
  "title": "Key lacks a permission",
  "status": 403,
  "detail": "This key needs the posts:publish permission for this endpoint.",
  "code": "insufficient_scope",
  "request_id": "req_f3T0p9vK2xQm1aLs",
  "required_scope": "posts:publish"
}

Branch on code, never on title or detail: codes are stable, the texts may improve. Validation errors list each problem in errors, with a parameter (query) or a pointer (body, such as /targets/0/account_id).

Codes

CodeStatusMeaning
invalid_cursor400Invalid cursor
invalid_idempotency_key400Invalid Idempotency-Key
invalid_request400Invalid request
invalid_webhook_url400Invalid webhook URL
tiktok_consent_required400TikTok consent required
api_key_expired401API key expired
api_key_revoked401API key revoked
invalid_api_key401Invalid API key
missing_api_key401API key required
key_spend_cap_reached402Key Token cap reached
max_tokens_exceeded402Price above max_tokens
max_tokens_required402max_tokens required
plan_required402Plan does not include API access
workspace_locked402Workspace locked
comment_custodian_required403Only the account's custodian can act on its comments
developer_platform_unavailable403API access not enabled
insufficient_scope403Key lacks a permission
ip_not_allowed403IP address not allowed
network_locked403Network not included in the plan
network_unavailable403Network not available
permission_denied403Not allowed
personal_keys_disabled403Personal keys are turned off
test_key_required403Test key required
workspace_key_required403Workspace key required
workspace_unavailable403Workspace unavailable
not_found404Resource not found
unknown_endpoint404Not found
method_not_allowed405Method not allowed
account_limit_reached409Account limit reached for this network
comment_draft_pending409A reply draft is waiting
conversation_changed409Conversation changed
idempotency_in_flight409Request with this Idempotency-Key in progress
simulated_account409Not available for test accounts
webhook_endpoint_limit_reached409Webhook endpoint limit reached
idempotency_key_reused422Idempotency-Key used for another request
project_restricted423Project restricted
workspace_read_only423Workspace is read-only
comment_limit_reached429Daily comment limit reached
rate_limited429Too many requests
server_error500Server error
provider_error502The network refused or failed
service_unavailable503Service unavailable

Actions on posts, media and accounts can also answer the same codes as the app, such as past_schedule, video_required, plan_limit_video_size or publication_limit (a plan limit, with the details in limits). They keep the HTTP status that fits: 400 for a request to fix, 402 for the plan or balance, 409 for a conflict with the current state.

Retrying

Retry 429 after Retry-After seconds, and 500, 502 and 503 with exponential backoff. Send the same Idempotency-Key so a retry never repeats a change. Do not retry other 4xx errors without changing the request.

A 500 carries a reference. Send it with the Request-Id when you contact support.