# Update a search request

Partially updates a search request for a customer.

Only provided fields are modified. Criteria are replaced entirely when provided
(not merged with existing ones).

Endpoint: PATCH /customers/{customerId}/search-requests/{searchRequestId}
Version: 1.6.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer opaque

## Path parameters:

  - `customerId` (integer, required)
    ID of the customer.

  - `searchRequestId` (integer, required)
    ID of the search request to update.

## Request fields (application/json):

  - `name` (string | null)
    Label for the search request.
    Example: Apartment T3 Paris 15 budget 400k

  - `comment` (string | null)
    Internal note about this search request.
    Example: Client flexible on surface, priority is location near metro

  - `is_active` (boolean | null)
    Whether the search request is active.
    Example: true

  - `has_email_alert` (boolean | null)
    Send email alerts when matching properties are found.
    Example: true

  - `has_sms_alert` (boolean | null)
    Send SMS alerts when matching properties are found.
    Example: false

  - `intended_use_id` (integer | null)
    Intended use.

  - `reason_for_purchase_id` (integer | null)
    Reason-for-purchase list value ID (liste 35).

  - `current_resale_id` (integer | null)
    Current-resale list value ID (liste 77).

  - `timeframe_id` (integer | null)
    Timeframe list value ID (liste 4).

  - `keyword` (string | null)

  - `wording` (string | null)
    **Deprecated.** Use `name`.

  - `alertEmail` (boolean | null)
    **Deprecated.** Use `has_email_alert`.

  - `alertSms` (boolean | null)
    **Deprecated.** Use `has_sms_alert`.

  - `criteria` (array | null)
    Replacement criteria array. Same format as create.
**Replaces** all existing criteria when provided.

  - `criteria.id` (string, required)

  - `criteria.operator` (string, required)
    Enum: "CONTIENT", "SUPERIEUR", "INFERIEUR", "EGAL", "DIFFERENT"

  - `criteria.value` (any, required)
    Value depends on criteria type.

## Response 204:

  - `204` (unknown)
    Search request updated

## Response 400:

  - `400` (unknown)
    Invalid criteria

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

