# 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
- Replace the
`format`
 or the authentication configuration

Endpoint: PUT /hooks/{hookId}
Version: 1.6.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 payload format.
    Enum: "immofacile", "zapier", "null"

## 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)
    Payload format of the deliveries. Defaults to `immofacile`.
    Enum: "immofacile", "zapier"

  - `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)
    Access denied. The error `code` is always `FORBIDDEN`; the `message` gives the cause:
- `You do not have permission to perform this action.`
 — the access does not

hold the API pack / right required by the endpoint.
- `Insufficient scope for this request.`
 — the resource targeted by the request

(user, customer, product, agency, transaction, ...) is outside the scope of

the authenticated access.
- `Access denied for this editor.`
 /
`Your IP address has been blocked.`
 —

editor or IP restriction.

## Response 403 fields (application/json):

  - `error` (object)

  - `error.code` (string, required)

  - `error.message` (string, required)

## Response 404:

  - `404` (unknown)
    Resource not found. The error `code` is `RESOURCE_NOT_FOUND` and the `message`
names the missing resource.

## 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)

## Response 403 examples:

  - `Missing API pack / right` (unknown)

  - `Resource outside the scope of the access` (unknown)

