Tarefas
A tarefa é sempre de um negócio, com data e hora marcadas e um responsável. Ela aparece no card do negócio, no CRM.
O objeto tarefa
O formato da resposta de POST /tasks e do evento task.created.
| Campo | Tipo | O que é |
|---|---|---|
id | UUID | Id da tarefa. |
task_id | UUID | O mesmo id da tarefa. |
type | texto | task (tarefa), call (ligação), email, meeting (reunião) ou proposal (proposta). |
type_label | texto | O tipo em português. |
title | texto | Título. |
description | texto ou null | Descrição. |
due_at | data e hora | Data e hora marcadas. |
done_at | data e hora ou null | Quando foi feita. |
owner_id | UUID ou null | Responsável. |
owner_name | texto ou null | Nome do responsável. |
opportunity_id | UUID | Negócio da tarefa. |
opportunity_title | texto ou null | Título do negócio. |
contact_id | UUID ou null | Contato do negócio. |
contact_name | texto ou null | Nome do contato. |
created_at | data e hora | Quando foi criada. |
Criar tarefa
POST/tasks
Permissão: tasks:write.
A tarefa entra no negócio, com data e hora. Sem owner_id, fica com o responsável do negócio.
Corpo (JSON)
| Campo | Tipo | Obrigatório | O que é |
|---|---|---|---|
opportunity_id | UUID | sim | Negócio da tarefa. |
title | texto | sim | Título, até 200 caracteres. |
due_at | data e hora | sim | ISO 8601 com fuso: 2026-11-06T11:00:00-03:00 ou 2026-11-06T14:00:00Z. Sem o fuso, vale a hora de Brasília. Só a data, sem a hora: 400. |
type | texto | não | task (o padrão), call, email ou meeting. |
description | texto | não | Descrição, até 5.000 caracteres. |
owner_id | UUID | não | Responsável, de GET /users. Pessoa fora da equipe: 400. |
Exemplo
curl
curl -X POST "https://api.eroimkt.com.br/v1/api/v1/tasks" \
-H "Authorization: Bearer $EROI_CHAVE" \
-H "Content-Type: application/json" \
-d '{
"opportunity_id": "00000000-0000-4000-8000-000000000002",
"title": "Ligar para a Maria",
"due_at": "2026-11-06T11:00:00-03:00",
"type": "call",
"description": "Confirmar a proposta do plano anual."
}'JavaScript (fetch)
const resposta = await fetch("https://api.eroimkt.com.br/v1/api/v1/tasks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.EROI_CHAVE}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
opportunity_id: "00000000-0000-4000-8000-000000000002",
title: "Ligar para a Maria",
due_at: "2026-11-06T11:00:00-03:00",
type: "call",
description: "Confirmar a proposta do plano anual.",
}),
});
const dados = await resposta.json();Resposta 201 Created
JSON
{
"id": "00000000-0000-4000-8000-0000000000a0",
"task_id": "00000000-0000-4000-8000-0000000000a0",
"type": "call",
"type_label": "Ligação",
"title": "Ligar para a Maria",
"description": "Confirmar a proposta do plano anual.",
"due_at": "2026-11-06T14:00:00.000Z",
"done_at": null,
"owner_id": "00000000-0000-4000-8000-000000000020",
"owner_name": "Ana Lima",
"opportunity_id": "00000000-0000-4000-8000-000000000002",
"opportunity_title": "Maria Souza: plano anual",
"contact_id": "00000000-0000-4000-8000-000000000001",
"contact_name": "Maria Souza",
"created_at": "2026-11-05T15:41:00.000Z"
}Acompanhar as tarefas
Para saber das tarefas criadas no e-roi, inscreva um webhook no evento task.created (permissão tasks:read) ou leia os últimos com GET /triggers/task.created.