# Update a webhook

Updates an existing webhook (URL, events, headers, auth).

Use this endpoint to:
- Change the target URL
- Add/remove subscribed event types
- Update authentication headers
- Reactivate a suspended webhook (update it with the corrected URL)

Endpoint: PUT /hooks/{hookId}
Version: 1.4.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer opaque

## Path parameters:

  - `hookId` (integer, required)
    ID of the webhook to update.

## Request fields (application/json):

  - `url` (string | null)
    New target URL.
    Example: https://new-portail.example.com/webhook

  - `origines` (array | null)
    Updated list of event types (replaces the current list entirely).
    Example: ["CUSTOMER_CREATE","PRODUCT_UPDATE"]

  - `headers` (object | null)
    Updated custom headers (replaces entirely).
    Example: {"X-Api-Key":"new-secret"}

  - `auth_id` (integer | null)
    Updated webhook auth configuration ID.

  - `format` (string | null)
    Updated format identifier.

## Response 200:

  - `200` (unknown)
    Webhook updated

## Response 200 fields (application/json):

  - `data` (object)
    A registered webhook subscription.

  - `data.id` (integer)
    Unique webhook identifier.
    Example: 42

  - `data.url` (string)
    Target URL that receives webhook payloads via HTTP POST.
    Example: https://portail.example.com/webhook

  - `data.headers` (object | null)
    Custom headers sent with each webhook payload request.
Use this to authenticate incoming webhook requests on your server.
    Example: {"X-Api-Key":"secret"}

  - `data.authId` (integer | null)
    ID of the linked webhook auth configuration (if any).

  - `data.format` (string | null)
    Custom format identifier for the payload (if any).

  - `data.origines` (array)
    List of subscribed event types. Only events in this list trigger
a delivery to the target URL.
    Example: ["CUSTOMER_CREATE","PRODUCT_UPDATE"]

## Response 403:

  - `403` (unknown)
    Insufficient permissions

## Response 403 fields (application/json):

  - `error` (object)

  - `error.code` (string, required)

  - `error.message` (string, required)

## Response 404:

  - `404` (unknown)
    Resource not found

## Response 404 fields (application/json):

  - `error` (object)

  - `error.code` (string, required)

  - `error.message` (string, required)

## Response 422:

  - `422` (unknown)
    Validation failed

## Response 422 fields (application/json):

  - `error` (object)

  - `error.code` (string)
    Enum: "VALIDATION_ERROR"

  - `error.message` (string)

  - `error.details` (array)

  - `error.details.field` (string)

  - `error.details.message` (string)

