# Account actions

Endpoints that read or change your own X account: post, reply, like, retweet, follow, bookmarks, media upload, profile, communities and direct messages.

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. Treat the cookie like a password. Trial keys cannot call these endpoints.

- All are POST requests with a JSON body. Your TwittrAPI key goes in the X-API-KEY header as usual.
- `cookie` is the cookie header of your logged-in X session. It must contain `auth_token` and `ct0`.
- `proxy` is required on every call, in the form `http://user:pass@host:port`. The request to X goes out through it.
- There is no login endpoint. Log in on x.com yourself and pass the cookie.
- Most endpoints answer with `{"status_code": ..., "response": "..."}`, where `response` is X's body as a string. The HTTP status is X's status when X answered with an error.
- Add `format=simple` (or the header `X-Response-Format: simple`) to get the result in the simple format: the new tweet, the user, the media ID or `{"data": {"success": true}}`. Each endpoint says what it returns; `/premium/analyticsOverview` has no simple format.
- These calls are never retried by the gateway, because a retry could post or like twice. 400, 408 and 5xx are refunded like everywhere else; 407 (proxy problem), 422 and X's own 4xx are charged.

## Endpoints

- [POST /client/create](https://www.twittrapi.com/docs/account-actions/client-create.md): Post a tweet. Post a tweet, quote tweet, long tweet, community tweet or scheduled tweet from your account.
- [POST /client/reply](https://www.twittrapi.com/docs/account-actions/client-reply.md): Reply to a tweet. Reply to a tweet from your account.
- [POST /client/like](https://www.twittrapi.com/docs/account-actions/client-like.md): Like a tweet. Like a tweet from your account.
- [POST /client/retweet](https://www.twittrapi.com/docs/account-actions/client-retweet.md): Retweet. Retweet a tweet from your account.
- [POST /client/deleteTweet](https://www.twittrapi.com/docs/account-actions/client-deletetweet.md): Delete a tweet. Delete one of your own tweets.
- [POST /client/follow](https://www.twittrapi.com/docs/account-actions/client-follow.md): Follow a user. Follow an account from your account.
- [POST /client/bookmark](https://www.twittrapi.com/docs/account-actions/client-bookmark.md): Bookmark a tweet. Add a tweet to your bookmarks.
- [POST /client/unbookmark](https://www.twittrapi.com/docs/account-actions/client-unbookmark.md): Remove a bookmark. Remove a tweet from your bookmarks.
- [POST /client/bookmarks](https://www.twittrapi.com/docs/account-actions/client-bookmarks.md): List bookmarks. Tweets in your bookmarks.
- [POST /client/home-timeline](https://www.twittrapi.com/docs/account-actions/client-home-timeline.md): Home timeline. The home timeline of your account.
- [POST /client/schedule-overview](https://www.twittrapi.com/docs/account-actions/client-schedule-overview.md): List scheduled tweets. Tweets scheduled on your account.
- [POST /client/schedule-delete](https://www.twittrapi.com/docs/account-actions/client-schedule-delete.md): Delete a scheduled tweet. Cancel a scheduled tweet.
- [POST /client/media](https://www.twittrapi.com/docs/account-actions/client-media.md): Upload an image. Upload an image and get a media ID for /client/create or /client/reply.
- [POST /client/media/video](https://www.twittrapi.com/docs/account-actions/client-media-video.md): Upload a video. Upload a video in 5 MB chunks, wait for X to process it, and get a media ID.
- [POST /client/profile](https://www.twittrapi.com/docs/account-actions/client-profile.md): Update 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/image](https://www.twittrapi.com/docs/account-actions/client-profile-image.md): Change your profile picture. Upload an image and set it as the profile picture of your account.
- [POST /client/profile/banner](https://www.twittrapi.com/docs/account-actions/client-profile-banner.md): Change your header image. Upload an image and set it as the header (banner) of your account.
- [POST /client/report](https://www.twittrapi.com/docs/account-actions/client-report.md): Report a tweet. Report a tweet and its author to X.
- [POST /client/communities/create](https://www.twittrapi.com/docs/account-actions/client-communities-create.md): Create a community. Create an X Community owned by your account.
- [POST /client/communities/remove](https://www.twittrapi.com/docs/account-actions/client-communities-remove.md): Delete a community. Delete a community your account owns.
- [POST /premium/analyticsOverview](https://www.twittrapi.com/docs/account-actions/premium-analyticsoverview.md): Account 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/inbox](https://www.twittrapi.com/docs/account-actions/client-dm-inbox.md): List conversations. Your DM inbox: conversations with participants and settings, and with the passcode their latest messages.
- [POST /client/dm/conversation](https://www.twittrapi.com/docs/account-actions/client-dm-conversation.md): Read a conversation. Messages of one conversation, decrypted, newest first, with a cursor for older messages.
- [POST /client/dm/conversation/info](https://www.twittrapi.com/docs/account-actions/client-dm-conversation-info.md): Conversation details. Participants and settings of one conversation: disappearing messages, screen capture blocking, muted. No passcode needed.
- [POST /client/dm/conversation/disappearing](https://www.twittrapi.com/docs/account-actions/client-dm-conversation-disappearing.md): Disappearing messages. Turn disappearing messages of a conversation on, change the time, or turn them off.
- [POST /client/dm/send](https://www.twittrapi.com/docs/account-actions/client-dm-send.md): Send a message. Send an encrypted text message to a conversation or to a user.
- [POST /client/dm/settings](https://www.twittrapi.com/docs/account-actions/client-dm-settings.md): DM settings. Who can message you, read receipts, the message quality filter and audio/video call settings. No passcode needed.
- [POST /client/dm/settings/update](https://www.twittrapi.com/docs/account-actions/client-dm-settings-update.md): Change DM settings. Change who can message you, read receipts and call settings. Settings you leave out stay as they are.
