[Step 4/5] Set article content from Markdown
Step 4 of 5 — Set the article body by providing Markdown text.
article_id: obtained from Step 1markdown: supports headings, bold/italic, lists, code blocks, and inline images ()
Inline images are automatically uploaded to X and embedded in the article.
Back to API Reference
/Article Endpoints
PUT
/x/articles/{article_id}/contentAuthorization
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).
markdownstringrequiredArticle body in Markdown format
Responses
200Successful Response
codeintegerrequired200 = success, 429 = rate limit, 500 = server error
msgstringrequiredHuman-readable result message
dataArticleContentData | anyShow propertiesHide properties
Any of:
ArticleContentData
blocksintegerrequiredNumber of content blocks parsed from the Markdown (paragraphs, headings, images, etc.)
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 ConsolePUT
⚡Interactive Console / Try APIPUTLive 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 PUT "https://api.twexapi.io/x/articles/string/content" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"cookie": "string",
"markdown": "string"
}'const response = await fetch("https://api.twexapi.io/x/articles/string/content", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"cookie": "string",
"markdown": "string"
})
});import requests
response = requests.put(
"https://api.twexapi.io/x/articles/string/content",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"cookie": "string",
"markdown": "string"
},
)Response
{
"code": 0,
"msg": "string",
"data": {
"blocks": 0
}
}{
"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"
}