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

# Attach Channel to Alarm

> Attach another notification channel to an alarm, so one condition reaches several destinations (page Slack and email the on-call, say).

Accepts the same channel shape as alarm creation: `{ "id": <channel id> }` to reuse an existing channel, or inline `type` + `config` to create one. Inline channels identical to an existing row are deduped rather than duplicated.

Idempotent — re-attaching a channel that is already linked returns `already_linked: true` and changes nothing.

Gated by the alarm, not the channel: `alarms.manage` for an org-level alarm, `projects.alarms.manage` on the owner for a project alarm. Channels themselves are org-wide, so a project-scoped caller can point their alarm at any existing channel — attaching one is a routing decision about their alarm, whereas creating or deleting the channel row needs `notification_channels.manage`.



## OpenAPI

````yaml POST /orgs/{org_id}/alarms/{alarm_id}/channels
openapi: 3.1.0
info:
  title: Timbal Platform API
  description: Public API documentation for the Timbal platform
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.timbal.ai
    description: Production
  - url: https://api.dev.timbal.ai
    description: Development
security: []
tags:
  - name: ace
    description: Action Control Engine (ACE) operations
  - name: alarms
    description: Metric series and threshold alarms
  - name: analytics
    description: Org and project analytics
  - name: billing
    description: Subscriptions, usage, and payment-related operations
  - name: channels
    description: Delivery channels alarms notify through
  - name: content
    description: Re-sign stored content URLs
  - name: files
    description: File operations
  - name: iam
    description: IAM — actions, roles, users, and authorization introspection
  - name: k2
    description: Knowledge Bases v2 operations
  - name: orgs
    description: Organization operations
  - name: projects
    description: Project operations
  - name: runs
    description: Execution operations
  - name: templates
    description: Public project template catalog
  - name: users
    description: Authenticated user profile
paths:
  /orgs/{org_id}/alarms/{alarm_id}/channels:
    post:
      tags:
        - alarms
      summary: Attach a channel to an alarm
      description: >-
        Attach another notification channel to an alarm, so one condition
        reaches several destinations (page Slack and email the on-call, say).


        Accepts the same channel shape as alarm creation: `{ "id": <channel id>
        }` to reuse an existing channel, or inline `type` + `config` to create
        one. Inline channels identical to an existing row are deduped rather
        than duplicated.


        Idempotent — re-attaching a channel that is already linked returns
        `already_linked: true` and changes nothing.


        Gated by the alarm, not the channel: `alarms.manage` for an org-level
        alarm, `projects.alarms.manage` on the owner for a project alarm.
        Channels themselves are org-wide, so a project-scoped caller can point
        their alarm at any existing channel — attaching one is a routing
        decision about their alarm, whereas creating or deleting the channel row
        needs `notification_channels.manage`.
      operationId: add_org_alarm_channel
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
        - name: alarm_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChannelReq'
            examples:
              New Slack channel:
                value:
                  type: slack
                  name: oncall-pages
                  config:
                    token: xoxb-1234567890123-1234567890123
                    channel: C0123456789
              Reuse an existing channel:
                value:
                  id: '13'
        required: true
      responses:
        '200':
          description: Channel attached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AddAlarmChannelOut'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Alarm not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - bearer_auth: []
components:
  schemas:
    CreateChannelReq:
      type: object
      description: |-
        Channel reference embedded in another resource's create body (alarms).
        Either reuse by `id`, or supply `type` + `config` inline.
      properties:
        config:
          type: object
          description: Omitted or null when linking by `id` only.
        id:
          type:
            - string
            - 'null'
          description: >-
            Existing `NotificationChannels.id` for this org. When set, `type` /
            `config` / `name` are ignored.
        name:
          type:
            - string
            - 'null'
        type:
          $ref: '#/components/schemas/NotificationChannelType'
    AddAlarmChannelOut:
      type: object
      required:
        - channel_id
        - channel_action
        - already_linked
      properties:
        already_linked:
          type: boolean
          description: |-
            `true` when this channel was already attached, so the call changed
            nothing. Linking is idempotent — retries must not create duplicates,
            which would notify the same destination twice per transition.
        channel_action:
          $ref: '#/components/schemas/ChannelAction'
          description: >-
            How the underlying `NotificationChannels` row was resolved:
            referenced

            by `id`, deduped onto an identical existing row, or inserted.
        channel_id:
          type: integer
          format: int64
    ErrorMessage:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code (e.g. `ALREADY_EXISTS`, `BAD_REQUEST`).
        message:
          type: string
          description: Human-readable description.
    NotificationChannelType:
      type: string
      enum:
        - email
        - slack
    ChannelAction:
      type: string
      description: How the request was wired to `NotificationChannels`.
      enum:
        - linked
        - reused
        - created
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: >-
        Timbal API key. Obtain your API key from the Timbal platform settings.
        See [Authentication](/api-reference/authentication) for more
        information.

````