X Write

Create tweet

post/x/tweets

Request body

accountstring required

X account (@username or account ID)

textstring

Tweet text (optional when media is provided)

reply_to_tweet_idstring
attachment_urlstring
community_idstring
is_note_tweetboolean
mediastring[]

Array of public media URLs to attach. Supports up to 4 images or exactly 1 MP4 video up to 100 MB. Each URL must be publicly reachable. Attached media adds 2 credits per started MB across all files.

Example request

{
  "account": "@elonmusk",
  "text": "Just launched our new feature!",
  "reply_to_tweet_id": "1234567890",
  "attachment_url": "https://x.com/elonmusk/status/1234567890",
  "community_id": "1500000000000000000",
  "media": [
    "https://example.com/video.mp4"
  ]
}

Response

Tweet created

tweetIdstring required
successtrue required
chargedboolean required
chargedCreditsstring required

Credits charged for this tweet. Text-only tweets and replies cost 30 credits; attached media adds 2 credits per started MB.

writeActionIdstring

Example response

{
  "tweetId": "1234567890",
  "success": true,
  "charged": true,
  "chargedCredits": "32",
  "writeActionId": "42"
}

Changes