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

# Add a destination: a Slack incoming webhook, a signed webhook, PagerDuty or an email address (owners, admins)

> A webhook's signing secret is in this response only (`secret`); rotate it to get a new one. Requests carry `Apsio-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, t + "." + body)>` and `Apsio-Event-Id`. PagerDuty takes `routing_key` and `region` instead of `url`: a rule that fires triggers an incident and its recovery resolves it. An email destination takes `address`: a member's own is confirmed at once, any other gets a confirmation link first (`email.state` is pending until it is used); every alert email has a one-click unsubscribe, and at most `daily_cap` (50) alerts go to it a day, then one summary. Audited with the host (for email, the domain), never the URL, the key or the address.



## OpenAPI

````yaml /api-reference/openapi.json post /orgs/{orgId}/alerts/destinations
openapi: 3.1.0
info:
  title: Apsio API
  version: 0.1.0
  description: >-
    Read API v0: your projects, release health and comparisons, missing symbols,
    issues, sessions, vitals, cohort comparisons, performance (app start,
    screens, hangs, MetricKit) and network endpoints and traces for one project.
    Authenticate with a project token as a bearer token, with an OAuth access
    token from Apsio's authorization server (MCP clients), or, from the console,
    with the session cookie of a member of the project's organization.
servers:
  - url: https://api.apsio.io/v1
security: []
paths:
  /orgs/{orgId}/alerts/destinations:
    post:
      summary: >-
        Add a destination: a Slack incoming webhook, a signed webhook, PagerDuty
        or an email address (owners, admins)
      description: >-
        A webhook's signing secret is in this response only (`secret`); rotate
        it to get a new one. Requests carry `Apsio-Signature: t=<unix>,v1=<hex
        HMAC-SHA256(secret, t + "." + body)>` and `Apsio-Event-Id`. PagerDuty
        takes `routing_key` and `region` instead of `url`: a rule that fires
        triggers an incident and its recovery resolves it. An email destination
        takes `address`: a member's own is confirmed at once, any other gets a
        confirmation link first (`email.state` is pending until it is used);
        every alert email has a one-click unsubscribe, and at most `daily_cap`
        (50) alerts go to it a day, then one summary. Audited with the host (for
        email, the domain), never the URL, the key or the address.
      parameters:
        - schema:
            type: string
            pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            example: 0192f3a4-0000-7000-8000-00000000a001
          required: true
          name: orgId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - slack
                        - webhook
                    name:
                      type: string
                      minLength: 1
                      maxLength: 100
                    url:
                      type: string
                      minLength: 1
                      maxLength: 2048
                      description: >-
                        https only. Slack: an incoming webhook URL
                        (https://hooks.slack.com/services/...). Checked when
                        saved (it must resolve to public addresses only) and
                        before every delivery. Never returned.
                      example: https://alerts.example.com/apsio
                  required:
                    - kind
                    - name
                    - url
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - pagerduty
                    name:
                      type: string
                      minLength: 1
                      maxLength: 100
                    routing_key:
                      type: string
                      pattern: ^[A-Za-z0-9]{32}$
                      description: >-
                        PagerDuty: the Integration Key of an Events API v2
                        integration on the service (32 letters and digits).
                        Encrypted when saved and never returned.
                      example: R0123456789abcdefABCDEF012345678
                    region:
                      type: string
                      enum:
                        - us
                        - eu
                      description: >-
                        PagerDuty: the service region's Events API,
                        events.pagerduty.com (us, the default) or
                        events.eu.pagerduty.com (eu).
                  required:
                    - kind
                    - name
                    - routing_key
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - email
                    name:
                      type: string
                      minLength: 1
                      maxLength: 100
                    address:
                      type: string
                      minLength: 3
                      maxLength: 254
                      description: >-
                        email: one address. A member's own is confirmed at once;
                        any other gets a confirmation link, and nothing else
                        until it is used (7 days).
                      example: mobile@acme.example
                  required:
                    - kind
                    - name
                    - address
      responses:
        '201':
          description: The destination, and for a webhook its signing secret
          content:
            application/json:
              schema:
                type: object
                properties:
                  destination:
                    $ref: '#/components/schemas/AlertDestination'
                  secret:
                    type: string
                    description: 'A webhook: its signing secret, shown this once.'
                required:
                  - destination
      security:
        - session: []
components:
  schemas:
    AlertDestination:
      type: object
      properties:
        id:
          type: string
        kind:
          type: string
          enum:
            - slack
            - webhook
            - github
            - linear
            - pagerduty
            - email
          description: >-
            github and linear: the agent handoff, which opens issues instead of
            messages. email: one address (D39).
        name:
          type: string
        host:
          type: string
          description: >-
            What the console shows of the URL; the URL and a routing key are
            never sent.
        region:
          type: string
          enum:
            - us
            - eu
          description: PagerDuty only.
        paused_until:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Paused after repeated timeouts until then; a successful test send
            lifts it.
        consecutive_failures:
          type: integer
        last_error_code:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        created_by:
          type:
            - string
            - 'null'
        updated_at:
          type: string
          format: date-time
        last_delivered_at:
          type:
            - string
            - 'null'
          format: date-time
        handoff_enabled_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            github and linear: when an owner turned the handoff on; null while
            off.
        daily_cap:
          type: integer
          description: >-
            github and linear: issues per project per day. email: alerts a day;
            past it, one summary.
        email:
          type: object
          properties:
            address:
              type: string
            member:
              type: boolean
              description: >-
                A member's own address: confirmed by their account, stopped when
                they leave.
            state:
              type: string
              enum:
                - pending
                - confirmed
                - unsubscribed
              description: >-
                pending: the address has not used its confirmation link yet, and
                gets nothing else. unsubscribed: it used the link in an alert; a
                new confirmation is needed.
            confirmed_at:
              type:
                - string
                - 'null'
              format: date-time
            unsubscribed_at:
              type:
                - string
                - 'null'
              format: date-time
          required:
            - address
            - member
            - state
            - confirmed_at
            - unsubscribed_at
          description: email only.
        revoked_at:
          type:
            - string
            - 'null'
          format: date-time
          description: 'github and linear: the App was uninstalled or the grant revoked.'
      required:
        - id
        - kind
        - name
        - host
        - paused_until
        - consecutive_failures
        - last_error_code
        - created_at
        - created_by
        - updated_at
        - last_delivered_at
  securitySchemes:
    session:
      type: apiKey
      in: cookie
      name: apsio_session
      description: >-
        The console session, set by /v1/auth/callback (`__Host-apsio_session`
        when host-only).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.