Skip to content
Twexapi
English
Esc
navigateopen⌘Jpreview

[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_id across multiple calls.

Step-by-step endpoints:

  1. POST /x/articles/draft → get article_id
  2. PUT /x/articles/{article_id}/cover (optional)
  3. PUT /x/articles/{article_id}/title
  4. PUT /x/articles/{article_id}/content
  5. POST /x/articles/{article_id}/publish → get tweet_id

Returns article_id and tweet_id on success.

Back to API Reference
/Article Endpoints
POST/x/articles/publish
Authorization
AuthorizationBearer token · headerrequired
Global API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Request Body
requiredapplication/json
cookiestringrequired
The 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).
titlestringrequired
Article title
markdownstringrequired
Article body in Markdown format
cover_imagestring | any
Cover image: https URL or local file path (optional)
Show properties
Any of:
string
string
any
any
visibilitystring
Visibility: Public / Followers / Mentioned
default: "Public"
Responses
200Successful Response
codeintegerrequired
200 = success, 429 = rate limit, 500 = server error
msgstringrequired
Human-readable result message
dataArticlePublishData | any
Show properties
Any of:
ArticlePublishData
article_idstringrequired
Article draft ID
tweet_idstringrequired
Tweet ID of the published article post
any
any
422Validation Error
detailValidationError[]
Show properties
Array of ValidationError
locstring | integer[]required
Show properties
Array of string | integer
Any of:
string
string
integer
integer
msgstringrequired
typestringrequired
inputany
ctxobject
429Daily tweet limit reached
500Server error
Interactive ConsolePOST
Interactive Console / Try APIPOST
Live 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
📝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/publish" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "cookie": "string",
  "title": "string",
  "markdown": "string",
  "cover_image": "string",
  "visibility": "Public"
}'
Response
{
  "code": 0,
  "msg": "string",
  "data": {
    "article_id": "string",
    "tweet_id": "string"
  }
}