Easymailing
Tasks

Assign a task to a user

PUT /tasks/{uuid}/actions/assign

PUT/tasks/{uuid}/actions/assign

Sets who is responsible for an open task, or leaves it unassigned. The new assignee is notified.

When to use: When the user says to give a task to someone ("assign this to Laura") or to take it off a person. Nothing else on the task changes.

When not to use: To change other fields as well in one call, use update_task, which also accepts assignee. To find who can receive tasks, use list_task_assignees. To assign many tasks at once there is no endpoint yet.

Side effects: The assignee changes and the previous assignee's pending assignment and reminder notices are withdrawn. The new assignee gets a notification (in the app and by email, according to their preferences), unless they are the user who owns the token. If the task has a reminder, it moves to the new assignee; unassigning removes the reminder. Assigning does not add an entry to the activity of the linked records, and it does not fire any automation or webhook.

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).

Authorization

X-Auth-Token<token>

Value for the X-Auth-Token header parameter.

In: header

Path Parameters

uuid*string

UUID of the task. Get it from list_tasks.

Formatuuid

Request Body

The 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/actions/assign" \  -H "X-Auth-Token: YOUR_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "assignee": "user@example.com",    "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"}