Post a Tweet
Publish a tweet — plain text, reply, quote, poll, or with media — on behalf of the authenticated source user. Also supports editing an existing tweet within X’s edit window.
POST /2/tweets endpoint, routed through the AIsa gateway at https://api.aisa.one/apis/v1/twitter/post_twitter.
One endpoint covers every variant:
Plain text
{ "text": "Hello, World!" }Reply
reply.in_reply_to_tweet_id.Quote tweet
quote_tweet_id.With a poll
poll.options + poll.duration_minutes.With media
media.media_ids (1–4 IDs).Edit a tweet
edit_options.previous_post_id (within X’s edit window).Prerequisites
- An AIsa API key (Bearer token for every request).
- A one-time OAuth authorization for the source user account. Link your X account by calling
POST /apis/v1/twitter/auth_twitter— AIsa stores the session against your API key and uses it automatically on every write call. - The X session must hold
tweet.read,tweet.write,users.read.
Mutually exclusive fields
At most one of these may appear in a single request:mediapollquote_tweet_idcard_uri
400 invalid-request) if more than one is set.
Response
On success the endpoint returns201 Created:
text reflects what X actually stored (e.g., shortened URLs). Use data.id to reference this tweet in subsequent calls (reply, quote, like, edit, delete).
Editing tweets
Passedit_options.previous_post_id to edit an existing tweet instead of creating a new one. Edits are subject to X’s edit window and edit count limits; the endpoint returns 409 conflict if the window has passed or the edit quota is exhausted.
Reply settings
Restrict who can reply withreply_settings:
| Value | Who can reply |
|---|---|
following | People you follow |
mentionedUsers | Users explicitly mentioned in the tweet |
subscribers | Your X Premium subscribers |
verified | Verified accounts |
Common 4xx causes
400 invalid-request— set two mutually-exclusive fields, text too long, invalid poll duration, etc.403 client-forbidden— OAuth session missing thetweet.writescope. Re-link viaauth_twitter.404 resource-not-found— referencedin_reply_to_tweet_id,quote_tweet_id, orprevious_post_iddoesn’t exist or isn’t visible to the source user.409 conflict— duplicate content, or edit outside the allowed window.
Related
Link an X Account
Follow a User
Twitter Autopilot skill
Authorizations
Your AIsa API key. The authenticated source user (the account doing the follow) is determined by the OAuth session attached to your key.
Body
The content of the tweet. Optional when posting media, a poll, or a quote tweet; required otherwise.
"Hello from AIsa — shipping agent-friendly Twitter APIs."
Post as a reply to another tweet.
Tweet ID to quote. Mutually exclusive with media, poll, and card_uri.
^[0-9]{1,19}$Attach media. Mutually exclusive with poll, quote_tweet_id, and card_uri.
Attach a poll. Mutually exclusive with media, quote_tweet_id, and card_uri.
Card URI. Mutually exclusive with media, poll, quote_tweet_id, and direct_message_deep_link.
Deep link that takes the conversation into a private DM.
Attach a place to the tweet.
Who is allowed to reply.
following, mentionedUsers, subscribers, verified Only visible to super followers.
Nullcast (promoted-only) tweet — not shown in the public timeline or to followers.
Marks the tweet as a paid partnership.
Flags the tweet as containing AI-generated media.
Post into the specified community.
^[0-9]{1,19}$Also share the community post with your followers.
Edit an existing tweet instead of creating a new one (subject to X's edit window).
Response
Tweet created (or edited) successfully.