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

# Create or update a route

> Routes an event type to a team destination. Every event is delivered immediately.
Called again for the same `destination_id` and `event_key`, it returns the existing
route. The destination may be `pending`; deliveries start once it is `active`.
Unknown event keys and internal events return `400`.




## OpenAPI

````yaml /api/platform/v1/openapi-platform.yaml put /notifications/routes
openapi: 3.1.0
info:
  title: Kapso Platform API
  version: 0.2.0
  description: >
    Build WhatsApp messaging into your product. Manage customers, connect phone
    numbers, send broadcasts, and handle conversations.
servers:
  - url: https://api.kapso.ai/platform/v1
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Customers
    description: Manage customer accounts
  - name: Setup Links
    description: WhatsApp onboarding via embedded signup
  - name: Phone Numbers
    description: Connect and manage WhatsApp numbers
  - name: Webhooks
    description: Subscribe to WhatsApp events
  - name: Display Names
    description: Update WhatsApp business display names
  - name: Broadcasts
    description: |
      Send template messages at scale

      **Alpha**: This API is in alpha and subject to change
  - name: Conversations
    description: Manage conversation state
  - name: Media
    description: Upload media files for WhatsApp messaging
  - name: Users
    description: Manage project team members
  - name: Inbox Embeds
    description: Create and manage embeddable inbox access links
  - name: Webhook Deliveries
    description: View webhook delivery attempts and their status
  - name: External API Logs
    description: View logs of external API calls made by the project
  - name: Log Search
    description: Search log events across API, Meta, workflow, and webhook sources
  - name: Events
    description: Emit and query project-scoped events
  - name: Provider Models
    description: List available AI provider models
  - name: WhatsApp Flows
    description: Build interactive WhatsApp Flows for surveys and forms
  - name: Contacts
    description: Manage WhatsApp contacts
  - name: Findings
    description: Detect recurring problems in conversations and investigate them with AI
  - name: Notifications
    description: >-
      Route project alerts to shared inboxes and Slack channels connected from
      the Kapso app
paths:
  /notifications/routes:
    put:
      tags:
        - Notifications
      summary: Create or update a route
      description: >
        Routes an event type to a team destination. Every event is delivered
        immediately.

        Called again for the same `destination_id` and `event_key`, it returns
        the existing

        route. The destination may be `pending`; deliveries start once it is
        `active`.

        Unknown event keys and internal events return `400`.
      operationId: upsertNotificationRoute
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - destination_id
                - event_key
              properties:
                destination_id:
                  type: string
                  format: uuid
                event_key:
                  type: string
                  description: A `key` from `GET /notifications/events`.
            example:
              destination_id: 6f708192-0314-42d5-b6e7-f8091a2b3c4d
              event_key: findings.detected
      responses:
        '200':
          description: Route saved
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/NotificationRoute'
              example:
                data:
                  id: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                  destination_id: 6f708192-0314-42d5-b6e7-f8091a2b3c4d
                  event_key: findings.detected
                  created_at: '2026-09-01T12:05:00.000000Z'
                  updated_at: '2026-09-01T12:05:00.000000Z'
        '400':
          description: Unknown or internal event key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              examples:
                unknown:
                  value:
                    error: 'Unknown notification event: findings.detectd'
                internal:
                  value:
                    error: >-
                      This notification event is not available through the
                      Platform API.
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          description: Destination not found in this project
        '422':
          description: Invalid route
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
              example:
                errors:
                  notification_destination:
                    - >-
                      must be a shared destination; personal emails follow each
                      member's preferences
components:
  schemas:
    NotificationRoute:
      type: object
      properties:
        id:
          type: string
          format: uuid
        destination_id:
          type: string
          format: uuid
        event_key:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    UnauthorizedError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````