Docs
Post a tweet

Post a tweet

Post a tweet, quote tweet, long tweet, community tweet or scheduled tweet from your account.

POST/client/create

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.

Parameters

  • cookiebody · string · required

    Cookie header of your own logged-in X session. Must contain auth_token and ct0; guest_id is used when present.

  • proxybody · string · required

    Your proxy, format http://user:pass@host:port. The requests to X go out through it. Used only for this request.

  • textbody · string · required

    Tweet text. Over 280 characters it is sent as a long post (note tweet).

  • media_idsbody · string[] · optional

    Media IDs from /client/media or /client/media/video.

  • possibly_sensitivebody · boolean · optional · default false

    Mark the media as sensitive.

  • conversation_control_modebody · string · optional

    Who can reply: only_follows, only_verified or only_mentioned. Not used for community tweets.

  • quote_urlbody · string · optional

    URL of a tweet to quote.

  • community_idbody · string · optional

    Post into this community.

  • is_note_tweetbody · boolean · optional · default false

    Force a long post even for short text.

  • schedule_timebody · integer · optional

    Unix time in seconds. When set, the tweet is scheduled instead of posted; only text and media are used.

Body parameters are sent as a JSON object with Content-Type: application/json.

Example request

curl -X POST 'https://api.twittrapi.com/client/create' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"cookie":"auth_token=...; ct0=...","proxy":"http://user:pass@host:port","text":"Hello from the API"}'

Base URL https://api.twittrapi.com, key in the X-API-KEY header. The SDKs do not wrap account actions, so the examples are plain HTTP calls.

Response

Wrapper built by the API: {"status_code": <X status>, "response": "<X response body as a string>"}. The HTTP status is X's status when X answered 4xx or 5xx, otherwise 200. Parse response a second time to get X's JSON.

Simple format (?format=simple or X-Response-Format: simple): {data: Tweet}: the tweet you just posted. With schedule_time: {data: {success: true, scheduledTweetId}}. When X reports an error inside the wrapper (for example a tweet that is already liked), the usual wrapper is returned unchanged. Schema.

