# PostEverywhere X (Twitter) API Guide > Twitter post API for X: publish and schedule tweets and threads via REST. Reply permissions, alt text, and auto first comments. **Source:** https://posteverywhere.ai/docs/platforms/x-twitter **Section:** Platforms **API reference:** https://posteverywhere.ai/docs/api/reference --- Publish tweets, image posts, video posts, and multi-tweet threads to X (formerly Twitter). PostEverywhere handles [media uploads](/docs/api/init-media-upload), reply settings, and thread composition through a single API call. For a general overview of all supported platforms, see the [Introduction](/docs). ## Connect your X (Twitter) account to PostEverywhere Connect X (Twitter) from the dashboard with OAuth, or headlessly from code: mint a [connect link](/docs/api/create-connect-link) and hand it to the account owner - no dashboard session needed. Both flows are covered in [Connecting Accounts](/docs/connecting-accounts). ## What you can post to X (Twitter) | Content Type | Media Required | Description | |-------------|---------------|-------------| | **Text post** | None | Standard tweet, up to 280 characters. | | **Image post** | Image(s) | Tweet with up to 4 attached images. | | **Video post** | Video (MP4) | Tweet with a single video attachment. | | **Thread** | Optional | Multi-tweet thread using the `threadPosts` parameter. | ## X (Twitter)-specific options in the API Use the `platform_content.x` object to customise your tweet: ```json { "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 | Setting | Type | Default | Description | |---------|------|---------|-------------| | `content` | string | N/A | Override the default text. Max 280 characters. | | `settings.replySettings` | string | `"everyone"` | Who can reply to this tweet. See values below. | | `settings.mediaAltText` | string | N/A | Accessibility description for attached images. Max 1,000 characters. | | `settings.firstComment` | string | N/A | Text posted as a reply to your tweet immediately after publishing. | ### Reply Settings | Value | Description | |-------|-------------| | `everyone` | Anyone can reply. | | `following` | Only accounts you follow can reply. | | `mentionedUsers` | Only users mentioned in the tweet can reply. | ## Publish to X (Twitter): a working request ### Schedule a Tweet with an Image ```bash 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_for": "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 ```bash 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 all top platforms from one endpoint.\n\n7-day trial, cancel anytime.", "settings": { "firstComment": "Full docs: https://posteverywhere.ai/docs\n\nNode.js SDK: npm install @posteverywhere/sdk" } } } }' ``` ## Publishing a thread to X (Twitter) 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: ```bash 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_for": "2026-04-15T15:00:00Z", "timezone": "UTC", "threadPosts": [ "1/ Focus on one metric at a time. Spreading attention across 10 dashboards means you optimize nothing.", "2/ Ship weekly. Monthly releases create anxiety. Weekly releases create momentum.", "3/ Talk to customers before writing code. 80% of our best features came from support tickets.", "4/ Delete more than you add. We removed 3 features this quarter and NPS went up.", "5/ Document decisions, not just outcomes. Future-you will thank present-you.\n\nWhat would you add to this list?" ] }' ``` ## X (Twitter) limits: characters, media and video | Requirement | Limit | |-------------|-------| | Tweet text length | 280 characters | | Alt text length | 1,000 characters | | Images per tweet | Up to 4 | | Image formats | JPEG, PNG, WebP, GIF | | Image max file size | 5 MB (X limit) | | GIF max file size | 15 MB | | Video format | MP4 (H.264) | | Video max file size | 500 MB | | Video duration | Up to 2 minutes 20 seconds | | Thread length | No hard limit (practical limit ~25 tweets) | | X posting caps | Fixed caps enforced when a post publishes to X, independent of your plan: 100 per hour and 500 per day per organization, and 50 per 15 minutes per account. See [rate limits](/docs/rate-limits) for the API request limits. | ## Getting better results on X (Twitter) - **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 X's posting caps.** Publishing to X is capped at 500 posts per day and 100 per hour per organization; the caps are fixed, not plan-based. Spread scheduled posts across the day to stay under them. ## Common questions about posting to X (Twitter) ### How do I create a Twitter thread via the API? Use the `threadPosts` array at the top level of your [Create Post](/docs/api/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](/docs/api/init-media-upload) 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? Publishing to X has fixed caps that do not depend on your plan: 100 posts per hour and 500 per day per organization, and 50 per 15 minutes per account. Spread scheduled posts across the day to stay under them. See [Rate Limits](/docs/rate-limits) for the API request limits. ### Can I edit a tweet after it's published? X allows post owners to edit tweets in their own UI for a limited window (the "Edit tweet" feature on Premium), but their API does not expose tweet editing to third-party tools. `PATCH /v1/posts/:id` only accepts posts in `scheduled` or `draft` status: once a tweet publishes, our API returns `400 invalid_post_status`. To change a tweet's text, delete it (in X) and recreate via the API. ## Other platforms you can publish to - **[Threads](/docs/platforms/threads)** -- short-form text posts with a similar conversational style - **[LinkedIn](/docs/platforms/linkedin)** -- professional text posts and thought leadership - **[Facebook](/docs/platforms/facebook)** -- cross-post announcements and link shares ## Related X (Twitter) and API reference pages - [API Reference -- Create Post](/docs/api/create-post) - [Upload Media](/docs/api/init-media-upload) - [Quick Start Guide](/docs/quick-start) - [X (Twitter) Scheduler on PostEverywhere](https://posteverywhere.ai/x-scheduler) **Related:** [X media requirements](/docs/media-requirements) · [testing posts safely](/docs/testing) · [scheduling X posts with an API](/blog/schedule-x-twitter-posts-api) · [what the X API costs directly](/blog/x-twitter-api-pricing) · [social media API for developers](/social-media-api)