# Listar negocios

GET `https://api.bydomu.com/v1/deals`

Negocios de la organización con filtros y paginación por página o por cursor (`pageSize` máximo 500). `status` acepta varios valores separados por comas.

Permiso que pide

`deals:read`

Encabezado obligatorio

`X-API-Key` · clave secreta

Nivel de acceso

Nivel 2 · automático en Inmobiliaria Pro

## Parámetros de consulta

19 · todos opcionales

`search` string · opcional

Título o código del negocio

`propertyId` string · opcional

Negocios vinculados a esta propiedad

`status` string[] · opcional

Estados, separados por comas OPEN · WON · LOST · nullable

`stageId` string · opcional

Negocios en esta etapa

**Ver los otros 15 parámetros**

`pipelineId` string · opcional

Negocios en este pipeline (si no se manda `stageId`)

`orphan` boolean · opcional

Negocios sin pipeline. Cualquier valor no vacío (incluso `false`) cuenta como verdadero nullable

`agentId` string · opcional

Agente responsable

`contactId` string · opcional

Contacto del negocio

`tagId` string · opcional

Con esta etiqueta

`valueMin` number · opcional

Valor mínimo ≥ 0 · nullable

`valueMax` number · opcional

Valor máximo ≥ 0 · nullable

`expectedCloseAfter` string · opcional

Cierre esperado desde esta fecha (ISO 8601)

`expectedCloseBefore` string · opcional

Cierre esperado hasta esta fecha (ISO 8601)

`page` integer · opcional

Página, desde 1 por defecto 1 · ≥ 1

`pageSize` integer · opcional

Negocios por página (máximo 500) por defecto 20 · 1–500

`cursor` string · opcional

Paginación por cursor: el `meta.nextCursor` de la respuesta anterior

`includeTotal` boolean | string · opcional

`false` para no contar el total (más rápido)

`sortBy` string · opcional

Campo de orden (por defecto `createdAt`) por defecto "createdAt"

`sortOrder` string · opcional

Dirección del orden asc · desc · por defecto "desc"

## Respuesta 200

`Deal[]` · 28 campos

**`data[]` id · code · title · value · currency · probability · status · closedAt · expectedCloseDate · lostReason · lostReasonCategory · intent · budgetMin · budgetMax · preferredZones · propertyTypes · leadSource · notes · agentId · contactId · createdAt · updatedAt · contact · agent · placements · properties · tags · lease**

`id` string

`code` string Código legible del negocio

`title` string

`value` string Número decimal serializado como texto.

`currency` string

`probability` integer

`status` string OPEN, WON, LOST

`closedAt` string

`expectedCloseDate` string

`lostReason` string

`lostReasonCategory` string

`intent` string PURCHASE, RENT, BOTH, SELLER

`budgetMin` string Número decimal serializado como texto.

`budgetMax` string Número decimal serializado como texto.

`preferredZones` string[]

`propertyTypes` string[]

`leadSource` string REFERRAL, PORTAL, SOCIAL, COLD, OTHER

`notes` string

`agentId` string

`contactId` string

`createdAt` string

`updatedAt` string

**`contact` id · firstName · lastName · phone · email · source · score · budget**

`id` string

`firstName` string

`lastName` string

`phone` string `null` si el contacto llegó por un canal sin número (Instagram, Facebook, chat de la web, correo o WhatsApp con usuario y número oculto)

`email` string

`source` string WHATSAPP, METROCUADRADO, FINCARAIZ, WEBSITE, REFERRAL, WALK_IN

`score` integer

`budget` string Número decimal serializado como texto.

**`agent` id · firstName · lastName**

`id` string

`firstName` string

`lastName` string

**`placements[]` id · pipelineId · stageId · stageOrder · stageEnteredAt · stage · pipeline**

`id` string

`pipelineId` string

`stageId` string

`stageOrder` integer

`stageEnteredAt` string

**`stage` id · name · color · order · isWon · isLost**

`id` string

`name` string

`color` string

`order` integer

`isWon` boolean

`isLost` boolean

**`pipeline` id · name**

`id` string

`name` string

**`properties[]` propertyId · property**

`propertyId` string

**`property` id · title · price · currency · type · transactionType · status · city**

`id` string

`title` string

`price` string Número decimal serializado como texto.

`currency` string

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

`transactionType` string SALE, RENT, SALE_OR_RENT

`status` string DRAFT, ACTIVE, RESERVED, SOLD, RENTED, INACTIVE

`city` string

**`tags[]` dealId · tagId · tag**

`dealId` string

`tagId` string

**`tag` id · name · color**

`id` string

`name` string

`color` string

**`lease` id · status**

`id` string

`status` string

**`meta` Paginación por página (`page`) o por cursor (`cursor` = `nextCursor` de la respuesta anterior). Con cursor no se cuenta el total, que es lo más rápido para recorrer todo.**

`total` integer Total de registros. `null` al paginar con `cursor` o con `includeTotal=false`.

`page` integer

`pageSize` integer

`totalPages` integer `null` cuando no se contó el total.

`nextCursor` string Pásalo como `cursor` para pedir la página siguiente. `null` en la última.

`hasMore` boolean Hay más registros después de esta página.

## Errores posibles

con la forma `{ "error": { "code", "message" } }`

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

cURL:

```bash
curl "https://api.bydomu.com/v1/deals" \
  -H "X-API-Key: $BYDOMU_API_KEY"
```

JavaScript:

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

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

const { data, meta } = await bydomu.deals.list();
```

Python:

```python
import os, requests

r = requests.get(
    "https://api.bydomu.com/v1/deals",
    headers={"X-API-Key": os.environ["BYDOMU_API_KEY"]}
)
data = r.json()
```

**Respuesta · 200 · ejemplo**

```json
{
  "data": [
    {
      "id": "clx1deal001",
      "code": "N-0031",
      "title": "Venta Apto Chapinero - María González",
      "value": "350000000.00",
      "currency": "COP",
      "probability": 40,
      "status": "OPEN",
      "closedAt": "2026-10-30T18:00:00.000Z",
      "expectedCloseDate": "2026-11-30T00:00:00.000Z",
      "lostReason": "Compró con otra inmobiliaria",
      "lostReasonCategory": "COMPETENCIA",
      "intent": "PURCHASE",
      "budgetMin": "300000000.00",
      "budgetMax": "400000000.00",
      "preferredZones": [
        "Chapinero"
      ],
      "propertyTypes": [
        "APARTMENT"
      ],
      "leadSource": "REFERRAL",
      "notes": "Pre-aprobada para crédito hipotecario.",
      "agentId": "clx1usr001",
      "contactId": "clx1con001",
      "createdAt": "2026-09-01T08:00:00.000Z",
      "updatedAt": "2026-09-25T16:45:00.000Z",
      "contact": {
        "id": "clx1con001",
        "firstName": "María",
        "lastName": "González",
        "phone": "+573001234567",
        "email": "maria.gonzalez@email.com",
        "source": "WHATSAPP",
        "score": 75,
        "budget": "350000000.00"
      },
      "agent": {
        "id": "clx1usr001",
        "firstName": "Carlos",
        "lastName": "Rodríguez"
      },
      "placements": [
        {
          "id": "clx1plc001",
          "pipelineId": "clx1pip001",
          "stageId": "clx1stg002",
          "stageOrder": 0,
          "stageEnteredAt": "2026-09-20T10:00:00.000Z",
          "stage": {
            "id": "clx1stg002",
            "name": "Visita",
            "color": "#6366F1",
            "order": 1,
            "isWon": false,
            "isLost": false
          },
          "pipeline": {
  …
```
