Voltar ao site
Syncro

Tarefas

CRUD de tarefas. Uma tarefa pode estar vinculada a um lead ou ser avulsa.

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

O objeto Tarefa

{
  "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 aceitos

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

Listar tarefas

GET/tasks
Permissão: tasks:read

Paginado.

Parâmetros de query

lead_idintegeropcional
Tarefas de um lead
assigned_tointegeropcional
Tarefas de um responsável
statusstringopcional
pending ou completed
typestringopcional
Tipo (ver acima)
prioritystringopcional
low, medium, high
due_fromdateopcional
Vencimento a partir de
due_todateopcional
Vencimento até
pageintegeropcional
Página (padrão 1)
per_pageintegeropcional
Itens por página (padrão 50, máx 200)
Requisição
curl "https://app.syncro.chat/api/v1/tasks?status=pending&lead_id=123" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI"
Resposta
{
  "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
  }
}

Criar tarefa

POST/tasks
Permissão: tasks:write

Parâmetros do body

subjectstringobrigatório
Assunto
typestringobrigatório
call, email, task, visit, whatsapp, meeting
due_datedateobrigatório
Data de vencimento (YYYY-MM-DD)
descriptionstringopcional
Descrição
prioritystringopcional
low, medium, high
due_timestringopcional
Hora (HH:MM)
lead_idintegeropcional
Lead vinculado
assigned_tointegeropcional
Responsável
notesstringopcional
Anotações
Requisição
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
  }'
Resposta
{
  "success": true,
  "task": {
    "id": 45,
    "subject": "Enviar proposta",
    "status": "pending"
  }
}

Buscar tarefa

GET/tasks/45
Permissão: tasks:read
Requisição
curl "https://app.syncro.chat/api/v1/tasks/45" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI"
Resposta
{
  "success": true,
  "task": {
    "id": 45,
    "subject": "Enviar proposta",
    "status": "pending"
  }
}

Atualizar tarefa

PUT/tasks/45
Permissão: tasks:write

Todos os campos são opcionais (atualização parcial). Definir status como completed preenche completed_at automaticamente.

Requisição
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"
  }'
Resposta
{
  "success": true,
  "task": {
    "id": 45,
    "status": "completed",
    "completed_at": "2026-06-30T11:30:00Z"
  }
}

Excluir tarefa

DELETE/tasks/45
Permissão: tasks:write
Requisição
curl -X DELETE "https://app.syncro.chat/api/v1/tasks/45" \
  -H "X-API-Key: crm_SUA_CHAVE_AQUI"
Resposta
{
  "success": true
}

Concluir / reabrir tarefa

PATCH/tasks/45/toggle
Permissão: tasks:write

Alterna o status entre pending e completed.

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