Skip to main content
POST
/
twitter
/
post_twitter
curl --request POST \
  --url https://api.aisa.one/apis/v1/twitter/post_twitter \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "Hello, World!"
}
'
{
  "data": {
    "id": "1346889436626259968",
    "text": "Hello, World!"
  }
}
Publish a tweet on behalf of the authenticated source user. Proxies the official X v2 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

Set reply.in_reply_to_tweet_id.

Quote tweet

Set quote_tweet_id.

With a poll

Set poll.options + poll.duration_minutes.

With media

Set media.media_ids (1–4 IDs).

Edit a tweet

Set 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:
  • media
  • poll
  • quote_tweet_id
  • card_uri
X will reject the request (400 invalid-request) if more than one is set.

Response

On success the endpoint returns 201 Created:
{
  "data": {
    "id": "1346889436626259968",
    "text": "Hello, World!"
  }
}
The returned 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

Pass edit_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 with reply_settings:
ValueWho can reply
followingPeople you follow
mentionedUsersUsers explicitly mentioned in the tweet
subscribersYour X Premium subscribers
verifiedVerified accounts
Omit the field for the default (everyone).

Common 4xx causes

  • 400 invalid-request — set two mutually-exclusive fields, text too long, invalid poll duration, etc.
  • 403 client-forbidden — OAuth session missing the tweet.write scope. Re-link via auth_twitter.
  • 404 resource-not-found — referenced in_reply_to_tweet_id, quote_tweet_id, or previous_post_id doesn’t exist or isn’t visible to the source user.
  • 409 conflict — duplicate content, or edit outside the allowed window.
See the full list on Error Codes and Rate Limits for tier caps.

Link an X Account

Start the OAuth flow this endpoint requires.

Follow a User

Another write endpoint using the same OAuth session.

Twitter Autopilot skill

Agent skill that wraps the full Twitter surface.

Authorizations

Authorization
string
header
required

Your AIsa API key. The authenticated source user (the account doing the follow) is determined by the OAuth session attached to your key.

Body

application/json
text
string

The content of the tweet. Optional when posting media, a poll, or a quote tweet; required otherwise.

Example:

"Hello from AIsa — shipping agent-friendly Twitter APIs."

reply
object

Post as a reply to another tweet.

quote_tweet_id
string

Tweet ID to quote. Mutually exclusive with media, poll, and card_uri.

Pattern: ^[0-9]{1,19}$
media
object

Attach media. Mutually exclusive with poll, quote_tweet_id, and card_uri.

poll
object

Attach a poll. Mutually exclusive with media, quote_tweet_id, and card_uri.

card_uri
string

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.

geo
object

Attach a place to the tweet.

reply_settings
enum<string>

Who is allowed to reply.

Available options:
following,
mentionedUsers,
subscribers,
verified
for_super_followers_only
boolean
default:false

Only visible to super followers.

nullcast
boolean
default:false

Nullcast (promoted-only) tweet — not shown in the public timeline or to followers.

paid_partnership
boolean

Marks the tweet as a paid partnership.

made_with_ai
boolean

Flags the tweet as containing AI-generated media.

community_id
string

Post into the specified community.

Pattern: ^[0-9]{1,19}$
share_with_followers
boolean
default:false

Also share the community post with your followers.

edit_options
object

Edit an existing tweet instead of creating a new one (subject to X's edit window).

Response

Tweet created (or edited) successfully.

data
object