Skip to content
Twexapi
English
Esc
navigateopen⌘Jpreview

[Step 2/5] Upload and set article cover image (optional)

Step 2 of 5 (optional) — Upload a cover image and attach it to the draft.

  • article_id: obtained from Step 1
  • cover_image: an https:// URL or a local file path

This step can be skipped if you don’t need a cover image.

Back to API Reference
/Article Endpoints
PUT/x/articles/{article_id}/cover
Authorization
AuthorizationBearer token · headerrequired
Global API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Path Parameters
article_idstringrequired
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).
cover_imagestringrequired
Cover image: https URL or local file path
Responses
200Successful Response
codeintegerrequired
200 = success, 429 = rate limit, 500 = server error
msgstringrequired
Human-readable result message
dataArticleCoverData | any
Show properties
Any of:
ArticleCoverData
media_idstringrequired
Media ID of the uploaded cover image on X
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 ConsolePUT
Interactive Console / Try APIPUT
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
⚙️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/cover" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "cookie": "string",
  "cover_image": "string"
}'
Response
{
  "code": 0,
  "msg": "string",
  "data": {
    "media_id": "string"
  }
}