Volver al sitio
Syncro

Tareas

CRUD de tareas. Una tarea puede estar vinculada a un lead o ser independiente.

Base URLhttps://app.syncro.chat/api/v1AuthX-API-Key: crm_SUA_CHAVE_AQUI

El objeto Tarea

{
  "id": 45,
  "subject": "Enviar proposta",
  "description": "Mandar PDF com valores",
  "type": "email",
  "status": "pending",
  "priority": "high",
  "due_date": "2026-07-01",
  "due_time": "09:00",
  "completed_at": null,
  "lead_id": 123,
  "lead": { "id": 123, "name": "João Silva", "phone": "+5511999887766", "email": "[email protected]" },
  "assigned_to": 12,
  "assigned_user": { "id": 12, "name": "Ana" },
  "notes": null,
  "is_overdue": false,
  "created_at": "2026-06-30T08:00:00Z",
  "updated_at": "2026-06-30T08:00:00Z"
}

Valores aceptados

  • type: call, email, task, visit, whatsapp, meeting
  • priority: low, medium, high
  • status: pending, completed

Listar tareas

GET/tasks
Permiso: tasks:read

Paginado.

Parámetros de query

lead_idintegeropcional
Tareas de un lead
assigned_tointegeropcional
Tareas de un responsable
statusstringopcional
pending o completed
typestringopcional
Tipo (ver arriba)
prioritystringopcional
low, medium, high
due_fromdateopcional
Vencimiento a partir de
due_todateopcional
Vencimiento hasta
pageintegeropcional
Página (predeterminado 1)
per_pageintegeropcional
Ítems por página (predeterminado 50, máx 200)
Solicitud
curl "https://app.syncro.chat/api/v1/tasks?status=pending&lead_id=123" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI"
Respuesta
{
  "success": true,
  "data": [
    {
      "id": 45,
      "subject": "Enviar proposta",
      "type": "email",
      "status": "pending",
      "priority": "high",
      "due_date": "2026-07-01",
      "lead_id": 123
    }
  ],
  "meta": {
    "total": 1,
    "per_page": 50,
    "current_page": 1,
    "last_page": 1,
    "has_more": false
  }
}

Crear tarea

POST/tasks
Permiso: tasks:write

Parámetros del body

subjectstringobligatorio
Asunto
typestringobligatorio
call, email, task, visit, whatsapp, meeting
due_datedateobligatorio
Fecha de vencimiento (YYYY-MM-DD)
descriptionstringopcional
Descripción
prioritystringopcional
low, medium, high
due_timestringopcional
Hora (HH:MM)
lead_idintegeropcional
Lead vinculado
assigned_tointegeropcional
Responsable
notesstringopcional
Notas
Solicitud
curl -X POST "https://app.syncro.chat/api/v1/tasks" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI" \
  -H "Content-Type: application/json" \
  -d '{
    "subject": "Enviar proposta",
    "type": "email",
    "due_date": "2026-07-01",
    "due_time": "09:00",
    "priority": "high",
    "lead_id": 123,
    "assigned_to": 12
  }'
Respuesta
{
  "success": true,
  "task": {
    "id": 45,
    "subject": "Enviar proposta",
    "status": "pending"
  }
}

Buscar tarea

GET/tasks/45
Permiso: tasks:read
Solicitud
curl "https://app.syncro.chat/api/v1/tasks/45" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI"
Respuesta
{
  "success": true,
  "task": {
    "id": 45,
    "subject": "Enviar proposta",
    "status": "pending"
  }
}

Actualizar tarea

PUT/tasks/45
Permiso: tasks:write

Todos los campos son opcionales (actualización parcial). Definir status como completed rellena completed_at automáticamente.

Solicitud
curl -X PUT "https://app.syncro.chat/api/v1/tasks/45" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "completed"
  }'
Respuesta
{
  "success": true,
  "task": {
    "id": 45,
    "status": "completed",
    "completed_at": "2026-06-30T11:30:00Z"
  }
}

Eliminar tarea

DELETE/tasks/45
Permiso: tasks:write
Solicitud
curl -X DELETE "https://app.syncro.chat/api/v1/tasks/45" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI"
Respuesta
{
  "success": true
}

Completar / reabrir tarea

PATCH/tasks/45/toggle
Permiso: tasks:write

Alterna el estado entre pending y completed.

Solicitud
curl -X PATCH "https://app.syncro.chat/api/v1/tasks/45/toggle" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI"
Respuesta
{
  "success": true,
  "task": {
    "id": 45,
    "status": "completed"
  }
}