Update a task
PUT /tasks/{uuid}
/tasks/{uuid}Changes an open task: title, description, priority, type, person responsible, due date, reminder or linked records. Fields you leave out keep their value; null clears an optional one. The lists of linked records are replaced as a whole.
When to use: To correct or reschedule a task, change its priority, or add or remove the records it is linked to. Send only what changes.
When not to use: To mark the task as done, use complete_task; to bring a completed task back, reopen_task (a completed task cannot be edited). If you only want to change who is responsible, assign_task says it more clearly. To remove the task, use delete_task.
Side effects: All the fields of the request are applied together: if one is rejected, nothing is saved. Editing does not add an entry to the activity of the linked records (only creating, completing and reopening do). Removing assignee or due_at also removes the reminder. If the assignee changes to another user, they get a notification and the previous assignee's pending notices are withdrawn; if the reminder moves, the pending reminder is replaced. If a reminder is set, the assignee gets a notification at reminder_at. Nothing is sent to the contacts and no automation or webhook fires.
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
Path Parameters
UUID of the task. Get it from list_tasks.
uuidThe updated 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
application/problem+json
curl -X PUT "https://api.easymailing.com/tasks/7c1e5a90-3b24-4d8f-a6e1-0f9d2c4b8a13" \ -H "X-Auth-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "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" ], "expected_version": 1 }'{ "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"}