# Enviar preferencias del buscador

POST `https://api.bydomu.com/v1/finder`

This reference is generated from the API’s code, so descriptions are in Spanish. Names, parameters and examples are the same in every language.

Registra lo que busca un prospecto (tipo, zona, presupuesto, características) como contacto y devuelve hasta 12 propiedades que encajan, con su puntaje y el detalle del cálculo. Dispara el webhook `FINDER_SUBMITTED`.

Permission required

`finder:write`

Required header

`X-API-Key` · publishable or secret key

Access level

Level 1 · no request

## Headers

1 · all optional

`Idempotency-Key` string · optional

Clave única de la operación (8-128 caracteres de `[a-zA-Z0-9._:-]`). Un reintento con la misma clave y el mismo cuerpo devuelve la respuesta original sin repetir la operación. Vive 24 horas. 8–128 chars

## Body (JSON)

15 · 4 required

`transactionType` string · **required**

SALE · RENT

`propertyType` string · **required**

APARTMENT · HOUSE · OFFICE · COMMERCIAL · LAND · WAREHOUSE · ROOM · FARM · OTHER

`firstName` string · **required**

2–100 chars

`phone` string · **required**

7–20 chars

`city` string · optional

≤ 100 chars

`neighborhood` string · optional

≤ 100 chars

**See the other 9 parameters**

`budgetMin` number · optional

≥ 0 · nullable

`budgetMax` number · optional

≥ 0 · nullable

`minBedrooms` integer · optional

≥ 0 · nullable

`minBathrooms` integer · optional

≥ 0 · nullable

`minArea` number · optional

≥ 0 · nullable

`amenities` string[] · optional

`email` string | string · optional

`message` string · optional

≤ 1000 chars

`subscribedToAlerts` boolean · optional

default false

## Response 201

`FinderResult` · 3 fields

**`data` contact · properties · total**

**`contact` id**

`id` string

**`properties[]` Hasta 12 propiedades, de mejor a peor puntaje**

`id` string

`code` string

`title` string

`type` string APARTMENT, HOUSE, OFFICE, COMMERCIAL, LAND, WAREHOUSE

`transactionType` string SALE, RENT, SALE_OR_RENT

`price` number

`currency` string

`city` string

`neighborhood` string

`bedrooms` integer

`bathrooms` integer

`area` number

`matchScore` integer Qué tan bien encaja (0-100)

**`breakdown[]` criterio · puntos · estado**

`criterio` string

`puntos` integer

`estado` string match, partial, mismatch, unknown

`image` string

`total` integer Propiedades que encajan

## Possible errors

shaped as `{ "error": { "code", "message" } }`

- **400** Datos inválidos: el cuerpo o la query no cumplen el esquema, o `Idempotency-Key` está mal formada.
- **401** UNAUTHORIZED
- **402** PAYMENT_REQUIRED
- **403** FORBIDDEN
- **409** DUPLICATE
- **429** RATE_LIMITED
- **500** INTERNAL_ERROR

cURL:

```bash
curl -X POST "https://api.bydomu.com/v1/finder" \
  -H "X-API-Key: $BYDOMU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "transactionType": "SALE",
  "propertyType": "APARTMENT",
  "city": "Bogotá",
  "neighborhood": "Chapinero",
  "budgetMin": 250000000,
  "budgetMax": 400000000,
  "minBedrooms": 2,
  "amenities": [
    "parking",
    "gym"
  ],
  "firstName": "Juan",
  "phone": "+573005551234",
  "subscribedToAlerts": true
}'
```

JavaScript:

```js
import { ByDomu } from "@bydomu/sdk";

const bydomu = new ByDomu({
  apiKey: process.env.BYDOMU_API_KEY,
});

const { data } = await bydomu.finder.submit({
  "transactionType": "SALE",
  "propertyType": "APARTMENT",
  "city": "Bogotá",
  "neighborhood": "Chapinero",
  "budgetMin": 250000000,
  "budgetMax": 400000000,
  "minBedrooms": 2,
  "amenities": [
    "parking",
    "gym"
  ],
  "firstName": "Juan",
  "phone": "+573005551234",
  "subscribedToAlerts": true
});
```

Python:

```python
import os, requests

r = requests.post(
    "https://api.bydomu.com/v1/finder",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]},
    json={
        "transactionType": "SALE",
        "propertyType": "APARTMENT",
        "city": "Bogotá",
        "neighborhood": "Chapinero",
        "budgetMin": 250000000,
        "budgetMax": 400000000,
        "minBedrooms": 2,
        "amenities": [
            "parking",
            "gym"
        ],
        "firstName": "Juan",
        "phone": "+573005551234",
        "subscribedToAlerts": True
    }
)
data = r.json()
```

**Response · 201 · example**

```json
{
  "data": {
    "contact": {
      "id": "clx1con009"
    },
    "properties": [
      {
        "id": "clx1prop001",
        "code": "P-0042",
        "title": "Apartamento en Chapinero con vista",
        "type": "APARTMENT",
        "transactionType": "SALE",
        "price": 450000000,
        "currency": "COP",
        "city": "Bogotá",
        "neighborhood": "Chapinero",
        "bedrooms": 3,
        "bathrooms": 2,
        "area": 85,
        "matchScore": 87,
        "breakdown": [
          {
            "criterio": "Presupuesto",
            "puntos": 30,
            "estado": "match"
          }
        ],
        "image": "https://cdn.bydomu.com/props/clx1prop001/1.jpg"
      }
    ],
    "total": 7
  }
}
```
