Social

X/Twitter Write

Act on X/Twitter through an account you connect: post a tweet, reply, like, retweet, follow or unfollow, send a DM, delete a tweet, remove a follower, or upload media. Ownership is checked server-side — an agent can only write as a handle its own wallet connected.

post/api/tools/x_write

Request

  • Base URL: https://twitr.sh
  • URL: https://twitr.sh/api/tools/x_write
  • Auth: none declared. Required headers: Idempotency-Key

Headers

Idempotency-Keystring required

Unique key per logical action. A retry with the same key replays the original result (10-minute window) instead of acting or charging twice.

Request body

action'post' | 'reply' | 'like' | 'unlike' | 'retweet' | 'unretweet' | 'follow' | 'unfollow' | 'delete_tweet' | 'send_dm' | 'remove_follower' | 'upload_media' required

Which write to perform.

accountstring required

A connected X handle owned by this wallet (no @).

textstring

post|reply|send_dm: the message body.

reply_to_tweet_idstring

reply: the tweet being replied to.

target_tweet_idstring

like|unlike|retweet|unretweet|delete_tweet: the target tweet ID.

target_user_idstring

follow|unfollow|send_dm|remove_follower: the numeric X user id of the target (not the @handle). Get it from x_read get-user.

media_urlstring

upload_media: public URL of the file to upload; returns a media_id.

media_idsstring[]

send_dm: optional uploaded media ids to attach.

community_idstring

post: optional community to post into.

is_note_tweetboolean

post: long-form note tweet.

Response

Result dataset.

itemsobject[] required

Array of returned items. Shape varies per tool — see each tool's documentation.

runIdstring

Run ID for debugging/audit.

durationinteger

Run duration in seconds.

Changes

No recorded changes to this operation across all 1 revision of this API.