At a glance
Capabilities
An unsupported call returns501 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 withPOST /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.
- Saved app credentials. Without them,
POST /v1/accounts/connectreturns412 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 theerrorparameter set tobyok.credentials_invalidorbyok.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.authand the account is markedtoken_expired. Every later call that acts on the account returns403 account.reconnection_requireduntil you reconnect it. See Reconnect an account. - Media scope. Uploading media needs the
media.writescope. An account connected without it fails an upload with403 platform.twitter.insufficient_scopeuntil 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.Related
- X publishing: fields, media rules, threads, and quirks for publishing
- X comments: list, reply to, hide, and delete the replies to your posts
- X direct messages: list conversations and send text DMs
- Use your own X app: create the X app and save its credentials
- Platform apps: which platforms use SocialAPI’s app and which use yours
- Platforms: the capability matrix
- Errors: every error code