Users
The staff a lead can be assigned to, and how assignment works.
GET List users
/v1/usersThe people in your organisation a lead can be assigned to: enabled users who are not team-only
members (fitters and surveyors who exist for scheduling and never log in). Ordered by name, not
paginated, cached for five minutes. The same list is available as
GET /v1/leads/fields/assignedTo.
rolestring · listOne or more roles, comma-separated or repeated: users holding any of them.
curl "https://api.evacrm.co.uk/v1/users?role=salesman" \
-H "Authorization: Bearer sk_..."{
"object": "list",
"data": [
{
"id": "cd9356b7-dd81-4f9a-a6fd-9cc9ae967a4e",
"name": "Tuan Dinh",
"firstName": "Tuan",
"lastName": "Dinh",
"email": "tuan@example.com",
"jobTitle": "Sales manager",
"roles": ["salesman"]
}
]
}Roles
roles is what the CRM shows as Roles on a staff record: salesman, surveyor, fitter,
service_engineer and any your administrator has added. They say what a person does, not what
they are allowed to see. The same values drive availability
and tell you who an appointment type is for.
GET List roles
/v1/users/rolesThe roles your organisation uses, as value (what you send) and name (what staff see). No
parameters. Cached for five minutes.
curl https://api.evacrm.co.uk/v1/users/roles \
-H "Authorization: Bearer sk_..."{
"object": "list",
"data": [
{ "value": "salesman", "name": "Salesman" },
{ "value": "surveyor", "name": "Surveyor" },
{ "value": "fitter", "name": "Fitter" }
]
}Assigning a lead
Send a user's id or email as assignedTo when creating a lead. The
user gets the CRM's normal "lead assigned to you" notification. An unknown or disabled user is a
422 naming assignedTo.
A lead is held by a user or a team, never both; the CRM's automatic team assignment still runs
for leads you do not assign. To reassign later, send assignedTo on
update a lead; null unassigns.
Finding leads by assignee
GET /v1/leads?assignedTo=<id or email> returns that user's leads, and assignedTo=none
returns leads nobody holds. Every lead in a list carries assignee and assignedTeam (at most
one of them is set):
{
"assigned": true,
"assignee": { "id": "cd9356b7-…", "name": "Tuan Dinh", "email": "tuan@example.com" },
"assignedTeam": null
}