---
title: "[Step 2/5] Upload and set article cover image (optional)"
method: PUT
path: "/x/articles/{article_id}/cover"
tags: ["Article Endpoints"]
---

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

`PUT /x/articles/{article_id}/cover`

## Request

- Base URL: `https://api.twexapi.io`
- URL: `https://api.twexapi.io/x/articles/{article_id}/cover`
- Auth: HTTP bearer

**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.

## Path parameters

- `article_id` string, required

## Request body

- ArticleUpdateCoverBody
  - `cookie` string, required: 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_image` string, required: Cover image: https URL or local file path

## Response `200`

Successful Response

- ArticleCoverResponse
  - `code` integer, required: 200 = success, 429 = rate limit, 500 = server error
  - `msg` string, required: Human-readable result message
  - `data` ArticleCoverData
    - `media_id` string, required: Media ID of the uploaded cover image on X

## Other responses

- `422`: Validation Error
- `429`: Daily tweet limit reached
- `500`: Server error

---

[API](https://skmtc.dev/twexapi/apis/twexapi-rest-api.md) · [All operations](https://skmtc.dev/twexapi/apis/twexapi-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/twexapi/apis/twexapi-rest-api/revisions/59a99ac0d8f7?raw)
