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

# Update webhook

> Update webhook configuration. Requires `webhooks:write`; setting retrieval events or re-enabling a retrieval subscription also requires `retrievals:read`. Re-enabling clears `auto_disabled_at` and resets `consecutive_failures`.



## OpenAPI

````yaml PATCH /v2/webhooks/{id}
openapi: 3.0.1
info:
  title: Tavrn Platform API
  version: 1.0.0
  description: >-
    Enterprise API for medical record retrieval: cases, retrieval requests,
    retrieved records and provider invoices, case documents, and webhook
    notifications.
  contact:
    name: Tavrn Support
    email: contact@tavrn.ai
servers:
  - url: https://enterprise.tavrn.ai
    description: Production server
security:
  - bearerAuth: []
tags:
  - name: Cases
    description: Case management operations
  - name: Documents
    description: Document upload and management
  - name: Retrieval Requests
    description: Medical record retrieval requests submitted to healthcare facilities
  - name: Requestors
    description: Multiple retrieval profiles within one organization
  - name: Webhooks
    description: Webhook registration and event notifications
paths:
  /v2/webhooks/{id}:
    patch:
      tags:
        - Webhooks
      summary: Update webhook
      description: >-
        Update webhook configuration. Requires `webhooks:write`; setting
        retrieval events or re-enabling a retrieval subscription also requires
        `retrievals:read`. Re-enabling clears `auto_disabled_at` and resets
        `consecutive_failures`.
      operationId: updateWebhook
      parameters:
        - name: id
          in: path
          required: true
          description: Webhook ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookUpdate'
      responses:
        '200':
          description: Webhook updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The API key lacks a scope required by the requested events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Webhook not found. Ids that belong to another organization are
            indistinguishable from unknown ids.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: A webhook with this name already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    WebhookUpdate:
      type: object
      minProperties: 1
      properties:
        name:
          type: string
          minLength: 1
          description: Webhook name, unique within your organization
          example: Production webhook
          maxLength: 100
        url:
          type: string
          format: uri
          description: Webhook endpoint URL (must use HTTP/HTTPS)
          maxLength: 2048
        events:
          type: array
          items:
            type: string
            enum:
              - retrieval_request.status_changed
              - retrieval_request.action_required
              - retrieval_request.documents_available
          minItems: 1
          description: Event types to subscribe to
        description:
          type: string
          nullable: true
          description: Optional webhook description
          maxLength: 500
        is_enabled:
          type: boolean
          description: Enable or disable webhook
    Webhook:
      type: object
      required:
        - id
        - name
        - url
        - description
        - events
        - is_enabled
        - consecutive_failures
        - last_failure_at
        - last_success_at
        - auto_disabled_at
        - last_failure
        - secret_hint
        - created_by
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: Opaque webhook identifier.
          example: 507f1f77bcf86cd799439016
        name:
          type: string
          description: Webhook name, unique within your organization
          example: Production webhook
        url:
          type: string
          format: uri
          description: Webhook endpoint URL (must use HTTP/HTTPS)
          example: https://client.example.com/webhooks/tavrn
        events:
          type: array
          items:
            type: string
            enum:
              - retrieval_request.status_changed
              - retrieval_request.action_required
              - retrieval_request.documents_available
          description: >-
            Subscribed event types. New and updated subscriptions require at
            least one event.
          example:
            - retrieval_request.status_changed
            - retrieval_request.documents_available
        description:
          type: string
          nullable: true
          description: Optional webhook description
          example: Production webhook for retrieval events
        is_enabled:
          type: boolean
          description: Whether webhook is enabled
          example: true
        consecutive_failures:
          type: integer
          description: Count of consecutive events that failed after all delivery attempts
          example: 0
        last_failure_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            Last event that failed after all delivery attempts (ISO 8601), or
            null
        last_success_at:
          type: string
          format: date-time
          nullable: true
          description: Last successful event delivery (ISO 8601), or null
        auto_disabled_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When Tavrn automatically disabled this webhook after 5 consecutive
            failed deliveries (ISO 8601), or null. Cleared when you set
            `is_enabled` to `true`.
        last_failure:
          type: object
          nullable: true
          description: >-
            Most recent unsuccessful delivery attempt, or null. Test events are
            excluded.
          required:
            - at
            - status_code
            - error
            - event_type
          properties:
            at:
              type: string
              format: date-time
              description: When the attempt was made (ISO 8601)
              example: '2026-10-07T17:30:00.000Z'
            status_code:
              type: integer
              nullable: true
              description: >-
                HTTP status returned by your endpoint, or null if no response
                was received
              example: 502
            error:
              type: string
              nullable: true
              description: Reason for the unsuccessful delivery attempt.
              example: HTTP 502
            event_type:
              type: string
              description: Event type of the failed delivery
              example: retrieval_request.status_changed
        secret_hint:
          type: string
          description: Last 4 characters of webhook secret (for identification)
          example: ...Ab12
        created_by:
          type: string
          description: User or API key that created the webhook
        created_at:
          type: string
          format: date-time
          description: Creation timestamp (ISO 8601)
          example: '2025-02-01T12:34:56Z'
        updated_at:
          type: string
          format: date-time
          description: Last update timestamp (ISO 8601)
          example: '2025-02-01T12:34:56Z'
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: validation_error
            message:
              type: string
              description: Human-readable error message
              example: The patient.date_of_birth field is required
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key authentication. Use format: `Authorization: Bearer
        tavrn_sk_live_...`

````