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

# X (Twitter)

> Create a post for X (Twitter).

## Request Fields

| Field            | Required | Description                   |
| ---------------- | -------- | ----------------------------- |
| `content`        | Yes      | Tweet content (max 280 chars) |
| `media_urls`     | No       | URLs of images/videos         |
| `mentions`       | No       | Handles without @ prefix      |
| `status`         | No       | `draft` or `scheduled`        |
| `scheduled_date` | No       | ISO 8601 date                 |

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.stover.app/v1/posts/x \
    -H "Authorization: Bearer stover_pk_your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "content": "Big announcement coming soon!",
      "mentions": ["stoverapp"],
      "status": "draft"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.stover.app/v1/posts/x', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer stover_pk_your_api_key',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      content: 'Big announcement coming soon!',
      mentions: ['stoverapp'],
      status: 'draft'
    })
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.stover.app/v1/posts/x',
      headers={
          'Authorization': 'Bearer stover_pk_your_api_key',
          'Content-Type': 'application/json'
      },
      json={
          'content': 'Big announcement coming soon!',
          'mentions': ['stoverapp'],
          'status': 'draft'
      }
  )
  ```
</CodeGroup>


## OpenAPI

````yaml POST /v1/posts/x
openapi: 3.1.0
info:
  title: Stover API
  description: API for managing contacts and social media posts
  version: 1.0.0
  contact:
    email: support@stover.app
servers:
  - url: https://api.stover.app
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/posts/x:
    post:
      tags:
        - Posts
      summary: Create X Post
      description: Create a post for X (Twitter).
      operationId: createXPost
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XPostRequest'
      responses:
        '201':
          description: Post created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    XPostRequest:
      type: object
      required:
        - content
      properties:
        content:
          type: string
          description: Tweet content (max 280 chars)
        media_urls:
          type: array
          items:
            type: string
        mentions:
          type: array
          items:
            type: string
          description: Handles without @
        status:
          type: string
          enum:
            - draft
            - scheduled
          default: draft
        scheduled_date:
          type: string
          format: date-time
    SuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        data:
          type: object
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    BadRequest:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API key: Bearer stover_pk_...'

````