Docs
X (Twitter)

Overview

Connect X, scopes, capabilities, wallet costs, and known limits.

Prepaid wallet required

X API calls are pass-through billing. X bills Onepostly for usage, and Onepostly debits your prepaid wallet at the same X list prices — no markup. If your wallet has no credits, requests are rejected with 402 INSUFFICIENT_WALLET. Top up in Dashboard → Settings → Billing.

Onepostly maps the X API v2 (OAuth 2.0 + PKCE) into the same /v1/* surface as other platforms. This section covers X-only behavior.

In this section

PageTopics
PostsPublish, media, threads, quotes, schedule, remote delete
EngagementLikes, retweets, bookmarks, comments
InsightsAnalytics / normalized metrics

Cross-platform API flow lives under each platform (e.g. X) plus shared guides like Media and Webhooks.

Connect

  1. Dashboard → Connections → connect X
  2. Approve scopes in the X consent screen
  3. Resolve connectionId with your API key:
curl https://api.onepostly.com/v1/connections \
  -H "x-api-key: op_YOUR_KEY"

Use the matching row’s id (where platform is "x") as connectionId in publish requests.

After scope upgrades (media, likes, bookmarks), reconnect X so the new scopes appear on the token.

OAuth scopes

ScopeUsed for
tweet.readRead tweets / public metrics / search replies
tweet.writeCreate tweets, replies, quotes, threads, delete
users.readAccount profile
media.writeMedia upload
like.read / like.writeLike / unlike
bookmark.read / bookmark.writeBookmark / unbookmark
offline.accessRefresh tokens

Auth errors

CodeMeaning
INSUFFICIENT_WALLETOnepostly prepaid wallet is empty
TOKEN_INVALID / 401Expired or invalid token → reconnect
PERMISSION_DENIED / 403Missing scope → reconnect with the required scopes

Capabilities

ActionSupportedNotes
Text postYesPOST /v1/posts
Image / video / GIFYesUpload via POST /v1/media, then mediaUrls
Thread (reply chain)Yesthread[]; media on first tweet only
QuoteYesquoteTweetId on create, or POST …/quotes
ScheduleYesscheduledFor + timezone
Remote deleteYesFull thread chain (metadata.threadIds)
InsightsYes
List commentsYes
Reply / delete replyYesOwn replies
Retweet / unretweet / listYesList can be unreliable on some tiers
Like / unlikeYesNeeds like.write
Bookmark / unbookmarkYesNeeds bookmark.write
StoriesNoRejected as unsupported

Wallet (X)

X usage is prepaid via the Onepostly wallet at X list prices — pass-through, no markup.

  • Thread publish = sum of each segment’s create cost (URL surcharge applies per segment, when X charges it)
  • Thread delete = delete cost × number of segments
  • Failed platform calls do not keep the wallet charge

Top up: Dashboard → Settings → Billing.

402 INSUFFICIENT_WALLET = Onepostly wallet is empty — top up before retrying.

Known limitations

  • Quote may fail on some X API tiers when quote is gated
  • Retweeter list can 401 intermittently; retweet count via insights shares is more reliable
  • Character limit is 280 per segment (enforced by Onepostly before calling X)
  • Engagement requires matching OAuth scopes on the current token (reconnect after scope upgrades)

See also