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

SocialAPI lists the replies to an X account’s posts from the last 7 days, replies to them, hides and unhides replies in conversations that the account’s own posts started, and deletes the replies the account wrote. Endpoints, fields, limits, and errors are in X / Twitter comments.

Direct messages

SocialAPI lists an X account’s DM conversations, reads their messages, and sends text DMs. X returns only the last 30 days of DMs. Endpoints, send rules, limits, and errors are in X / Twitter direct messages.

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 November 15, 2026