{
  "status_code": 200,
  "response": "{\"data\":{\"create_tweet\":{\"tweet_results\":{\"result\":{\"__typename\":\"Tweet\",\"card\":{\"legacy\":{\"binding_values\":[{\"key\":\"photo_image_full_size_large\",\"value\":{\"image_value\":{\"height\":419,\"url\":\"https://pbs.twimg.com/card_img/2107952823128182784/RyT0hE6P?format=jpg&name=800x419\",\"width\":800},\"type\":\"IMAGE\"}},{\"key\":\"thumbnail_image\",\"value\":{\"image_value\":{\"height\":150,\"url\":\"https://pbs.twimg.com/card_img/2107952823128182784/RyT0hE6P?format=jpg&name=280x150\",\"width\":218},\"type\":\"IMAGE\"}},{\"key\":\"description\",\"value\":{\"string_value\":\"Use the X API with an all-new Developer Console and consumption-based billing. No fixed monthly costs, no monthly caps.\",\"type\":\"STRING\"}}],\"card_platform\":{\"platform\":{\"audience\":{\"name\":\"production\"},\"device\":{\"name\":\"Swift\",\"version\":\"12\"}}},\"name\":\"summary_large_image\",\"url\":\"https://t.co/FS66GuIYJD\",\"user_refs_results\":[]},\"rest_id\":\"https://t.co/FS66GuIYJD\"},\"core\":{\"user_results\":{\"result\":{\"__typename\":\"User\",\"affiliates_highlighted_label\":{\"label\":{\"badge\":{\"url\":\"https://pbs.twimg.com/profile_images/1955359038532653056/OSHY3ewP_bigger.jpg\"},\"description\":\"X\",\"url\":{\"url\":\"https://twitter.com/X\",\"urlType\":\"DeepLink\"},\"userLabelDisplayType\":\"Badge\",\"userLabelType\":\"BusinessLabel\"}},\"has_graduated_access\":true,\"id\":\"VXNlcjoyMjQ0OTk0OTQ1\",\"is_blue_verified\":true,\"legacy\":{\"blocked_by\":false,\"blocking\":false,\"can_dm\":true,\"can_media_tag\":true,\"created_at\":\"Sat Dec 14 04:35:55 +0000 2013\",\"default_profile\":false,\"default_profile_image\":false,\"description\":\"The voice of the X Dev team and your official source for updates, news, and events, related to the X API.\",\"entities\":{\"description\":{},\"url\":{\"urls\":[{\"display_url\":\"docs.x.com\",\"expanded_url\":\"https://docs.x.com/\",\"indices\":[0,23],\"url\":\"https://t.co/NIwHVIVyrN\"}]}},\"fast_followers_count\":0,\"favourites_count\":2758,\"follow_request_sent\":false,\"followed_by\":false,\"followers_count\":698074,\"following\":false,\"friends_count\":770,\"has_custom_timelines\":true,\"is_translator\":false,\"listed_count\":2977,\"location\":\"127.0.0.1\",\"media_count\":832,\"muting\":false,\"name\":\"Developers\",\"needs_phone_verification\":false,\"normal_followers_count\":698074,\"notifications\":false,\"pinned_tweet_ids_str\":[\"2019881223666233717\"],\"possibly_sensitive\":false,\"profile_banner_url\":\"https://pbs.twimg.com/profile_banners/2244994945/1690213128\",\"profile_image_url_https\":\"https://pbs.twimg.com/profile_images/1683501992314798080/xl1POYLw_normal.jpg\",\"profile_interstitial_type\":\"\",\"protected\":false,\"screen_name\":\"XDevelopers\",\"statuses_count\":4376,\"time_zone\":\"\",\"translator_type\":\"regular\",\"url\":\"https://t.co/NIwHVIVyrN\",\"utc_offset\":0,\"verified\":false,\"verified_type\":\"Business\",\"want_retweets\":false,\"withheld_description\":\"\",\"withheld_scope\":\"\"},\"parody_commentary_fan_label\":\"None\",\"professional\":{\"category\":[{\"icon_name\":\"IconBriefcaseStroke\",\"id\":1009,\"name\":\"Community\"}],\"professional_type\":\"Business\",\"rest_id\":\"1516891231749517312\"},\"profile_image_shape\":\"Square\",\"rest_id\":\"2244994945\",\"super_follow_eligible\":false,\"super_followed_by\":false,\"super_following\":false,\"tipjar_settings\":{}}}},\"edit_control\":{\"edit_tweet_ids\":[\"2019881223666233717\"],\"editable_until_msecs\":\"1770415785000\",\"edits_remaining\":\"5\",\"is_edit_eligible\":false},\"grok_analysis_button\":true,\"is_translatable\":false,\"legacy\":{\"bookmark_count\":2803,\"bookmarked\":false,\"conversation_id_str\":\"2019881223666233717\",\"created_at\":\"Fri Feb 06 21:09:45 +0000 2026\",\"display_text_range\":[0,261],\"entities\":{\"urls\":[{\"display_url\":\"developer.x.com\",\"expanded_url\":\"http://developer.x.com\",\"indices\":[238,261],\"url\":\"https://t.co/FS66GuIYJD\"}]},\"favorite_count\":5599,\"favorited\":false,\"full_text\":\"Officially launching X API Pay-Per-Use\\n\\nThe core of X developers are indie builders, early stage products, startups, and hobbyists\\n\\nIt’s time to open up our X API ecosystem and instill a new wave of next generation X apps\\n\\nWe’re so back. https://t.co/FS66GuIYJD\",\"id_str\":\"2019881223666233717\",\"is_quote_status\":false,\"lang\":\"en\",\"possibly_sensitive\":false,\"possibly_sensitive_editable\":true,\"quote_count\":596,\"reply_count\":791,\"retweet_count\":896,\"retweeted\":false,\"user_id_str\":\"2244994945\"},\"rest_id\":\"2019881223666233717\",\"unmention_data\":{},\"views\":{\"count\":\"2552260\",\"state\":\"EnabledWithCount\"}}}}}}"
}

In the raw format, field names and nesting come from X and can change without notice. See Response format; the simple format keeps a fixed schema.

Errors

  • 400The body is not valid JSON.
  • 422A required field is missing (including proxy), an ID is not numeric, or the cookie has no ct0. Also: the account is suspended, X rejected the session, or the text was already posted.
  • 407The proxy is unreachable or timed out.
  • X'sAny status X answers with (for example 401, 403, 404): passed through with X's body.

Errors every endpoint can return (401, 402, 403, 404, 408, 409, 429, 5xx), and which of them are charged, are on the Errors page. Calls that fail with 400, 408, 409 or a 5xx error are refunded.