Account actions
Endpoints that read or change your own X account: post (also polls and scheduled tweets), reply, like, retweet, follow, mute, block, bookmarks, lists, communities, drafts, media upload, profile 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 to copy the cookie and which proxy to use: Your X session (cookie).
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; step by step: Your X session (cookie).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; some (for example the drafts, list creation and your likes) have none and return the usual wrapper. - Each call costs the same as a read call; see pricing. 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, and so is 407 (your proxy failed, with a
codesuch asPROXY_AUTH_FAILED); 422 and X's own 4xx are charged. Details: Errors.
Endpoints
- POST
/client/createPost a tweet: Post a tweet, quote tweet, long tweet, poll, 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/unlikeUnlike a tweet: Remove your like from a tweet. - POST
/client/retweetRetweet: Retweet a tweet from your account. - POST
/client/unretweetUndo a retweet: Remove your retweet of a tweet. - POST
/client/deleteTweetDelete a tweet: Delete one of your own tweets. - POST
/client/pinPin a tweet: Pin one of your own tweets to the top of your profile. - POST
/client/unpinUnpin a tweet: Remove the pinned tweet from your profile. - POST
/client/followFollow a user: Follow an account from your account. - POST
/client/unfollowUnfollow a user: Stop following an account. - POST
/client/muteMute a user: Mute an account: its posts no longer show in your timeline. - POST
/client/unmuteUnmute a user: Unmute an account you muted. - POST
/client/blockBlock a user: Block an account. - POST
/client/unblockUnblock a user: Unblock an account you blocked. - 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/bookmarks/foldersBookmark folders: The bookmark folders of your account. - POST
/client/bookmarks/folderTweets in a bookmark folder: The tweets in one of your bookmark folders. - POST
/client/bookmarks/searchSearch bookmarks: Search the tweets in your bookmarks. - POST
/client/likesYour likes: Tweets your account liked. - POST
/client/blockedBlocked accounts: Accounts your account has blocked. - POST
/client/mutedMuted accounts: Accounts your account has muted. - POST
/client/followers-you-knowFollowers you know: Followers of an account that your account follows. - 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 and get a media ID. Waits up to about 85 seconds for X to process it. - POST
/client/media/statusMedia processing status: Processing state of an uploaded video or GIF: pending, in progress, succeeded or failed. - 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/passwordChange your password: Change the password of your account. Returns the new auth_token, because X logs out every session when the password changes. - POST
/client/2fa/enableTurn on two-factor authentication: Turn on authenticator-app (TOTP) two-factor authentication for your account and get the secret, a code that works right now and the backup code back. - POST
/client/reportReport a tweet: Report a tweet and its author to X. - POST
/premium/analyticsOverviewAccount analytics overview: The account analytics overview of your X account (needs X Premium).
Lists
Create, change and delete lists of your own account and manage their members. To read a list, use the list endpoints of the API reference.
- POST
/client/lists/createCreate a list: Create a list owned by your account. - POST
/client/lists/updateUpdate a list: Change the name, description or privacy of a list you own. Fields you leave out stay as they are. - POST
/client/lists/deleteDelete a list: Delete a list you own. - POST
/client/lists/members/addAdd a list member: Add an account to a list you own. - POST
/client/lists/members/removeRemove a list member: Remove an account from a list you own.
Communities
Create or delete a community, and join or leave one with your account.
- 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
/client/communities/joinJoin a community: Join a community with your account. - POST
/client/communities/leaveLeave a community: Leave a community your account is a member of. - POST
/client/communities/membershipsYour communities: The communities your account is a member of.
Drafts
Unsent drafts of your account, as in the drafts folder on x.com.
- POST
/client/draftsList drafts: The unsent drafts of your account. - POST
/client/drafts/createCreate a draft: Save a tweet as a draft on your account without posting it. - POST
/client/drafts/editEdit a draft: Replace the text and media of a draft. - POST
/client/drafts/deleteDelete a draft: Delete one of your drafts.
Articles
X Articles (long-form posts) of your account: list, read, write, publish and delete them. X Articles need X Premium.
- POST
/client/articlesList articles: The drafts or the published articles of your account. - POST
/client/articles/getRead an article: One of your articles with its title, content, cover and state. - POST
/client/articles/createCreate an article: Save a new article as a draft. Publish it with /client/articles/publish. - POST
/client/articles/updateUpdate an article: Change the title, content or cover of an article. Fields you leave out stay as they are. - POST
/client/articles/publishPublish an article: Publish a draft article as a post on your account. - POST
/client/articles/unpublishUnpublish an article: Turn a published article back into a draft. - POST
/client/articles/deleteDelete an article: Delete one of your articles.
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/requestsList message requests: Pending message requests, including the Other folder, with their latest messages. Listing does not accept them or mark them as seen. - POST
/client/dm/requests/acceptAccept a message request: Accepts a pending one-to-one message request and sends your first reply in the same call. - POST
/client/dm/requests/declineDecline a message request: Deletes a pending message request from your inbox, like Delete on x.com. The sender is not told. - 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.