# Ayrshare Post To X

Blocks for posting tweets and threads to X (Twitter) using the Ayrshare social media management API.

## Post To X

### What it is

Post to X / Twitter using Ayrshare

### How it works

This block uses Ayrshare's API to publish content to X (formerly Twitter). It supports standard tweets (280 characters, or 25,000 for Premium users), threads, polls, quote tweets, and replies, with up to 4 media attachments including video with subtitles.

The block authenticates through Ayrshare and handles X-specific features like automatic thread breaking using double newlines, thread numbering, per-post media attachments, and long-form video uploads (with approval). Poll options and duration can be configured for engagement posts.

### Inputs

| Input               | Description                                                                                                              | Type            | Required |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ | --------------- | -------- |
| post                | The post text (max 280 chars, up to 25,000 for Premium users). Use @handle to mention users. Use \n\n for thread breaks. | str             | Yes      |
| media\_urls         | Optional list of media URLs. X supports up to 4 images or videos per tweet. Auto-preview links unless media is included. | List\[str]      | No       |
| is\_video           | Whether the media is a video                                                                                             | bool            | No       |
| schedule\_date      | UTC datetime for scheduling (YYYY-MM-DDThh:mm:ssZ)                                                                       | str (date-time) | No       |
| disable\_comments   | Whether to disable comments                                                                                              | bool            | No       |
| shorten\_links      | Whether to shorten links                                                                                                 | bool            | No       |
| unsplash            | Unsplash image configuration                                                                                             | str             | No       |
| requires\_approval  | Whether to enable approval workflow                                                                                      | bool            | No       |
| random\_post        | Whether to generate random post text                                                                                     | bool            | No       |
| random\_media\_url  | Whether to generate random media                                                                                         | bool            | No       |
| notes               | Additional notes for the post                                                                                            | str             | No       |
| reply\_to\_id       | ID of the tweet to reply to                                                                                              | str             | No       |
| quote\_tweet\_id    | ID of the tweet to quote (low-level Tweet ID)                                                                            | str             | No       |
| poll\_options       | Poll options (2-4 choices)                                                                                               | List\[str]      | No       |
| poll\_duration      | Poll duration in minutes (1-10080)                                                                                       | int             | No       |
| alt\_text           | Alt text for each image (max 1,000 chars each, not supported for videos)                                                 | List\[str]      | No       |
| is\_thread          | Whether to automatically break post into thread based on line breaks                                                     | bool            | No       |
| thread\_number      | Add thread numbers (1/n format) to each thread post                                                                      | bool            | No       |
| thread\_media\_urls | Media URLs for thread posts (one per thread, use 'null' to skip)                                                         | List\[str]      | No       |
| long\_post          | Force long form post (requires Premium X account)                                                                        | bool            | No       |
| long\_video         | Enable long video upload (requires approval and Business/Enterprise plan)                                                | bool            | No       |
| subtitle\_url       | URL to SRT subtitle file for videos (must be HTTPS and end in .srt)                                                      | str             | No       |
| subtitle\_language  | Language code for subtitles (default: 'en')                                                                              | str             | No       |
| subtitle\_name      | Name of caption track (max 150 chars, default: 'English')                                                                | str             | No       |

### Outputs

| Output       | Description                           | Type         |
| ------------ | ------------------------------------- | ------------ |
| error        | Error message if the operation failed | str          |
| post\_result | The result of the post                | PostResponse |
| post         | The result of the post                | PostIds      |

### Possible use case

**Thread Publishing**: Automatically format and publish long-form content as numbered thread sequences.

**Engagement Polls**: Create polls to gather audience feedback or drive interaction with scheduled posting.

**Reply Automation**: Build workflows that automatically respond to mentions or engage in conversations.

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://agpt.co/docs/integrations/block-integrations/post_to_x.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
