Skip to main content

X (Twitter) API Guide

Publish tweets, image posts, video posts, and multi-tweet threads to X (formerly Twitter). PostEverywhere handles media uploads, reply settings, and thread composition through a single API call. For a general overview of all supported platforms, see the Introduction.

Supported Content Types

Content TypeMedia RequiredDescription
Text postNoneStandard tweet, up to 280 characters.
Image postImage(s)Tweet with up to 4 attached images.
Video postVideo (MP4)Tweet with a single video attachment.
ThreadOptionalMulti-tweet thread using the threadPosts parameter.

Platform-Specific Settings

Use the platform_content.x object to customise your tweet:

{
"platform_content": {
"x": {
"content": "Tweet text (max 280 chars)",
"settings": {
"replySettings": "everyone",
"mediaAltText": "Image description for accessibility",
"firstComment": "Reply text posted as first reply"
}
}
}
}

Settings Reference

SettingTypeDefaultDescription
contentstringOverride the default text. Max 280 characters.
settings.replySettingsstring"everyone"Who can reply to this tweet. See values below.
settings.mediaAltTextstringAccessibility description for attached images. Max 1,000 characters.
settings.firstCommentstringText posted as a reply to your tweet immediately after publishing.

Reply Settings

ValueDescription
everyoneAnyone can reply.
followingOnly accounts you follow can reply.
mentionedUsersOnly users mentioned in the tweet can reply.

Example: Create a Post

Schedule a Tweet with an Image

curl -X POST https://app.posteverywhere.ai/api/v1/posts \
-H "Authorization: Bearer $POSTEVERYWHERE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Default text for other platforms",
"account_ids": [2270],
"media_ids": ["b8c9d0e1-f2a3-4567-8901-bcdef0123456"],
"scheduled_at": "2026-04-15T13:00:00Z",
"timezone": "America/New_York",
"platform_content": {
"x": {
"content": "We just shipped something big.\n\nDetails in the thread below 👇",
"settings": {
"replySettings": "everyone",
"mediaAltText": "Screenshot of the new dashboard feature showing real-time analytics"
}
}
}
}'

Schedule a Tweet with a First Reply

curl -X POST https://app.posteverywhere.ai/api/v1/posts \
-H "Authorization: Bearer $POSTEVERYWHERE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Launching our new API today.",
"account_ids": [2270],
"platform_content": {
"x": {
"content": "We just launched our public API.\n\nSchedule posts to 8 platforms from one endpoint.\n\nFree 14-day trial, no credit card required.",
"settings": {
"firstComment": "Full docs: https://developers.posteverywhere.ai\n\nNode.js SDK: npm install posteverywhere"
}
}
}
}'

Threads

To create a multi-tweet thread, use the threadPosts array at the top level of your request (not inside platform_content). Each entry becomes a separate tweet in the thread:

curl -X POST https://app.posteverywhere.ai/api/v1/posts \
-H "Authorization: Bearer $POSTEVERYWHERE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Here are 5 things I learned this quarter:",
"account_ids": [2270],
"scheduled_at": "2026-04-15T15:00:00Z",
"timezone": "UTC",
"threadPosts": [
{ "content": "1/ Focus on one metric at a time. Spreading attention across 10 dashboards means you optimize nothing." },
{ "content": "2/ Ship weekly. Monthly releases create anxiety. Weekly releases create momentum." },
{ "content": "3/ Talk to customers before writing code. 80% of our best features came from support tickets." },
{ "content": "4/ Delete more than you add. We removed 3 features this quarter and NPS went up." },
{ "content": "5/ Document decisions, not just outcomes. Future-you will thank present-you.\n\nWhat would you add to this list?" }
]
}'

Requirements & Limits

RequirementLimit
Tweet text length280 characters
Alt text length1,000 characters
Images per tweetUp to 4
Image formatsJPEG, PNG, WebP, GIF
Image max file size20 MB
GIF max file size15 MB
Video formatMP4 (H.264)
Video max file size500 MB
Video durationUp to 2 minutes 20 seconds
Thread lengthNo hard limit (practical limit ~25 tweets)
X daily posting limitVaries by plan (Trial: 10, Starter: 50, Growth: 150, Pro: 500)

Tips

  • Use firstComment to add links. Tweets with links get less algorithmic reach on X. Post the tweet without a link, then use firstComment to reply with the URL. Your followers still see the link, but the original tweet gets better distribution.
  • Always add mediaAltText for images. Alt text improves accessibility and can boost search visibility. X supports up to 1,000 characters per image — use it to describe what is in the image for screen reader users.
  • Mind the daily posting limits. X imposes per-day posting limits that vary by your PostEverywhere plan. Check the limits above and spread your scheduled posts across the day to avoid hitting the cap.

Frequently Asked Questions

How do I create a Twitter thread via the API?

Use the threadPosts array at the top level of your Create Post request. Each entry in the array becomes a separate tweet in the thread. The main content field is the first tweet, and threadPosts contains the replies. There is no hard limit, but threads beyond 25 tweets are impractical.

Can I attach multiple images to a single tweet?

Yes. Include up to 4 media_ids in your post request. Upload each image first using the Upload Media endpoint, then pass all returned media IDs in the media_ids array. Note that you cannot mix images and video in a single tweet.

How do I restrict who can reply to my tweet?

Set settings.replySettings in the platform_content.x object. Options are "everyone" (default), "following" (only accounts you follow), or "mentionedUsers" (only accounts mentioned in the tweet).

What are the daily posting limits on X?

X imposes per-day posting limits that vary by your PostEverywhere subscription plan: Trial has 10 posts/day, Starter has 50, Growth has 150, and Pro has 500. Spread your scheduled posts across the day to avoid hitting the cap. Check Rate Limits for API request limits.

  • Threads -- short-form text posts with a similar conversational style
  • LinkedIn -- professional text posts and thought leadership
  • Facebook -- cross-post announcements and link shares

Further Reading