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

# Telegram Bot API webhook

> Webhook URL configured with Telegram via `setWebhook`. The
`{secret}` path parameter must match the
`TELEGRAM_WEBHOOK_SECRET` binding; otherwise the request is
rejected with 401. Receives interactive update payloads
(messages, callback queries, inline queries) and routes them
to the bot's command dispatcher.




## OpenAPI

````yaml /docs/openapi-minimal.yaml post /telegram/{secret}
openapi: 3.0.3
info:
  title: Hoox API
  description: |
    REST API for the Hoox algorithmic trading platform.

    Ingest trade signals, check system health, and manage DeFi wallet
    operations on the Cloudflare edge. All requests are handled by the
    Hoox gateway worker (`workers/hoox`) running at the network edge.
  version: 1.0.0
  contact:
    name: Hoox Support
    email: support@hoox.sh
servers:
  - url: https://api.hoox.sh
    description: Production API
  - url: https://staging.hoox.sh
    description: Staging environment
security: []
paths:
  /telegram/{secret}:
    post:
      tags:
        - Telegram
      summary: Telegram Bot API webhook
      description: |
        Webhook URL configured with Telegram via `setWebhook`. The
        `{secret}` path parameter must match the
        `TELEGRAM_WEBHOOK_SECRET` binding; otherwise the request is
        rejected with 401. Receives interactive update payloads
        (messages, callback queries, inline queries) and routes them
        to the bot's command dispatcher.
      operationId: telegramWebhook
      parameters:
        - name: secret
          in: path
          required: true
          schema:
            type: string
          description: Shared secret matching `TELEGRAM_WEBHOOK_SECRET`
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: Telegram Bot API Update object
              additionalProperties: true
              example:
                update_id: 123456789
                message:
                  message_id: 1
                  from:
                    id: 987654321
                    is_bot: false
                    first_name: Trader
                  chat:
                    id: 987654321
                    type: private
                  date: 1779261050
                  text: /status
      responses:
        '200':
          description: Webhook accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
        '401':
          description: |
            Path secret does not match `TELEGRAM_WEBHOOK_SECRET`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: |
            Internal processing error in the telegram command
            dispatcher.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        requestId:
          type: string
          format: uuid
          description: Request trace identifier
          example: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d
        error:
          type: string
          description: Human-readable error description
          example: Invalid JSON payload structure.

````