post_to_x
Publish a post to X (Twitter) destructive
Description
Use this when the user wants to post to X (Twitter) now. Publish to the user’s connected X (Twitter) account — a single post, a post with an image or video render attached, a reply to an existing post, or a whole THREAD (pass `thread` as an array and each part is posted as a reply to the one before). This PUBLISHES immediately and PUBLICLY — ALWAYS show the user the exact text and get an explicit yes BEFORE calling. Text is NEVER truncated. Write altText whenever you attach a render. COSTS CREDITS at X’s per-post price, every post in a thread billed: a post that contains a link (any web address, and every quote post) is X’s link rate, far higher than one without (hermoso_credits gives both figures). When the user asks what a post will cost, call this with dryRun:true: it posts NOTHING and returns that exact post’s costCredits. THIS TOOL POSTS ORGANICALLY — it does not create an ad campaign. Needs X connected (Connectors > X). Full rules: get_instructions({topic:'post_to_x'}).
Parameters
| Parameter | Type | Description |
|---|---|---|
account | string | WHICH connected account of this channel to post as — its @handle or id from list_connector_accounts. Needed only when the profile has more than one x account connected (several and none named is refused by name, never guessed); omit when there is one. |
brand | string | WHICH PROFILE this post belongs to, for THIS CALL ONLY (beats the connection’s pin): an id or exact name from list_brands. A name that matches no profile, or two, is REFUSED and nothing is posted. |
hook | string | the post’s ANGLE, recorded at publish: a list_hooks id (e.g. "direct_callout") or your own wording reused EXACTLY across a campaign. post_performance ranks hooks on it (a winner needs 5 posts sharing one); omitted, this post never votes. |
subject | string | what the post is about (product, feature, offer or theme): post_performance’s second axis, so reuse the exact wording. |
recipe | string | the post's FORMAT id, e.g. "slideshow" or "imessage_chat" — post_performance groups by it, so reuse one id per format |
ideaId | string | short id of the content-plan idea this post came from |
text | string | the post text. 280 characters without X Premium, up to 25,000 with it — write the full thing, it is never truncated. With `thread` also set, this is the FIRST post and the thread entries follow it (a thread whose first entry is already this text is not posted twice). |
thread | string[] | a thread: each string is one post, published in order, each replying to the previous (if `text` is also set it is posted first and these follow). Max 25 including `text`. Each part follows the same length rule as `text`, and on an X Premium account ONE long post is usually both better reading and cheaper than a thread. |
dryRun | boolean | true = post NOTHING and return what this exact post would cost (costCredits). Free. |
mediaUrl | string | a Hermoso render (image or video) to attach to the first post — pass its served URL, or an upload_file url for external media; a URL, not a local file path; use upload_file for local files |
videoUrl | string | alias of mediaUrl for a VIDEO — same as passing it as mediaUrl |
imageUrl | string | alias of mediaUrl for an IMAGE — same as passing it as mediaUrl |
mediaUrls | string[] | UP TO FOUR Hermoso-hosted media attached to ONE post — X’s own schema caps media_ids at 4. X renders them as a GRID: every image visible at once, nothing to swipe to. That is NOT a carousel, and a numbered "1/6 · SWIPE" slide deck must still not be sent here — it would publish as a grid and the "swipe" instruction would make no sense. Order decides the layout. On a thread the media rides the FIRST post; give each later part its own post to attach more. Mutually exclusive with mediaUrl, and more than 4 is refused before anything is uploaded; a URL, not a local file path; use upload_file for local files |
altText | string | string[] | accessibility description of the attached media, max 1000 characters — write one whenever you attach a render. Costs a small extra amount: X bills one metadata write PER media. With SEVERAL media, pass an ARRAY aligned to their order — X attaches alt text per media id, and a single string describes only the FIRST one (X renders up to four media as a GRID, not a carousel, so one sentence would be wrong for the other three). |
poll | object | run a poll on the post. X does not allow a poll and media on the same post, and a poll cannot ride on a thread. |
poll.optionsrequired | string[] | 2-4 choices, max 25 characters each |
poll.durationMinutes | number | 5 to 10080 minutes (7 days); default 1440 = one day |
replySettings | "following" | "mentionedUsers" | "subscribers" | "verified" | restrict who can reply — omit for everyone, which is the right default for a brand post |
replyToId | string | numeric id of an existing X post to reply to. X ONLY ACCEPTS AN API REPLY TO A POST THAT MENTIONS THIS ACCOUNT OR THAT THIS ACCOUNT WROTE (X policy since Feb 2026, every tier below Enterprise): a cold reply under a stranger's post is refused by X with "You can only reply to or quote posts where you are mentioned or are the author" and nothing is posted. Reply to those from x.com itself; use this for replies in your own threads and to people who tagged you. |
quotePostId | string | numeric id of a post to QUOTE — X renders the quoted post inside yours. This is NOT replyToId: a reply sits under the original in its thread, a quote stands alone on your own timeline with the original embedded, which is the one you want for commentary. X makes a quote mutually exclusive with media and with a poll (their own schema), and a quote is billed at the higher LINK rate because X appends the quoted post’s t.co URL whatever your text says. Same X rule as replyToId: a quote of a post that does not mention this account is refused by X. |
communityId | string | publish into an X COMMUNITY instead of the main timeline — the number in the community’s own URL (x.com/i/communities/<id>). The connected account must be a MEMBER of it; X answers a non-member and a non-existent id with the same refusal and does not separate them. |
paidPartnership | boolean | label the post a PAID PARTNERSHIP on X — the same disclosure Hermoso already ships for TikTok. OPT-IN ONLY: set it when the post is sponsored, gifted or otherwise paid for, and never assume it on the user’s behalf. |
sensitiveMedia | boolean | "adult_content" | "graphic_violence" | "other"[] | put X’s SENSITIVE-CONTENT WARNING over the attached media: any of adult_content, graphic_violence, other (true = other). A property of the MEDIA on X, so a text-only post is refused. If X refuses the warning, nothing is posted. |
geoRestriction | object | limit which COUNTRIES can see the post’s media (one of the two lists, not both). A property of the MEDIA on X (X’s post endpoint has no country field), so a text-only post is refused; if X refuses the restriction, nothing is posted rather than publishing it everywhere. |
geoRestriction.countries | string[] | ONLY people in these countries see the media: two-letter codes, e.g. ["US","CA"] |
geoRestriction.excludeCountries | string[] | everyone EXCEPT people in these countries sees the media |
videoTitle | string | VIDEO posts only — a headline under the video, max 70 (measured: X drops it on an image post, so it is refused there) |
videoDescription | string | VIDEO posts only — a line under the title, max 200 |
videoCta | "visit_site" | "watch_now" | VIDEO posts only — a button on the video; needs videoCtaUrl (https) |
videoCtaUrl | string | https link the video button opens; used with videoCta |
taggedUserIds | string[] | tag up to 10 people (numeric X user ids, from x_user) in the post’s media |
dmDeepLink | string | boolean | a "Message us" button: true for the connected account, or https://x.com/messages/compose?recipient_id=<id>. TEXT posts only — X refuses it alongside media. |
platformCover | boolean | VIDEO COVER. X has no cover setting and shows the video’s FIRST frame, so by default Hermoso checks it and, only when that frame is blank (a template ad’s empty opening card), sends X a copy with the first frame replaced by the video’s best frame. Your Library file is never changed. true = send the file exactly as it is. |
clip | object | share a CLIP of another post’s video. It is the post’s only attachment: no media, poll, quote, message-us link or thread. Link rate. |
clip.postIdrequired | string | id or x.com link of a post with ONE video over 2 minutes |
clip.startSecondsrequired | integer | string | whole seconds or m:ss |
clip.endSecondsrequired | integer | string | 5 to 60 s after start, at most 30% of that video |
Example call
Every required parameter is shown, filled from the schema where it gives a value and otherwise with a placeholder naming the type. Replace the placeholders with real values. The same call works on the MCP server, the CLI and POST https://app.hermoso.ai/v1/tools/post_to_x.
MCP (tools/call)
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"post_to_x","arguments":{}}}
CLI
hermoso call post_to_x --json '{}'
Credits
Credits are spent only on two things: running an AI model (image, video, voice, text, planning, post-production) and Ad Spy research. See Credits & costs.
Related tools
hermoso_creditsCredit balanceget_instructionsRead Hermoso's full instructionspost_x_articlePublish a long-form Article to Xedit_x_postEdit a post on Xdelete_x_postDelete a post on Xx_post_metricsRead performance of a post on Xx_post_insightsAdvertiser analytics for your own posts on Xx_post_insights_historicalAdvertiser analytics for your own X posts, over any date rangex_mentionsRead who is mentioning you on X