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

# Update a webhook endpoint



## OpenAPI

````yaml PATCH /v1/webhook-endpoints/{endpoint_id}
openapi: 3.1.0
info:
  title: PolyAI Alerts API
  version: 1.0.0
  description: >-
    Create alert rules, inspect active alerts, register webhook endpoints, and
    receive signed webhook notifications when alert thresholds are breached.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.eu.poly.ai
    description: EU region
security:
  - ApiKeyAuth: []
paths:
  /v1/webhook-endpoints/{endpoint_id}:
    patch:
      summary: Update a webhook endpoint
      operationId: updateWebhookEndpoint
      parameters:
        - $ref: '#/components/parameters/EndpointId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWebhookEndpointRequest'
      responses:
        '200':
          description: Webhook endpoint updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookEndpoint'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    EndpointId:
      name: endpoint_id
      in: path
      required: true
      description: The endpoint_id must be a prefixed ID (e.g. whe_9ZtRcXw3nByK5pVqMaEfJs).
      schema:
        type: string
        pattern: ^whe_[A-Za-z0-9]+$
        example: whe_9ZtRcXw3nByK5pVqMaEfJs
  schemas:
    UpdateWebhookEndpointRequest:
      $ref: '#/components/schemas/UpdateWebhookEndpointAttributes'
      example:
        url: https://example.com/webhooks/polyai-v2
        enabled: false
    WebhookEndpoint:
      type: object
      required:
        - id
        - name
        - url
        - enabled
        - event_types
        - timeout_ms
        - created_at
        - updated_at
      properties:
        id:
          type: string
          pattern: ^whe_[A-Za-z0-9]+$
          example: whe_9ZtRcXw3nByK5pVqMaEfJs
        name:
          type: string
          minLength: 1
          maxLength: 255
        url:
          type: string
          format: uri
        enabled:
          type: boolean
          default: true
        event_types:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventType'
        headers:
          type: object
          additionalProperties:
            type: string
          default: {}
        timeout_ms:
          type: integer
          minimum: 1000
          maximum: 30000
          default: 5000
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    UpdateWebhookEndpointAttributes:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
        url:
          type: string
          format: uri
          pattern: ^https://
        event_types:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEventType'
          minItems: 1
        headers:
          type: object
          additionalProperties:
            type: string
        timeout_ms:
          type: integer
          minimum: 1000
          maximum: 30000
        enabled:
          type: boolean
      additionalProperties: false
    WebhookEventType:
      type: string
      enum:
        - alerts.triggered
        - alerts.resolved
    Error:
      type: object
      properties:
        message:
          type: string
  responses:
    BadRequest:
      description: Validation error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnprocessableEntity:
      description: Validation error or malformed resource ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````