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

# Set organization webhook

> Sets the **only** webhook endpoint of the organization, which receives the events of **all** your customers. Each event carries the `project_id` and the `external_ref` of the project, so you route by your own ID without keeping a lookup table.

The first call creates the endpoint and returns `201` with the signing `secret`, **shown only once**. Later calls (`200`) replace the URL and the subscribed types, re-enable the endpoint and do not return the secret.

Signatures and attempts follow the rules of a project's [webhooks](/en/webhooks/overview). You can also keep endpoints on individual projects: in that case, you receive both deliveries.

An endpoint that carries many customers is the bottleneck of all of them. It has at most 32 concurrent deliveries (8 on a project endpoint), so answer fast and queue the work on your side. See [Organization webhook](/en/partners/webhook).



## OpenAPI

````yaml en/openapi.json PUT /v1/partner/webhook
openapi: 3.0.3
info:
  title: Routa API
  description: >-
    REST API to send and receive WhatsApp messages, track delivery and receive
    normalized events through webhooks.
  version: '1'
servers:
  - url: https://api.routa.chat
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Send, retrieve and list messages.
  - name: Events
    description: Query the log of normalized events.
  - name: Webhooks
    description: Manage webhook endpoints, secrets and deliveries.
  - name: Templates
    description: Create and retrieve WhatsApp templates.
  - name: Media
    description: Upload and download media files.
  - name: Usage
    description: Query the metered usage of the project.
  - name: Identity
    description: Identify the API key in use.
  - name: Partners
    description: >-
      Create one project per customer, issue the key of each project, follow the
      channels and receive the events of every customer on a single webhook.
      These routes use a partner key (`rt_partner_...`). See [Partner
      API](/en/partners/overview).
