# Change Event Notification Settings

Replace the complete location-wide URL set and apply one event-flag set to every supplied destination. Omitted flags default to 0. Requires webhook settings read access and permission to edit the location. A location-level webhook feature restriction can also deny the write. Read `url_settings` first: existing URLs may have different flags, and this POST overwrites them all. The response reports saved configuration, not delivery success.

Endpoint: POST /hooks_settings/{location_id}
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (number, required)
    location ID

## Header parameters:

  - `Accept` (string, required)
    e.g. application/vnd.api.v2+json

  - `Content-Type` (string, required)
    application/json

  - `Authorization` (string, required)
    Bearer partner_token, User user_token

## Request fields (application/json):

  - `urls` (array, required)
    Complete replacement list: 1–10 distinct nonempty URLs after trimming and duplicate removal. The backend checks only for an http or https prefix; supply a valid HTTPS URL for each receiver.

  - `active` (number, required)
    1 - notifications are active, 0 - not active

  - `salon` (number)
    1 - send events by location entity, 0 - do not send

  - `service_category` (number)
    1 - send events by service category entity, 0 - do not send

  - `service` (number)
    1 - send events by service entity, 0 - do not send

  - `good` (number)
    1 - send events by product entity, 0 - don't send

  - `master` (number)
    1 - send events by team member entity, 0 - don't send

  - `client` (number)
    1 - send events by client entity, 0 - don't send

  - `record` (number)
    1 - send events by appointment entity, 0 - do not send

  - `schedule` (number)
    1 - send schedule update events, 0 - do not send

  - `loyalty_card` (number)
    1 - send loyalty card events, 0 - do not send

  - `goods_operations_sale` (number)
    1 - send events by the product sale entity, 0 - do not send

  - `goods_operations_receipt` (number)
    1 - send events by the entity arrival of products, 0 - do not send

  - `goods_operations_consumable` (number)
    1 - send events by the consumable write-off entity, 0 - do not send

  - `goods_operations_stolen` (number)
    1 - send events by the product write-off entity, 0 - do not send

  - `goods_operations_move` (number)
    1 - send events by the product movement entity, 0 - no send

  - `finances_operation` (number)
    1 - send events by entity financial operation, 0 - no send

  - `self_sending` (number)
    1 - The webhook creator will receive events triggered by their own actions, 0 - The webhook creator will not receive events triggered by their own actions

## Response 201:

  - `201` (unknown)
    Created

## Response 201 fields (application/json):

  - `success` (boolean)
    Execution success status (true)

  - `data` (object)
    Object with data

  - `data.company_id` (integer)
    Location ID.

  - `data.urls` (array)
    Configured webhook destination URLs.

  - `data.url_settings` (array)
    Actual event settings for each URL. Top-level flags describe only the first URL.

  - `data.url_settings.url` (string)
    Destination URL.

  - `data.url_settings.active` (integer)
    1 - notifications are active, 0 - inactive.

  - `data.url_settings.salon` (integer)
    1 - location events are enabled, 0 - disabled.

  - `data.url_settings.service_category` (integer)

  - `data.url_settings.service` (integer)

  - `data.url_settings.good` (integer)

  - `data.url_settings.master` (integer)

  - `data.url_settings.client` (integer)

  - `data.url_settings.record` (integer)

  - `data.url_settings.schedule` (integer)

  - `data.url_settings.loyalty_card` (integer)

  - `data.url_settings.goods_operations_sale` (integer)

  - `data.url_settings.goods_operations_receipt` (integer)

  - `data.url_settings.goods_operations_consumable` (integer)

  - `data.url_settings.goods_operations_stolen` (integer)

  - `data.url_settings.goods_operations_move` (integer)

  - `data.url_settings.finances_operation` (integer)

  - `data.url_settings.self_sending` (integer)
    1 - receive events caused by the webhook creator, 0 - suppress them.

  - `data.active` (integer)
    1 - notifications are active, 0 - not active

  - `data.salon` (integer)
    1 - send events by location entity, 0 - do not send

  - `data.service_category` (integer)
    1 - send events by service category entity, 0 - do not send

  - `data.service` (integer)
    1 - send events by service entity, 0 - do not send

  - `data.good` (integer)
    1 - send events by product entity, 0 - don't send

  - `data.master` (integer)
    1 - send events by team member entity, 0 - don't send

  - `data.client` (integer)
    1 - send events by client entity, 0 - don't send

  - `data.record` (integer)
    1 - send events by appointment entity, 0 - do not send

  - `data.schedule` (integer)
    1 - send schedule update events, 0 - do not send

  - `data.loyalty_card` (integer)
    1 - send loyalty card events, 0 - do not send

  - `data.goods_operations_sale` (integer)
    1 - send events by the product sale entity, 0 - do not send

  - `data.goods_operations_receipt` (integer)
    1 - send events by the entity arrival of products, 0 - do not send

  - `data.goods_operations_consumable` (integer)
    1 - send events by the consumable write-off entity, 0 - do not send

  - `data.goods_operations_stolen` (integer)
    1 - send events by the product write-off entity, 0 - do not send

  - `data.goods_operations_move` (integer)
    1 - send events by the product movement entity, 0 - no send

  - `data.finances_operation` (integer)
    1 - send events by entity financial operation, 0 - no send

  - `data.self_sending` (integer)
    1 - receive events caused by the webhook creator, 0 - suppress them

  - `meta` (array)
    Metadata (empty array)

## Response 400:

  - `400` (unknown)
    Invalid webhook settings or destination URLs

## Response 400 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: An error has occurred.

  - `meta.errors` (array)
    Set of a validation error messages.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

