Post tweets, threads, polls and replies to X; limits, platformSpecificData options and credit cost.
Sandbox
In the sandbox these options are validated exactly as in production, but nothing is posted: each target gets a simulated result and a preview page. The outcomes described here (for example threads, polls and replies) are production behaviour and apply once live platform access opens.
Use "platform": "twitter".
platformSpecificData.longPost: true the limit is 25,000.platformSpecificData| Field | Type | Description |
|---|---|---|
threadItems | array | Follow-up tweets posted as a thread under the first one. Each item is { content, mediaItems? }; content is limited to 280 characters and mediaItems follow the same media rules. |
poll | object | { options, durationMinutes }: 2 to 4 string options, and a duration from 5 to 10,080 minutes (7 days). Cannot be combined with media or threadItems. |
replyToTweetId | string | Post the tweet as a reply to this tweet id. |
longPost | boolean | Allow up to 25,000 characters in the first tweet (thread items stay at 280). |
curl -s -X POST https://api.betterpost.dev/v1/posts \
-H "x-access-key: $BETTERPOST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "Five things we learned shipping our API (1/3)",
"platforms": [{
"platform": "twitter",
"accountId": "acc_2x9c4v7b1n8m3k5j0h6g2f4d",
"platformSpecificData": {
"threadItems": [
{ "content": "Idempotency keys saved us more than once (2/3)" },
{ "content": "Partial failures are normal: design for them (3/3)" }
]
}
}],
"publishNow": true
}'{
"content": "Which feature should we build next?",
"platforms": [{
"platform": "twitter",
"accountId": "acc_2x9c4v7b1n8m3k5j0h6g2f4d",
"platformSpecificData": { "poll": { "options": ["Analytics", "Comments", "DMs"], "durationMinutes": 1440 } }
}],
"publishNow": true
}http:// or https://: the first tweet (or the
target's content override) or any threadItems[].content. Bare domains such as example.com do not count.On the Free plan (20 credits a month) that means four X posts without links, and none with a link.