Account actions
Endpoints that read or change your own X account: post, reply, like, retweet, follow, bookmarks, media upload, profile, communities and direct messages.
Your account, your proxy, your risk.
Account actions run with the session cookie of your own X account and go out through your own proxy. Use only accounts you control and follow X's rules. Automated posting, following or liking can get the account limited or suspended; that is between you and X. Treat the cookie like a password: it gives full access to the account. Trial keys cannot call these endpoints.
How they work
- All are
POSTrequests with a JSON body. Your TwittrAPI key goes in theX-API-KEYheader as usual. cookieis the cookie header of your logged-in X session. It must containauth_tokenandct0. Copy it from your browser's developer tools while logged in to x.com.proxyis required on every call, in the formhttp://user:pass@host:port. The request to X goes out through it, so X sees your proxy's IP, not ours. Use one proxy per account and keep it stable.- There is no login endpoint. Log in on x.com yourself and pass the cookie.
- Most endpoints answer with
{"status_code": ..., "response": "..."}, whereresponseis X's body as a string. The HTTP status is X's status when X answered with an error, so a failed action is a failed request. - Add
?format=simple(or the headerX-Response-Format: simple) to get the result as compact JSON in the simple format instead: the new tweet, the user, the media ID or{"data": {"success": true}}. Each endpoint page says what it returns./premium/analyticsOverviewhas no simple format. - These calls are never retried by the gateway, because a retry could post or like twice. Each call is billed once; 400, 408 and 5xx are refunded like everywhere else, while 407 (proxy problem), 422 and X's own 4xx are charged. Details: Errors.
Endpoints
- POST
/client/createPost a tweet: Post a tweet, quote tweet, long tweet, community tweet or scheduled tweet from your account. - POST
/client/replyReply to a tweet: Reply to a tweet from your account. - POST
/client/likeLike a tweet: Like a tweet from your account. - POST
/client/retweetRetweet: Retweet a tweet from your account. - POST
/client/deleteTweetDelete a tweet: Delete one of your own tweets. - POST
/client/followFollow a user: Follow an account from your account. - POST
/client/bookmarkBookmark a tweet: Add a tweet to your bookmarks. - POST
/client/unbookmarkRemove a bookmark: Remove a tweet from your bookmarks. - POST
/client/bookmarksList bookmarks: Tweets in your bookmarks. - POST
/client/home-timelineHome timeline: The home timeline of your account. - POST
/client/schedule-overviewList scheduled tweets: Tweets scheduled on your account. - POST
/client/schedule-deleteDelete a scheduled tweet: Cancel a scheduled tweet. - POST
/client/mediaUpload an image: Upload an image and get a media ID for /client/create or /client/reply. - POST
/client/media/videoUpload a video: Upload a video in 5 MB chunks, wait for X to process it, and get a media ID. - POST
/client/profileUpdate your profile: Change the name, bio, location, website or birth date of your account. Fields you leave out stay as they are. - POST
/client/profile/imageChange your profile picture: Upload an image and set it as the profile picture of your account. - POST
/client/profile/bannerChange your header image: Upload an image and set it as the header (banner) of your account. - POST
/client/reportReport a tweet: Report a tweet and its author to X. - POST
/client/communities/createCreate a community: Create an X Community owned by your account. - POST
/client/communities/removeDelete a community: Delete a community your account owns. - POST
/premium/analyticsOverviewAccount analytics overview: The account analytics overview of your X account (needs X Premium).
Direct messages
Read and send direct messages of your own X account, with the same cookie and proxy as the other account actions. Direct messages on X are end-to-end encrypted (X Chat).
To read or send messages, the API also needs your X Chat passcode. It unlocks your account's chat keys; messages are then decrypted and encrypted on our server while your request runs. The API does not store messages or the passcode. Listing conversations, reading a conversation's settings and your DM settings work without a passcode.
Each call is one billed call like the other account actions. The answers are JSON built by the API (not the {status_code, response} wrapper); format=simple returns the same data in the simple format.
- POST
/client/dm/inboxList conversations: Your DM inbox: conversations with participants and settings, and with the passcode their latest messages. - POST
/client/dm/conversationRead a conversation: Messages of one conversation, decrypted, newest first, with a cursor for older messages. - POST
/client/dm/conversation/infoConversation details: Participants and settings of one conversation: disappearing messages, screen capture blocking, muted. No passcode needed. - POST
/client/dm/conversation/disappearingDisappearing messages: Turn disappearing messages of a conversation on, change the time, or turn them off. - POST
/client/dm/sendSend a message: Send an encrypted text message to a conversation or to a user. - POST
/client/dm/settingsDM settings: Who can message you, read receipts, the message quality filter and audio/video call settings. No passcode needed. - POST
/client/dm/settings/updateChange DM settings: Change who can message you, read receipts and call settings. Settings you leave out stay as they are.