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

# Create a notification channel

> Register an https destination that monitors post to when they fire

export const MonitorsExperimental = () => <Warning>
    <strong>Monitors is experimental.</strong> Request and payload shapes can change without a deprecation window. Monitors isn't recommended for production workflows.
  </Warning>;

<MonitorsExperimental />

## Notes

* To authenticate, you'll need a [Tako API key](https://tako.com/console/api-keys). It's best practice to store it as an environment variable to avoid hardcoding sensitive credentials in your code.
* Create the channel before the monitor that uses it — [Create a monitor](/api-reference/monitors-create) answers `404` for a `channel_ids` entry that names no channel of yours.
* `url` must be `https`. Tako rejects `http`, and rejects a URL that embeds credentials.
* A channel starts `active`. Tako pauses it after two consecutive failed deliveries; see [Pause or resume a notification channel](/api-reference/notification-channels-update).

<Warning>
  **The `201` returns `secret`, and no later request ever returns it again.** Store it when you read this response. Every delivery to this channel carries a signature computed with it, so losing it means deleting the channel and creating a new one.
</Warning>

## Choosing a `kind`

`kind` decides how Tako shapes the request body it posts:

* `webhook` (the default) — nested JSON that namespaces the monitor, the firing, and the payload.
* `slack_workflow` — a flat body of strings, for a Slack Workflow Builder trigger, which rejects any nested value.


## OpenAPI

````yaml POST /v1/notification_channels
openapi: 3.1.0
info:
  title: Knowledge Search API
  version: 1.0.0
servers:
  - url: https://tako.com/api/
    description: Tako Production API Server
security: []
paths:
  /v1/notification_channels:
    post:
      tags:
        - monitors
      summary: Create a notification channel
      description: >-
        Register a destination that monitors post to. The response returns a
        server-generated signing secret once; no later request returns it.


        **Experimental.** Request and payload shapes can change without a
        deprecation window. Monitors isn't recommended for production workflows.
      operationId: createNotificationChannel
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationChannelCreate'
        required: true
      responses:
        '201':
          description: >-
            The created channel, with the signing secret this response alone
            returns
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationChannelCreated'
        '400':
          description: Invalid request data (validation or malformed body).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseAPIError'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseAPIError'
      security:
        - apiKey: []
components:
  schemas:
    NotificationChannelCreate:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 1
          title: Name
        kind:
          $ref: '#/components/schemas/ChannelKind'
          description: >-
            How Tako shapes the body it posts. Send slack_workflow for a Slack
            Workflow Builder trigger, which rejects a nested value.
          default: webhook
        url:
          type: string
          maxLength: 2048
          format: uri
          title: Url
          description: >-
            The https destination the channel posts to. Tako rejects http, and
            rejects a URL that embeds credentials.
      type: object
      required:
        - name
        - url
      title: NotificationChannelCreate
    NotificationChannelCreated:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        kind:
          $ref: '#/components/schemas/ChannelKind'
        url:
          type: string
          title: Url
        status:
          $ref: '#/components/schemas/ChannelStatus'
        status_reason:
          anyOf:
            - $ref: '#/components/schemas/ChannelStatusReason'
            - type: 'null'
          description: >-
            Why Tako paused the channel. Null while the channel is active, and
            null when you paused it yourself.
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        secret:
          type: string
          title: Secret
          description: >-
            The signing secret for this channel. Store it now: this response is
            the only place it appears, and no later request returns it. Every
            delivery to this channel carries a signature computed with it.
      type: object
      required:
        - id
        - name
        - kind
        - url
        - status
        - status_reason
        - created_at
        - updated_at
        - secret
      title: NotificationChannelCreated
    BaseAPIError:
      properties:
        error_message:
          type: string
          title: Error Message
        error_type:
          $ref: '#/components/schemas/APIErrorType'
      type: object
      required:
        - error_message
        - error_type
      title: BaseAPIError
    ChannelKind:
      type: string
      enum:
        - webhook
        - slack_workflow
      title: ChannelKind
      description: >-
        How Tako shapes the request body it posts to a channel: `webhook` sends
        nested JSON that namespaces the monitor, the firing, and the payload,
        and `slack_workflow` sends a flat body of strings for a Slack Workflow
        Builder trigger, which rejects any nested value.
    ChannelStatus:
      type: string
      enum:
        - active
        - paused
      title: ChannelStatus
    ChannelStatusReason:
      type: string
      enum:
        - delivery_failures
      title: ChannelStatusReason
    APIErrorType:
      type: string
      enum:
        - BAD_REQUEST
        - AUTHENTICATION_ERROR
        - INTERNAL_SERVER_ERROR
        - RELEVANT_RESULTS_NOT_FOUND
        - RATE_LIMIT_EXCEEDED
        - PAYMENT_REQUIRED
        - REQUEST_TIMEOUT
        - FORBIDDEN
        - NOT_FOUND
        - SERVICE_UNAVAILABLE
        - SERVICE_OVERLOADED
        - UNSUPPORTED_CONTENT_FORMAT
      title: APIErrorType
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-API-Key
      in: header

````