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

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



## OpenAPI

````yaml /api-reference/openapi.json post /x/articles/publish
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/publish:
    post:
      tags:
        - Article Endpoints
      summary: '[Quick] One-step article publish'
      description: >-
        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.
      operationId: article_publish_all_in_one_x_articles_publish_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArticlePublishAllInOneBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ArticlePublishResponse'
        '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:
    ArticlePublishAllInOneBody:
      properties:
        cookie:
          type: string
          title: Cookie
          description: Twitter cookie string (auth_token=...; ct0=...; twid=...)
        title:
          type: string
          title: Title
          description: Article title
        markdown:
          type: string
          title: Markdown
          description: Article body in Markdown format
        cover_image:
          anyOf:
            - type: string
            - type: 'null'
          title: Cover Image
          description: 'Cover image: https URL or local file path (optional)'
        visibility:
          type: string
          title: Visibility
          description: 'Visibility: Public / Followers / Mentioned'
          default: Public
      type: object
      required:
        - cookie
        - title
        - markdown
      title: ArticlePublishAllInOneBody
    ArticlePublishResponse:
      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/ArticlePublishData'
            - type: 'null'
      type: object
      required:
        - code
        - msg
      title: ArticlePublishResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ArticlePublishData:
      properties:
        article_id:
          type: string
          title: Article Id
          description: Article draft ID
        tweet_id:
          type: string
          title: Tweet Id
          description: Tweet ID of the published article post
      type: object
      required:
        - article_id
        - tweet_id
      title: ArticlePublishData
    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

````