Overview
- Introduction
- Getting started
- Tools and libraries
- Migration guide
- What to build
- Fundamentals
Posts
- Search
- Post Counts
- Filtered Stream
- Timelines
- Post Lookup
- Bookmarks
- Manage Posts
- Reposts
- Quotes
- Hide replies
Users
- User Lookup
- Search
- Follows
- Mutes
- Blocks
Direct Messages
- Manage
- Lookup
- Blocks
Likes
Lists
- Lookup Lists
- Lookup List Posts
- Manage Lists
- List Members
- Pinned Lists
Spaces
- Introduction
- Spaces Lookup
- Search Spaces
Communities
- Communities Lookup
- Search Communities
Trends
- Trends
- Personalized Trends
Media
- Introduction
- Upload
- Metadata
Compliance
- Batch Compliance
- Compliance streams
Enterprise v2
- Engagement Metrics
- Account Activity
- Webhooks
- Volume Streams
Likes Streams
Manage Posts
Creation of a Post
Causes the User to create a Post under the authorized account.
POST
/
2
/
tweets
Copy
Ask AI
curl --request POST \
--url https://api.twitter.com/2/tweets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"card_uri": "<string>",
"community_id": "1146654567674912769",
"direct_message_deep_link": "<string>",
"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",
"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"
}'
Copy
Ask AI
{
"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
The access token received from the authorization server in the OAuth 2.0 flow.
Body
application/json
Response
201
application/json
The request has succeeded.
The response is of type object
.
Copy
Ask AI
curl --request POST \
--url https://api.twitter.com/2/tweets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"card_uri": "<string>",
"community_id": "1146654567674912769",
"direct_message_deep_link": "<string>",
"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",
"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"
}'
Copy
Ask AI
{
"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>"
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.