Skip to main content
The Manage Posts endpoints let you create and delete Posts on behalf of authenticated users. Build applications that post content, create threads, or manage user Posts.

Overview

Create Post

Publish a new Post

Delete Post

Delete an existing Post

Reply

Reply to another Post

Quote

Quote another Post

Endpoints

MethodEndpointDescription
POST/2/tweetsCreate a new Post
DELETE/2/tweets/:idDelete a Post

Creating Posts

Basic Post

curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from the API!"}'
Self-serve customers: Posts created via the API are limited to a maximum of 1 cashtag per post.

Reply to a Post

curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This is a reply!",
    "reply": {
      "in_reply_to_tweet_id": "1234567890"
    }
  }'
Self-serve customers: Replies are only permitted if the original post’s author has explicitly summoned the replying account by @mentioning them or quoting one of their posts.

Quote a Post

curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Check this out!",
    "quote_tweet_id": "1234567890"
  }'

Post with media

curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Photo of the day",
    "media": {
      "media_ids": ["1234567890123456789"]
    }
  }'
Upload media first using the Media Upload endpoint, then reference the media_id in your Post.

Post with poll

curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "What is your favorite color?",
    "poll": {
      "options": ["Red", "Blue", "Green", "Yellow"],
      "duration_minutes": 1440
    }
  }'

Deleting Posts

curl -X DELETE "https://api.x.com/2/tweets/1234567890" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"
You can only delete Posts authored by the authenticated user.

Getting started

Prerequisites

Quickstart

Create your first Post

Integration guide

Key concepts and best practices

Media upload

Upload media for Posts

API Reference

Full endpoint documentation