Negocios
Listar negocios
GET /api/v1/crm/deals
Parámetros:
| Nombre | Tipo | Descripción |
|---|---|---|
cursor | string | Cursor de paginación |
limit | int | Items por página (default 25, máx 100) |
filter[pipeline_id] | string | UUID del pipeline |
filter[stage_id] | string | UUID de la etapa |
filter[owner_id] | string | UUID del propietario |
filter[contact_id] | string | UUID del contacto |
filter[account_id] | string | UUID de la cuenta |
filter[status] | string | open, won, lost |
sort | string | -created_at, amount, -expected_close |
Respuesta 200:
{
"data": [
{
"id": "uuid",
"pipeline_id": "uuid",
"stage_id": "uuid",
"contact_id": "uuid",
"account_id": "uuid",
"owner_id": "uuid",
"title": "Acme initial proposal",
"amount": 500000,
"currency": "PEN",
"status": "open",
"probability": 60,
"expected_close": "2026-08-01T00:00:00Z",
"lost_reason": "",
"tags": ["enterprise"],
"metadata": {},
"created_at": "2026-04-08T12:00:00Z",
"updated_at": "2026-04-08T12:00:00Z",
"closed_at": null
}
],
"meta": { "pagination": { "cursor": "eyJ...", "has_next": true, "limit": 25 } }
}
Crear negocio
POST /api/v1/crm/deals
{
"pipeline_id": "uuid",
"stage_id": "uuid",
"contact_id": "uuid",
"account_id": "uuid",
"title": "Acme initial proposal",
"amount": 500000,
"currency": "PEN",
"probability": 60,
"expected_close": "2026-08-01T00:00:00Z",
"tags": ["enterprise"]
}
Respuesta 201: objeto Deal completo.
Obtener negocio
GET /api/v1/crm/deals/:id
Actualizar negocio
PATCH /api/v1/crm/deals/:id
Mismos campos que crear. Omite los campos que no quieras cambiar.
Mover negocio de etapa
POST /api/v1/crm/deals/:id/move
{ "stage_id": "uuid" }
Marcar como ganado
POST /api/v1/crm/deals/:id/won
Marcar como perdido
POST /api/v1/crm/deals/:id/lost
{ "reason": "Presupuesto insuficiente" }
Eliminar negocio
DELETE /api/v1/crm/deals/:id
Respuesta 204 No Content