# Create a search request

Creates a search request for a customer with criteria.

Search requests define what a buyer/tenant is looking for. When active, the system
runs automatic matching against new property listings.

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

## Security:

  - `bearerAuth` (unknown)
    http bearer opaque

## Path parameters:

  - `customerId` (integer, required)
    ID of the customer to attach the search request to.

## 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, required)
    Array of search criteria. Each criterion has an `id`, an `operator`, and a `value`.
**Operators:**
| Operator | Description | Example use |
|  --- | --- | --- |
| `EGAL` | Equals (exact match) | Transaction type, property category |
| `SUPERIEUR` | Greater than or equal | Min surface, min rooms |
| `INFERIEUR` | Less than or equal | Max price, max floor |
| `CONTIENT` | Contains (multi-value) | Zones, cities |
| `DIFFERENT` | Not equal | Exclude a type |

**Common criteria IDs** (use `GET /criterias/search-requests` for the full list):
| ID | Description | Type |
|  --- | --- | --- |
| 27 | Property category | UNIQUE |
| 28 | Transaction type | UNIQUE |
| 65 | Postcode City | TEXT |
| 30 | Price | NUMBER |
| 33 | Number of rooms | NUMBER |
| 34 | Living area (m²) | NUMBER |
| 38 | Bedrooms | NUMBER |
    Example: [{"id":"27","operator":"EGAL","value":"1"},{"id":"28","operator":"EGAL","value":"Vente"},{"id":"30","operator":"INFERIEUR","value":"400000"},{"id":"33","operator":"EGAL","value":"3"},{"id":"65","opera…

  - `criteria.id` (string, required)
    Criteria ID (numeric string or XML key).
Use `GET /criterias/search-requests` to list available IDs.
    Example: 27

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

  - `criteria.value` (any, required)
    Value to compare. Format depends on criteria type.
For operator "CONTIENT", multiple values can be comma-separated.
    Example: 1

## Response 201:

  - `201` (unknown)
    Search request created

## Response 201 fields (application/json):

  - `data` (object)

  - `data.id` (integer)
    ID of the created search request.

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

