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

# Register a Telegram group

> Register or update a Telegram group on the authenticated user's account.
If the group is already registered (same user + group_id), the name and topic_id are updated.
Called by the Telegram bot during `/setup`.




## OpenAPI

````yaml /api-reference/openapi.yaml post /integrations/telegram/groups
openapi: 3.1.0
info:
  title: Harmonica API
  version: 1.0.0
  description: >
    REST API for the Harmonica structured deliberation platform.

    Provides access to sessions and their data, including creating, updating,
    and querying sessions, plus response submission for active sessions.
  contact:
    name: Harmonica
    url: https://harmonica.chat
servers:
  - url: https://app.harmonica.chat/api/v1
    description: Production
  - url: http://localhost:3000/api/v1
    description: Local development
security:
  - apiKey: []
paths:
  /integrations/telegram/groups:
    post:
      tags:
        - Integrations
      summary: Register a Telegram group
      description: >
        Register or update a Telegram group on the authenticated user's account.

        If the group is already registered (same user + group_id), the name and
        topic_id are updated.

        Called by the Telegram bot during `/setup`.
      operationId: registerTelegramGroup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterTelegramGroupRequest'
      responses:
        '201':
          description: Group registered (or updated)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TelegramGroup'
        '400':
          description: Validation error (missing group_id)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    RegisterTelegramGroupRequest:
      type: object
      properties:
        group_id:
          type: string
          description: Telegram chat ID
        group_name:
          type: string
          description: Telegram group title
        topic_id:
          type: integer
          description: Forum topic ID (if group has topics enabled)
      required:
        - group_id
    TelegramGroup:
      type: object
      description: A Telegram group registered to the user's account.
      properties:
        group_id:
          type: string
          description: Telegram chat ID
        group_name:
          type: string
          nullable: true
          description: Telegram group title
        topic_id:
          type: integer
          nullable: true
          description: Forum topic ID for bot announcements
        created_at:
          type: string
          format: date-time
      required:
        - group_id
        - created_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
                - forbidden
                - not_found
                - validation_error
                - rate_limited
                - internal_error
                - unprocessable
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or missing API key
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: |
        API key authentication. Pass your key as a Bearer token.
        Keys use the format `hm_live_<32 hex chars>`.
        Generate keys from your Harmonica dashboard settings.

````