> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twexapi.io/llms.txt
> Use this file to discover all available pages before exploring further.

# [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.



## OpenAPI

````yaml /api-reference/openapi.json put /x/articles/{article_id}/cover
openapi: 3.1.0
info:
  title: Twitter API Service
  description: |2-

            A comprehensive Twitter API service that provides various Twitter operations including:
            
            * **Search Operations**: Advanced search, hashtags, cashtags
            * **Tweet Operations**: Post, like, retweet, quote, bookmark, delete
            * **User Operations**: Batch user information retrieval
            * **Influencer Operations**: Get tweets from top influencers
            
            All endpoints return standardized responses in the format:
            ```json
            {
                "code": 200,
                "msg": "success", 
                "data": {...}
            }
            ```
            
            ## Authentication
            
            This API uses Bearer token authentication. Include your token in the Authorization header:
            ```
            Authorization: Bearer your_token_here
            ```
            
  contact:
    name: API Support
    email: support@twitterxapi.com
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.twexapi.io
    description: Development server
security: []
paths:
  /x/articles/{article_id}/cover:
    put:
      tags:
        - Article Endpoints
      summary: '[Step 2/5] Upload and set article cover image (optional)'
      description: >-
        **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.
      operationId: article_update_cover_x_articles__article_id__cover_put
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
            title: Article Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArticleUpdateCoverBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArticleCoverResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Daily tweet limit reached
          content:
            application/json:
              example:
                code: 429
                msg: Daily tweet limit reached, please try again tomorrow.
        '500':
          description: Server error
          content:
            application/json:
              example:
                code: 500
                msg: Internal server error
      security:
        - HTTPBearer: []
components:
  schemas:
    ArticleUpdateCoverBody:
      properties:
        cookie:
          type: string
          title: Cookie
          description: Twitter cookie string
        cover_image:
          type: string
          title: Cover Image
          description: 'Cover image: https URL or local file path'
      type: object
      required:
        - cookie
        - cover_image
      title: ArticleUpdateCoverBody
    ArticleCoverResponse:
      properties:
        code:
          type: integer
          title: Code
          description: 200 = success, 429 = rate limit, 500 = server error
        msg:
          type: string
          title: Msg
          description: Human-readable result message
        data:
          anyOf:
            - $ref: '#/components/schemas/ArticleCoverData'
            - type: 'null'
      type: object
      required:
        - code
        - msg
      title: ArticleCoverResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ArticleCoverData:
      properties:
        media_id:
          type: string
          title: Media Id
          description: Media ID of the uploaded cover image on X
      type: object
      required:
        - media_id
      title: ArticleCoverData
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````