Skip to main content
The X / Twitter API in SocialAPI connects an X account through an X developer app that you create. It publishes posts and threads with images, video, or a GIF, reads and moderates replies, reads and sends direct messages (DMs), and reads mentions. SocialAPI has no shared X app: X bills usage to the developer account that owns the app, so every call on your X accounts is billed to you by X. See Why X uses your own app.

At a glance

Capabilities

An unsupported call returns 501 resource.not_supported. The cross-platform matrix is on Platforms.

Connect an account

Save your X app’s OAuth 2.0 Client ID and Client Secret in the SocialAPI dashboard first: Use your own X app. Then connect with POST /v1/accounts/connect and "platform": "twitter". The shared flow, request fields, and result are in Connect accounts, and the redirect parameters are in Redirect parameters.
Response (HTTP 202):
X-specific rules:
  • Saved app credentials. Without them, POST /v1/accounts/connect returns 412 byok.credentials_missing. When X rejects the saved credentials, or refuses your app access to its API, the connection ends on your redirect URI with the error parameter set to byok.credentials_invalid or byok.app_access_denied.
  • One app per brand. A brand can use a different X app from your default one: see Use your own X app.
  • Reconnect. X access tokens last 2 hours and SocialAPI renews them. If renewal fails, for example because the person revoked access, the first call that fails returns 401 platform.twitter.auth and the account is marked token_expired. Every later call that acts on the account returns 403 account.reconnection_required until you reconnect it. See Reconnect an account.
  • Media scope. Uploading media needs the media.write scope. An account connected without it fails an upload with 403 platform.twitter.insufficient_scope until the person reconnects.

Comments

List replies to a post with GET /v1/inbox/comments/{postId}, where postId is the post’s platform ID (targets[].platform_post_id). Reply, hide, unhide, and delete work as described in Comments. X-specific rules:
  • 7-day window. X returns replies posted in the last 7 days. A reply to a post older than that does not appear.
  • Hide. Hide and unhide work on replies to the connected account’s own posts.
  • Delete. Deleting works only on a reply the connected account wrote.
  • Like. X removed like writes for self-serve apps. Read can_like on each comment rather than assuming.

Direct messages

List conversations with GET /v1/inbox/conversations, read one with its messages, and send with the DM endpoints in Direct messages. X-specific rules:
  • Text only. A DM sends text. An attachment is rejected before anything is sent.
  • Recipient. A send goes to the other person in the conversation. A group conversation has no single recipient, so a send to it is refused.
  • X’s own limit. X allows 15 DM read requests per 15 minutes for each connected account. Past it, calls return 429 platform.twitter.rate_limit.

Limits

Scopes

You choose the app permissions (Read and write, and Direct message) on your own X app, as described in Use your own X app. SocialAPI requests these scopes when the person connects the account. Each scope belongs to the account permissions in the last column, and the consent screen asks for the scopes of the permissions you selected.
Last modified on October 13, 2026