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

# Update a webhook subscription

> Scope `api_keys:write`. `agent_id` cannot be changed — sending it is a 400. A `headers` update replaces the whole object, because values are never readable and so cannot be merged client-side.



## OpenAPI

````yaml /api-reference/openapi.json patch /webhooks/subscriptions/{subscription_id}
openapi: 3.1.0
info:
  title: Lehar API
  version: v0
  description: >-
    Customer-facing REST API for the Lehar voice-AI platform. Platform-admin
    endpoints are intentionally excluded from this reference. Regenerate with
    `npm run sync:openapi`.
servers:
  - url: https://api.lehar.ai/ca/api/v0
security:
  - ApiKeyAuth: []
  - BearerAuth: []
paths:
  /webhooks/subscriptions/{subscription_id}:
    patch:
      tags:
        - Webhook Subscriptions
      summary: Update a webhook subscription
      description: >-
        Scope `api_keys:write`. `agent_id` cannot be changed — sending it is a
        400. A `headers` update replaces the whole object, because values are
        never readable and so cannot be merged client-side.
      operationId: >-
        update_subscription_ca_api_v0_webhooks_subscriptions__subscription_id__patch
      parameters:
        - name: subscription_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                events:
                  type: array
                  items:
                    type: string
                    enum:
                      - call_started
                      - call_completed
                      - recording_completed
                description:
                  type: string
                status:
                  type: string
                  enum:
                    - active
                    - disabled
                headers:
                  type: object
                  description: Replaces every header on this subscription.
                  additionalProperties:
                    type: string
                signing_enabled:
                  type: boolean
                  description: >-
                    Turning it on mints a secret and returns it once. Turning it
                    on when already on is a no-op, not a rotation. Turning it
                    off clears the secret.
                rotate_signing_secret:
                  type: boolean
                  description: Mint a fresh secret and return it once.
                payload_format:
                  type: string
                  enum:
                    - native
                    - ringg
            example:
              status: disabled
      responses:
        '200':
          description: >-
            Updated subscription. Carries `signing_secret` only when this
            request minted one.
        '400':
          description: >-
            Unsupported change, e.g. an attempt to move the subscription to
            another agent.
        '404':
          description: Not found
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    BearerAuth:
      type: http
      scheme: bearer

````