Contactos
CRUD de contactos con identidades (telefono, email)
| Metodo | Ruta | Descripcion |
|---|
GET | /crm/organizations/{organization_id}/contacts | Listar contactos |
POST | /crm/organizations/{organization_id}/contacts | Crear un contacto |
GET | /crm/organizations/{organization_id}/contacts/:id | Obtener contacto por ID |
PATCH | /crm/organizations/{organization_id}/contacts/:id | Actualizar contacto |
DELETE | /crm/organizations/{organization_id}/contacts/:id | Eliminar contacto (soft delete) |
POST /crm/organizations/{organization_id}/contacts
| Campo | Tipo | Requerido | Descripcion |
|---|
first_name | string | No | Nombre |
last_name | string | No | Apellido |
identities | array | No | Identidades (telefono, email, etc.) |
identities[].channel | string | Si | whatsapp, phone, email, sms, webchat, messenger |
identities[].address | string | Si | Numero, email, etc. |
account_id | string | No | UUID de la cuenta vinculada |
properties | object | No | Propiedades personalizadas (JSON libre) |
curl -X POST https://api.mirlo.com/v1/crm/organizations/{organization_id}/contacts \
-H "X-API-Key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Juan",
"last_name": "Perez",
"identities": [
{ "channel": "whatsapp", "address": "+525512345678" },
{ "channel": "email", "address": "juan@empresa.com" }
],
"properties": {
"company": "Acme Corp",
"city": "CDMX"
}
}'
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"first_name": "Juan",
"last_name": "Perez",
"identities": [
{
"id": "...",
"channel": "whatsapp",
"address_raw": "+525512345678",
"address_normalized": "525512345678",
"is_primary": true
}
],
"properties": { "company": "Acme Corp", "city": "CDMX" },
"created_at": "2026-07-06T00:00:00.000Z"
}
GET /crm/organizations/{organization_id}/contacts
| Parametro | Tipo | Descripcion |
|---|
search | string | Busqueda por nombre, telefono o email |
label_id | string | Filtrar por etiqueta |
account_id | string | Filtrar por cuenta |
channel | string | Filtrar por canal de identidad |
limit | number | Maximo de resultados (default: 20) |
offset | number | Offset para paginacion |
curl "https://api.mirlo.com/v1/crm/organizations/{organization_id}/contacts?search=juan&limit=10" \
-H "X-API-Key: <YOUR_API_KEY>"
PATCH /crm/organizations/{organization_id}/contacts/:id
Todos los campos son opcionales. Solo se actualizan los campos enviados.
| Campo | Tipo | Descripcion |
|---|
first_name | string | Nombre |
last_name | string | Apellido |
account_id | string | UUID de la cuenta (null para desvincular) |
properties | object | Propiedades personalizadas |
DELETE /crm/organizations/{organization_id}/contacts/:id
Soft delete — el contacto se marca como eliminado pero no se borra de la base de datos.