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

# Send a message to the connected Telegram chat

> Requires an active Telegram connection for the tenant. Sends via the bot's `sendMessage` to the stored `chatId`. `parseMode` defaults to HTML. Upstream Telegram failures are surfaced as 502.



## OpenAPI

````yaml /api-reference/ai-cms/openapi-TAGTEST.json post /ai/social/telegram/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/telegram/publish:
    post:
      tags:
        - AI Automation
      summary: Send a message to the connected Telegram chat
      description: >-
        Requires an active Telegram connection for the tenant. Sends via the
        bot's `sendMessage` to the stored `chatId`. `parseMode` defaults to
        HTML. Upstream Telegram 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: 4096
                  description: Message body
                parseMode:
                  type: string
                  description: Telegram formatting mode for `text`
                  enum:
                    - Markdown
                    - MarkdownV2
                    - HTML
                  default: HTML
                disableWebPagePreview:
                  type: boolean
                  description: If true, suppresses link previews
            examples:
              Basic:
                value:
                  text: >-
                    <b>New article</b>: what intermittent fasting actually does
                    to your metabolism.
                  parseMode: HTML
                  disableWebPagePreview: false
      responses:
        '200':
          description: OK (sent)
          content:
            application/json:
              example:
                success: true
                statusCode: 200
                message: Published to Telegram
                data:
                  provider: telegram
                  messageId: 4711
                  chatId: -1001234567890
                  status: 200
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/SocialPublishResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden (role not allowed)
        '404':
          description: Telegram connection not found for tenant
        '406':
          description: Validation failed, or the Telegram connection is incomplete
        '500':
          description: Failed to send to Telegram
        '502':
          description: Telegram API returned an error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Envelope:
      type: object
      properties:
        success:
          type: boolean
        statusCode:
          type: integer
        message:
          type: string
        data:
          type:
            - object
            - 'null'
      required:
        - success
        - statusCode
        - message
        - data
    SocialPublishResult:
      type: object
      properties:
        provider:
          type: string
          enum:
            - linkedin
            - twitter
            - telegram
        postId:
          oneOf:
            - type: string
            - type: 'null'
        messageId:
          oneOf:
            - type: integer
            - type: 'null'
        tweetId:
          oneOf:
            - type: string
            - type: 'null'
        chatId:
          oneOf:
            - type: string
            - type: 'null'
        status:
          type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````