[Step 5/5] Publish an article draft
Step 5 of 5 — Publish the draft. Returns article_id and tweet_id.
article_id: obtained from Step 1visibility:Public(default) /Followers/Mentioned
⚠️ Make sure Steps 3 and 4 are completed before publishing. A draft without a title or content can still be published but will appear empty.
Back to API Reference
/Article Endpoints
POST
/x/articles/{article_id}/publishAuthorization
AuthorizationBearer token · headerrequiredGlobal API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Path Parameters
article_idstringrequiredRequest Body
requiredapplication/jsoncookiestringrequiredThe user's own authorized Twitter session credentials or auth_token (BYOC — Bring Your Own Cookie). Stateless proxy execution with zero credential retention. See [Authentication Security](/authentication#write-operations--byoc-bring-your-own-cookie) and [How to get Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
visibilitystringPublic / Followers / Mentioned
default: "Public"
Responses
200Successful Response
codeintegerrequired200 = success, 429 = rate limit, 500 = server error
msgstringrequiredHuman-readable result message
dataArticlePublishData | anyShow propertiesHide properties
Any of:
ArticlePublishData
article_idstringrequiredArticle draft ID
tweet_idstringrequiredTweet ID of the published article post
any
any422Validation Error
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorlocstring | integer[]requiredShow propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequiredtypestringrequiredinputanyctxobject429Daily tweet limit reached
500Server error
⚡Interactive ConsolePOST
⚡Interactive Console / Try APIPOSTLive Console
🌐Target Server:
https://api.twexapi.io● Production Ready
✍️
Write Operation Credentials Guide (TwexAPI Key + Twitter Cookie)
1. 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.
🔑API Authorization
⚙️Parameters (1)
📝Request Bodyapplication/json
📡
No Response Yet
Configure parameters in the Request tab and click Send Request below.
Request
curl -X POST "https://api.twexapi.io/x/articles/string/publish" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cookie": "string",
"visibility": "Public"
}'const response = await fetch("https://api.twexapi.io/x/articles/string/publish", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"cookie": "string",
"visibility": "Public"
})
});import requests
response = requests.post(
"https://api.twexapi.io/x/articles/string/publish",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"cookie": "string",
"visibility": "Public"
},
)Response
{
"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"
}