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

# Update webhook

> Updates an existing webhook (URL, events or enabled status).



## OpenAPI

````yaml /en/api-reference/openapi.json patch /instances/{id}/webhooks/{webhookId}
openapi: 3.1.0
info:
  title: Zapfy API
  description: >-
    Multi-tenant WhatsApp API. Send messages and manage webhooks through a
    single surface.
  version: 1.0.0
servers:
  - url: https://api.zapfy.io/v1
security:
  - accountToken: []
paths:
  /instances/{id}/webhooks/{webhookId}:
    parameters:
      - $ref: '#/components/parameters/InstanceId'
      - $ref: '#/components/parameters/WebhookId'
    patch:
      tags:
        - Webhooks
      summary: Update webhook
      description: Updates an existing webhook (URL, events or enabled status).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                events:
                  type: array
                  items:
                    $ref: '#/components/schemas/WebhookEvent'
                enabled:
                  type: boolean
      responses:
        '200':
          description: Webhook updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Webhook'
        '401':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
components:
  parameters:
    InstanceId:
      name: id
      in: path
      required: true
      description: Instance ID.
      schema:
        type: string
    WebhookId:
      name: webhookId
      in: path
      required: true
      description: Webhook ID.
      schema:
        type: string
  schemas:
    WebhookEvent:
      type: string
      enum:
        - MESSAGE_RECEIVED
        - MESSAGE_SENT
        - MESSAGE_STATUS
        - CONNECTION_UPDATE
        - QRCODE_UPDATED
      description: >-
        Event type. `MESSAGE_RECEIVED` = incoming message; `MESSAGE_SENT` =
        message sent by the instance; `MESSAGE_STATUS` = delivery/read status
        change; `CONNECTION_UPDATE` = instance connection change;
        `QRCODE_UPDATED` = new QR Code to pair.
    Webhook:
      type: object
      properties:
        id:
          type: string
          example: 01J9Z...
          description: Webhook identifier.
        url:
          type: string
          example: https://your-app.com/webhooks
          description: HTTPS URL that receives the events.
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
          description: Events subscribed by this webhook.
        enabled:
          type: boolean
          example: true
          description: Whether the webhook is active.
        createdAt:
          type: string
          format: date-time
          description: Creation date (ISO 8601).
  responses:
    Error:
      description: Error.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Instance not found
  securitySchemes:
    accountToken:
      type: http
      scheme: bearer
      description: Account token (`zpfy_acct_...`) — manages instances and webhooks.

````