---
title: "Connect an organization Telegram bot"
method: PUT
path: "/v1/telegram/connection"
tags: ["Authentication"]
---

# Connect an organization Telegram bot

`PUT /v1/telegram/connection`

Admin-only. Validates a BotFather token, binds it to one organization worker, encrypts it at rest, and registers a secret-protected webhook.

## Request body

- object
  - `botToken` string, required
  - `workerId` string, required

## Response `200`

Telegram bot connected.

- TelegramConnectionResponse
  - `connection` TelegramConnection, required
    - `id` string, required
    - `status` 'active' | 'error', required
    - `connected` boolean, required
    - `bot` object, required
      - `id` string, required
      - `username` string, nullable, required
      - `displayName` string, required
    - `worker` object, required
      - `id` string, required
      - `name` string, required
      - `status` string, required
    - `webhook` object, required
      - `registered` boolean, required
      - `lastReceivedAt` string, date-time, nullable, required
      - `lastError` string, nullable, required
    - `pairing` object, required
      - `paired` boolean, required
      - `chat` object, nullable, required
        - `username` string, nullable, required
        - `firstName` string, required
        - `pairedAt` string, date-time, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `400` — The request was invalid.
- `401` — The caller must be signed in.
- `403` — Only workspace owners and admins can manage Telegram.
- `409` — The selected worker is unavailable or bot is already connected elsewhere.
- `502` — Telegram rejected the token or webhook.

---

[API](https://skmtc.net/openworklabs/apis/den-api.md) · [All operations](https://skmtc.net/openworklabs/apis/den-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openworklabs/den-api/versions/805150503452/schema)
