X (Twitter)
Publish text posts, threads, images and video to X via the API v2. The platform id is x. A first comment or a thread is expressed with extra containers — container 0 is the root tweet, container 1 becomes the first reply, and any further containers continue the thread, each chained off the previous tweet.
Supported content
- Text — a single tweet from the main container.
- Thread — the main container plus reply containers, posted as a native reply chain.
- Image — attached to the main container, uploaded through the v1.1 chunked endpoint (INIT / APPEND / FINALIZE).
- Video / GIF — chunk-uploaded, then transcoded asynchronously; PostFuze polls processing status before the tweet is created.
Limits
| Property | Value |
|---|---|
| Character limit | 280 (free) · 25,000 (X Premium) |
| Media per tweet | One media item per container (the first attachment is used) |
| Upload chunk size | ≤4MB per APPEND segment |
| First comment / thread | Yes — published as native replies |
| Imports | Unsupported by the X API |
Configuration fields
Set under config.x. Both fields are optional; in normal use you can omit config.x entirely.
| Field | Type | Notes |
|---|---|---|
long_form | boolean | Raise the character ceiling to 25,000 for an X Premium account (default 280). Aliases: longForm, premium. Content over the active limit is rejected. |
username | string | Overrides the handle used to build the returned platform_post_url. Defaults to the connected account’s id. |
Required scopes
X uses OAuth 2.0 Authorization Code with PKCE. Configure the scopes on the BYOK network record; PostFuze expects:
tweet.readtweet.writeusers.readmedia.write— required to upload image/video for tweetsoffline.access— required so a refresh token is issued
offline.access is required
X access tokens are short-lived. Without
offline.access in the granted scopes no refresh token is issued, and publishing fails once the first token expires.Create a post
A tweet followed by a first comment carrying an external link:
curl
curl https://api.postfuze.com/api/v1/posts \
-H "Authorization: Bearer sk_live_…" \
-H "Content-Type: application/json" \
-d '{
"accounts": ["acct_x_01"],
"containers": [
{ "content": "We shipped the unified publishing API today 🚀" },
{ "content": "Full write-up → https://postfuze.com/blog/launch" }
]
}'201 Created
{
"id": "post_8f21",
"status": "queued",
"is_draft": false,
"scheduled_at": null,
"default_config": {},
"containers": [
{ "id": "ctr_a1", "position": 0, "role": "main", "content": "We shipped the unified publishing API today 🚀" },
{ "id": "ctr_a2", "position": 1, "role": "first_comment", "content": "Full write-up → https://postfuze.com/blog/launch" }
],
"targets": [
{ "id": "tgt_x1", "social_account_id": "acct_x_01", "platform": "x", "status": "queued", "platform_post_id": null }
]
}Once published, each target carries platform_post_id and platform_post_url pointing at the live tweet.