[Quick] One-step article publish
Publish a complete X Article in a single call. Suitable for simple, one-shot use cases.
⚠️ Recommended: use the step-by-step flow instead. The step-by-step flow gives you full control — preview the draft before publishing, retry individual steps on failure, and reuse the same
article_idacross multiple calls.Step-by-step endpoints:
POST /x/articles/draft→ getarticle_idPUT /x/articles/{article_id}/cover(optional)PUT /x/articles/{article_id}/titlePUT /x/articles/{article_id}/contentPOST /x/articles/{article_id}/publish→ gettweet_id
Returns article_id and tweet_id on success.
/x/articles/publishAuthorizationBearer token · headerrequiredapplication/jsoncookiestringrequiredtitlestringrequiredmarkdownstringrequiredcover_imagestring | anyShow propertiesHide properties
stringanyvisibilitystringcodeintegerrequiredmsgstringrequireddataArticlePublishData | anyShow propertiesHide properties
article_idstringrequiredtweet_idstringrequiredanydetailValidationError[]Show propertiesHide properties
ValidationErrorlocstring | integer[]requiredShow propertiesHide properties
string | integerstringintegermsgstringrequiredtypestringrequiredinputanyctxobject⚡Interactive Console / Try APIPOSTLive Console
https://api.twexapi.io1. TwexAPI Platform Key (Bearer Token): Enter under "API Authorization" below for request billing & authentication.
2. Twitter Account Cookie: For write operations (tweet, like, follow, etc.), provide the target Twitter account's Cookie (e.g. auth_token=...; ct0=...) in the cookie field of Request Body below.
Configure parameters in the Request tab and click Send Request below.
curl -X POST "https://api.twexapi.io/x/articles/publish" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cookie": "string",
"title": "string",
"markdown": "string",
"cover_image": "string",
"visibility": "Public"
}'const response = await fetch("https://api.twexapi.io/x/articles/publish", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"cookie": "string",
"title": "string",
"markdown": "string",
"cover_image": "string",
"visibility": "Public"
})
});import requests
response = requests.post(
"https://api.twexapi.io/x/articles/publish",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"cookie": "string",
"title": "string",
"markdown": "string",
"cover_image": "string",
"visibility": "Public"
},
){
"code": 0,
"msg": "string",
"data": {
"article_id": "string",
"tweet_id": "string"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}{
"code": 429,
"msg": "Daily tweet limit reached, please try again tomorrow."
}{
"code": 500,
"msg": "Internal server error"
}