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

# Publish to Twitter

> Publish to Twitter.



## OpenAPI

````yaml POST /ai/social/twitter/publish
openapi: 3.1.0
info:
  title: Blog API
  version: 1.0.0
servers:
  - url: https://api.octaviatech.app/cms
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Tags
    description: Tag management endpoints
paths:
  /ai/social/twitter/publish:
    post:
      tags:
        - AI
      summary: Post a tweet to the connected Twitter/X account
      description: >-
        Requires an active Twitter connection for the tenant. Posts to the
        Twitter v2 `tweets` endpoint using the stored bearer token. Upstream
        Twitter failures are surfaced as 502.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - text
              properties:
                text:
                  type: string
                  minLength: 1
                  maxLength: 280
                  description: Tweet body
            examples:
              Basic:
                value:
                  text: >-
                    New article: what intermittent fasting actually does to your
                    metabolism.
      responses:
        '200':
          description: OK (published)
          content:
            application/json:
              example:
                success: true
                statusCode: 200
                message: Published to Twitter
                data:
                  provider: twitter
                  tweetId: '1891234567890123456'
                  status: 201
        '401':
          description: Unauthorized
        '403':
          description: Forbidden (role not allowed)
        '404':
          description: Twitter connection not found for tenant
        '406':
          description: Validation failed, or the Twitter connection is incomplete
        '500':
          description: Failed to publish to Twitter
        '502':
          description: Twitter API returned an error
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````