Skip to main content
Available X / Twitter is fully supported for posts (tweets), comments (replies), DMs, mentions, and comment moderation via the X API v2.

Details

FieldValue
Platform slugtwitter
Auth typeOAuth 2.0 (X / Twitter v2)
APIX API v2

Feature support

FeatureSupportedNotes
List postsReturns user tweets
CommentsReplies to a specific tweet
Reply to comment
Comment replies (thread)
Moderate comment (hide/delete)Hide a reply, or delete your own reply
Like commentLike/unlike a tweet or reply
Private reply-Not applicable
DMsDirect Messages via X API v2
Send DM
Reviews-Not applicable
MentionsTweets mentioning the authenticated user
Create postText tweets, with optional media
Update post-X does not expose a public edit endpoint
Delete post

Connecting

curl -X POST https://api.social-api.ai/v1/accounts/connect \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "twitter",
    "metadata": {
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'
Response:
{
  "auth_url": "https://twitter.com/i/oauth2/authorize?client_id=...&state=...",
  "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2"
}
Redirect your user to auth_url. After they authorize, X redirects to your redirect_uri with ?code=...&state=.... Then call:
curl -X POST https://api.social-api.ai/v1/oauth/exchange \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "twitter",
    "code": "abc123...",
    "metadata": {
      "state": "4a8f2c1e9b3d7f06a5c2e8b4d1f3a7e2",
      "redirect_uri": "https://app.example.com/oauth/callback"
    }
  }'

Publishing

Create a tweet with optional reply settings:
curl -X POST https://api.social-api.ai/v1/posts \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_ids": ["acc_01HZ9X3Q4R5M6N7P8V2K0W1J"],
    "text": "Hello from SocialAPI!",
    "platform_data": {
      "twitter": {
        "reply_settings": "everyone"
      }
    }
  }'

PlatformData fields

Pass these inside platform_data.twitter when creating a post.
FieldTypeDefaultDescription
reply_settingsstring"everyone"Who can reply to this tweet. Options: "everyone", "following" (only people you follow), "verified" (only verified accounts).

Sample: List mentions

curl "https://api.social-api.ai/v1/accounts/{id}/mentions?limit=10" \
  -H "Authorization: Bearer $SOCAPI_KEY"

Sample: List DMs

curl "https://api.social-api.ai/v1/inbox/conversations?account_id={id}" \
  -H "Authorization: Bearer $SOCAPI_KEY"

Notes

  • No post editing. X does not expose a public edit API. UpdatePost returns 501. Delete and re-create if needed.
  • No webhook handler. X does not push real-time events via this integration. Posts and comments are fetched on demand.
  • Comment moderation. Hide toggles reply visibility. Delete removes your own replies. Like/unlike is supported.
  • Token refresh. X OAuth 2.0 tokens expire. SocialAPI handles refresh automatically. If you receive 401 with code: "invalid_token", reconnect the account.
  • Required scopes. Your X Developer App must have the appropriate OAuth 2.0 scopes for reading tweets, posting, DMs, and user lookup.