paths:
  /v1/partner/webhook:
    put:
      tags:
        - Partners
      summary: Set organization webhook
      description: >-
        Sets the **only** webhook endpoint of the organization, which receives
        the events of **all** your customers. Each event carries the
        `project_id` and the `external_ref` of the project, so you route by your
        own ID without keeping a lookup table.


        The first call creates the endpoint and returns `201` with the signing
        `secret`, **shown only once**. Later calls (`200`) replace the URL and
        the subscribed types, re-enable the endpoint and do not return the
        secret.


        Signatures and attempts follow the rules of a project's
        [webhooks](/en/webhooks/overview). You can also keep endpoints on
        individual projects: in that case, you receive both deliveries.


        An endpoint that carries many customers is the bottleneck of all of
        them. It has at most 32 concurrent deliveries (8 on a project endpoint),
        so answer fast and queue the work on your side. See [Organization
        webhook](/en/partners/webhook).
      operationId: setPartnerWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
                - subscribed_types
              properties:
                url:
                  description: >-
                    HTTPS URL that receives the events of every project in the
                    organization. The address must resolve to a public host.
                  type: string
                  example: https://crm.example.com/routa
                subscribed_types:
                  minItems: 1
                  description: >-
                    Event types or per-resource wildcards (`message.*`,
                    `channel.*`, `template.*`). At least one. The bare `*`
                    wildcard is not accepted.
                  type: array
                  items:
                    type: string
                  example:
                    - message.*
                    - channel.status_changed
            example:
              url: https://crm.example.com/routa
              subscribed_types:
                - message.*
                - channel.status_changed
      responses:
        '200':
          description: >-
            Endpoint updated and re-enabled. The response does not include the
            secret
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '201':
          description: Endpoint created. The `secret` is shown only once
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpointWithSecret'
        '401':
          description: >-
            The partner key is missing, invalid, revoked, expired or used from
            outside its IP allowlist (`partner_key_invalid`). A project key also
            gets this error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The partner key lacks the required scope (`insufficient_scope`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            The resource does not exist, does not belong to your organization or
            was not created through the Partner API. Also returns
            `partner_api_not_available` when your plan does not include the
            Partner API
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Invalid request (`request_invalid`, `invalid_webhook_url`,
            `invalid_subscribed_types`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit exceeded: 10 requests per second, with bursts of up to
            30, per organization. See the `Retry-After` header
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - partnerAuth:
            - webhooks:write
components:
  schemas:
    WebhookEndpoint:
      type: object
      properties:
        id:
          type: string
          description: Endpoint ID.
          example: whe_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        url:
          type: string
          description: URL that receives the events.
          example: https://example.com/webhooks/routa
        subscribed_types:
          type: array
          items:
            type: string
          description: Subscribed event types, including wildcards such as `message.*`.
        api_version:
          type: string
          description: API version pinned when the endpoint was created.
        status:
          type: string
          enum:
            - enabled
            - disabled_by_user
            - disabled_by_system
          description: >-
            Endpoint state: `enabled`, `disabled_by_user` or
            `disabled_by_system`.
        consecutive_failures:
          type: number
          description: Consecutive delivery failures. Resets on every success.
        last_success_at:
          format: date-time
          type: string
          nullable: true
          description: Last successful delivery, or `null`.
        last_failure_at:
          format: date-time
          type: string
          nullable: true
          description: Last failed delivery, or `null`.
        created_at:
          format: date-time
          type: string
          description: When the endpoint was created.
          example: '2026-09-04T13:22:41.031Z'
      required:
        - id
        - url
        - subscribed_types
        - api_version
        - status
        - consecutive_failures
        - last_success_at
        - last_failure_at
        - created_at
    WebhookEndpointWithSecret:
      type: object
      properties:
        id:
          type: string
          description: Endpoint ID.
          example: whe_01J8ZK9M3Q7XABCDEFGHJKMNPQ
        url:
          type: string
          description: URL that receives the events.
          example: https://example.com/webhooks/routa
        subscribed_types:
          type: array
          items:
            type: string
          description: Subscribed event types, including wildcards such as `message.*`.
        api_version:
          type: string
          description: API version pinned when the endpoint was created.
        status:
          type: string
          enum:
            - enabled
            - disabled_by_user
            - disabled_by_system
          description: >-
            Endpoint state: `enabled`, `disabled_by_user` or
            `disabled_by_system`.
        consecutive_failures:
          type: number
          description: Consecutive delivery failures. Resets on every success.
        last_success_at:
          format: date-time
          type: string
          nullable: true
          description: Last successful delivery, or `null`.
        last_failure_at:
          format: date-time
          type: string
          nullable: true
          description: Last failed delivery, or `null`.
        created_at:
          format: date-time
          type: string
          description: When the endpoint was created.
          example: '2026-09-04T13:22:41.031Z'
        secret:
          type: string
          description: >-
            Signing secret. Shown only on creation and rotation. Store it
            safely.
          example: whsec_...
      required:
        - id
        - url
        - subscribed_types
        - api_version
        - status
        - consecutive_failures
        - last_success_at
        - last_failure_at
        - created_at
        - secret
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              description: >-
                Error category: `invalid_request_error`, `authentication_error`,
                `permission_error`, `not_found_error`, `conflict_error`,
                `rate_limit_error`, `billing_error` or `api_error`.
              example: invalid_request_error
            code:
              type: string
              description: >-
                Stable, machine-readable code. See [Error
                codes](/en/errors/error-codes).
              example: channel_inactive
            message:
              type: string
              description: >-
                Human-readable text, in English. It can change, so do not parse
                it.
              example: Channel chan_01J8... is not active and cannot send messages.
            param:
              type: string
              description: >-
                The request field at fault, when it applies. It is filled in on
                `request_invalid` (the field outside the schema, such as
                `template.button_parameters.0.index`) and on template errors:
                `name` in `template_name_invalid`; `body_text`,
                `components.header`, `components.footer` or `components.buttons`
                in `template_components_invalid`; and `variable_examples`,
                `variable_examples.<position>`, `components.header.example` or
                `components.buttons.<position>.example` when
                `template_variables_invalid` refuses an example.
              example: components.buttons.0.example
            doc_url:
              type: string
              description: Link to the documentation of the code, when available.
            details:
              type: object
              additionalProperties:
                oneOf:
                  - type: string
                  - type: number
              description: >-
                Actionable values, such as `limit`, `used` and `resets_at` in
                `message_quota_exceeded`, or `reason`, which tells apart the
                causes behind one code, in errors such as `invalid_recipient`
                and `template_variables_invalid`. See [Actionable
                details](/en/errors/overview#actionable-details).
            request_id:
              type: string
              description: Request ID. Quote it when you contact support.
              example: req_01J8ZK9M3Q7XABCDEFGHJKMNPQ
          description: Error details.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Project API key, in the format `rt_live_...` or `rt_test_...`, sent as
        `Authorization: Bearer <key>`.
    partnerAuth:
      type: http
      scheme: bearer
      description: >-
        Partner key, in the format `rt_partner_...`, sent as `Authorization:
        Bearer <key>`. It only works on the `/v1/partner/*` routes. A project
        key does not work on them, and a partner key does not work on any other
        route.

````

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