Skip to main content
POST
/
2
/
tweets
Create or Edit Post
curl --request POST \
  --url https://api.x.com/2/tweets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "card_uri": "<string>",
  "community_id": "1146654567674912769",
  "direct_message_deep_link": "<string>",
  "edit_options": {
    "previous_post_id": "1346889436626259968"
  },
  "for_super_followers_only": false,
  "geo": {
    "place_id": "<string>"
  },
  "media": {
    "media_ids": [
      "1146654567674912769"
    ],
    "tagged_user_ids": [
      "2244994945"
    ]
  },
  "nullcast": false,
  "poll": {
    "duration_minutes": 5042,
    "options": [
      "<string>"
    ],
    "reply_settings": "following"
  },
  "quote_tweet_id": "1346889436626259968",
  "reply": {
    "exclude_reply_user_ids": [
      "2244994945"
    ],
    "in_reply_to_tweet_id": "1346889436626259968"
  },
  "reply_settings": "following",
  "share_with_followers": false,
  "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
}'
{
  "data": {
    "id": "1346889436626259968",
    "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the X API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i"
  },
  "errors": [
    {
      "detail": "<string>",
      "status": 123,
      "title": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Body

application/json
card_uri
string
community_id
string
Example:
edit_options
object
for_super_followers_only
boolean
default:false
geo
object
media
object
nullcast
boolean
default:false
poll
object
quote_tweet_id
string
Example:
reply
object
reply_settings
enum<string>
Available options:
following,
mentionedUsers,
subscribers,
verified
share_with_followers
boolean
default:false
text
string
Example:

Response

data
object
errors
object[]
Minimum length: 1