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

# Update a webhook endpoint

> Update URL and/or enabled state of a webhook endpoint.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/webhooks/endpoints/{endpoint_id}
openapi: 3.1.0
info:
  title: Kayle ID
  version: 1.5.0
  description: Privacy-first identity verification.
  license:
    name: Apache License 2.0
    url: https://github.com/kayleai/kayle-id/blob/main/LICENSE
  contact:
    name: Kayle ID
    url: https://kayle.id
    email: help@kayle.id
  termsOfService: https://kayle.id/terms
servers:
  - url: http://127.0.0.1:8787
    description: ''
security:
  - bearerAuth: []
paths:
  /v1/webhooks/endpoints/{endpoint_id}:
    patch:
      tags:
        - Webhooks
      summary: Update a webhook endpoint
      description: Update URL and/or enabled state of a webhook endpoint.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            pattern: ^[A-Za-z0-9_-]+$
            description: The ID of the webhook endpoint to update (e.g. whe_...).
          required: true
          description: The ID of the webhook endpoint to update (e.g. whe_...).
          name: endpoint_id
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookEndpointRequest'
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Webhook Endpoint'
                  error:
                    type: 'null'
                required:
                  - data
                  - error
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                    description: Empty data object.
                  error:
                    type:
                      - object
                      - 'null'
                    properties:
                      code:
                        type: string
                        description: The error code
                      message:
                        type: string
                        description: The error message
                      hint:
                        type: string
                        description: A hint to help the user fix the error
                      docs:
                        type: string
                        description: A link to the documentation for the error
                    required:
                      - code
                      - message
                      - hint
                      - docs
                required:
                  - data
                  - error
                example:
                  data: null
                  error:
                    code: BAD_REQUEST
                    message: Bad request.
                    hint: >-
                      At least one of `name`, `labels`, `url`, `enabled`,
                      `subscribed_event_types` or
                      `undelivered_payload_retention_hours` must be provided.
                    docs: https://kayle.id/docs/api/webhooks/endpoints#update
        '404':
          description: Webhook endpoint not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                    description: Empty data object.
                  error:
                    type:
                      - object
                      - 'null'
                    properties:
                      code:
                        type: string
                        description: The error code
                      message:
                        type: string
                        description: The error message
                      hint:
                        type: string
                        description: A hint to help the user fix the error
                      docs:
                        type: string
                        description: A link to the documentation for the error
                    required:
                      - code
                      - message
                      - hint
                      - docs
                required:
                  - data
                  - error
                example:
                  data: null
                  error:
                    code: NOT_FOUND
                    message: Webhook endpoint not found.
                    hint: The webhook endpoint with the given ID was not found.
                    docs: https://kayle.id/docs/api/webhooks/endpoints#update
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: 'null'
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - INTERNAL_SERVER_ERROR
                      message:
                        type: string
                        enum:
                          - Internal server error.
                      hint:
                        type: string
                        enum:
                          - The server encountered an error.
                      docs:
                        type: string
                        enum:
                          - https://kayle.id/docs/api/errors
                    required:
                      - code
                      - message
                      - hint
                      - docs
                required:
                  - data
                  - error
      security:
        - bearerAuth: []
components:
  schemas:
    UpdateWebhookEndpointRequest:
      type: object
      properties:
        name:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 120
          description: Updated display name for the webhook endpoint.
        labels:
          type: array
          items:
            type: string
          maxItems: 8
          description: Updated tag-style purpose labels for the endpoint.
        url:
          type: string
          maxLength: 2048
          description: >-
            New URL for the webhook endpoint. Must use https:// (http:// is only
            accepted for localhost in development).
        enabled:
          type: boolean
          description: New enabled state for the webhook endpoint.
        subscribed_event_types:
          type: array
          items:
            type: string
            enum:
              - verification.session.succeeded
              - verification.session.failed
              - verification.session.expired
              - verification.session.cancelled
          description: The updated event subscriptions for the endpoint.
        undelivered_payload_retention_hours:
          anyOf:
            - type: number
              enum:
                - 0
            - type: number
              enum:
                - 24
            - type: number
              enum:
                - 72
            - type: number
              enum:
                - 168
          description: >-
            How long Kayle should retain encrypted undelivered payloads after
            terminal delivery failure.
    Webhook Endpoint:
      type: object
      properties:
        id:
          type: string
          description: The ID of the webhook endpoint
        organization_id:
          type: string
          description: The ID of the organization that owns this endpoint
        name:
          type:
            - string
            - 'null'
          description: An optional display name for the webhook endpoint.
        labels:
          type: array
          items:
            type: string
          maxItems: 8
          description: Tag-style purpose labels for this endpoint.
        url:
          type: string
          format: uri
          description: The URL of the webhook endpoint
        enabled:
          type: boolean
          description: Whether the webhook endpoint is enabled
        subscribed_event_types:
          type: array
          items:
            type: string
            enum:
              - verification.session.succeeded
              - verification.session.failed
              - verification.session.expired
              - verification.session.cancelled
          description: >-
            The event types this endpoint is subscribed to. Supported values:
            verification.session.succeeded, verification.session.failed,
            verification.session.expired, verification.session.cancelled.
        undelivered_payload_retention_hours:
          anyOf:
            - type: number
              enum:
                - 0
            - type: number
              enum:
                - 24
            - type: number
              enum:
                - 72
            - type: number
              enum:
                - 168
          default: 72
          description: >-
            How long Kayle retains encrypted payloads after terminal delivery
            failure.
        created_at:
          type: string
          description: The time the webhook endpoint was created
        updated_at:
          type: string
          description: The time the webhook endpoint was last updated
        disabled_at:
          type:
            - string
            - 'null'
          description: The time the webhook endpoint was disabled, null if enabled
      required:
        - id
        - organization_id
        - name
        - labels
        - url
        - enabled
        - subscribed_event_types
        - created_at
        - updated_at
        - disabled_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````