Create a task
POST /tasks
/tasksCreates an open task with a title and, optionally, a description, priority, type, person responsible, due date, reminder and links to contacts, companies and opportunities.
When to use: To record something that has to be done: a follow-up call to a contact, a proposal to send, a renewal to review. Link it to the records it is about so it shows up on them.
When not to use: To write down information without a deadline or an action, such as what was said in a meeting, use create_note. To change a task that already exists, use update_task; to mark it done, complete_task.
Side effects: The task is created open and, if it is linked to records, a task.created entry appears in the activity of each of them, done by the person who owns the token (marked «via Maia» when Maia made the request; initiated_via says api or maia). A task without links leaves no entry. All fields are applied together: if one is rejected, nothing is saved. If the task is assigned to a user other than the one who owns the token, that user gets a notification (in the app and by email, according to their notification preferences). If a reminder is set, the assignee also gets a notification at reminder_at; it is delivered by the same notification system as the Customer App. Nothing is sent to the contacts and no automation or webhook fires (CRM webhook events do not exist yet).
Permissions: Requires a CRM seat and the crm.tasks_notes.write capability. The user must also be able to see every contact, company and opportunity the task is linked to (crm.contacts_companies.read for contacts and companies, access to the pipeline for opportunities).
Value for the X-Auth-Token header parameter.
In: header
The new Task resource
TypeScript Definitions
Use the request body type in TypeScript.
Tasks of the public API (plan fase 4, Tasks 17 and 18). The reads are generated from the approved proposal by
fase-4/tools/gen_task_read.py and the writes by fase-4/tools/gen_task_write.py, edited by hand afterwards: the texts
are the proposal's. Every operation checks the
CRM access in its provider or processor before anything else, because API Platform evaluates security after the
provider.
list_tasks pages by cursor (paginationViaCursor goes on the resource: on the operation API Platform 3.4.17 loses
it) and gives no total. cursor is the opaque position of each task, which API Platform copies into the cursor[gt]
of hydra:next (the last item) and the cursor[lt] of hydra:previous (the first one); it is never published.
assignee, completed_by and created_by are arrays so that they keep the shape of the proposal; the related
records are {@see \App\Application\Crm\RecordRelationView} arrays.
Response Body
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://api.easymailing.com/tasks" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "title": "string", "description_html": "string", "priority": "none", "type": "general", "assignee": "user@example.com", "due_at": "2019-08-24T14:15:22Z", "reminder_offset_minutes": 0, "contacts": [ "string" ], "companies": [ "string" ], "opportunities": [ "string" ] }'{ "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "title": "string", "description_html": "string", "status": "open", "priority": "none", "type": "general", "assignee": { "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f", "name": "string", "email": "user@example.com" }, "due_at": "2019-08-24T14:15:22Z", "overdue": true, "reminder_offset_minutes": 0, "reminder_at": "2019-08-24T14:15:22Z", "completed_at": "2019-08-24T14:15:22Z", "completed_by": { "kind": "user", "name": "string" }, "created_by": { "kind": "user", "name": "string" }, "initiated_via": "ui", "contacts": [ { "iri": "/entity/1", "label": "string", "secondary": "string" } ], "companies": [ { "iri": "/entity/1", "label": "string", "secondary": "string" } ], "opportunities": [ { "iri": "/entity/1", "label": "string", "secondary": "string" } ], "version": 0, "can_edit": true, "can_delete": true, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}