Lead Types
Lead Types are ways of grouping Leads. A Lead can have a single Lead Type.
Get lead types
GET /lead-types
Query string parameters
include_bundledboolean - Whether to include lead types from bundles- default: false
enable_escalationboolean - Whether to include lead types that has escalation enabled.- default: null
- Supports Pagination
- Supports Searching
Response
Status code 200
Deprecated response fields
relations_paths.is_sales_typewill be removed from the response in 2019/11/01
{
"data": [
{
"id": "31401e63-3c07-4035-b727-5040dc55ff8c",
"name": "Interested Buyer",
"description": "offer",
"group_id": null,
"team_id": null,
"relations_paths": [
{
"id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": "Case type",
"is_sales_type": true,
"activity_types": {
"milestones": [
{
"id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
"name": "Contract",
"sort_order": 1,
"set_status": "closed",
"suggest_task_after": null,
"template_id": null,
"content_suggestions": [
{
"id": "17498b87-d835-4a97-9428-24ae1dcfd9a5",
"type": "email",
"name": "consectetur",
"subject": "Hi",
"content": "Hi\nSome text here!",
"template_ids": null,
"team_id": null
},
{
"id": "7447f327-5dae-4276-8a87-8c8a6c9ed793",
"type": "email",
"name": "lorem ipsum",
"subject": "Sed ultrices",
"content": "Sed ultrices nec purus erat",
"template_ids": null,
"team_id": null
}
],
"extra_step": null,
"additional_steps": null,
"automated_communications": [],
"chance_of_success": 100
},
{
"id": "943cef92-f9b4-4fcb-b4e4-834f34915973",
"name": "Milestone 2",
"sort_order": 2,
"set_status": "open",
"suggest_task_after": null,
"template_id": null,
"content_suggestions": [
{
"id": "5d0a2b97-cec8-4e77-bb32-624ed9e6edc9",
"type": "email",
"name": "nulam",
"subject": "Vivavmus dapibus",
"content": "enim sit amet facilisis",
"template_ids": null,
"team_id": null
}
],
"extra_step": [
{
"id": "de4bb6f0-b5f4-4a7d-940d-dbeef24e3ac0",
"sort_order": 1,
"name": "Bibendum"
},
{
"id": "c8c7c9d3-8f6b-4e35-9fad-726f1918cd8d",
"sort_order": 2,
"name": "nam-gravida"
}
],
"additional_steps": null,
"automated_communications": [],
"chance_of_success": 30
}
],
"supportive": [
{
"id": "f4aaf74a-59c6-409b-8990-54b78eae1c75",
"name": "Supportive",
"sort_order": 2,
"set_status": "open",
"suggest_task_after": null,
"template_id": null,
"content_suggestions": [
{
"id": "fe7f4d0f-3b56-4a28-bc6e-3f7648ac52fb",
"type": "email",
"name": "ultricies",
"subject": "mauris",
"content": "Dapibus metus nisl vel odio. Nunc vitae",
"template_ids": null,
"team_id": null
},
{
"id": "b20c7a34-3821-47b5-a70c-f6a649b410ca",
"type": "letter",
"name": "quisque",
"subject": null,
"content": "interdum sem non egentas",
"template_ids": null,
"team_id": null
}
],
"extra_step": [
{
"id": "86247236-dc8f-4d4c-b406-fed9d7db97c3",
"sort_order": 1,
"name": "maecenas"
},
{
"id": "bd41fe6b-49c0-4ac1-987a-65c0a8ff238a",
"sort_order": 2,
"name": "ligula"
},
{
"id": "3b71a00f-adca-43e2-8d2b-99e3a2d4e572",
"sort_order": 3,
"name": "nulam"
}
],
"additional_steps": null,
"automated_communications": [],
"chance_of_success": 0
},
{
"id": "f4aaf74a-409b-59c6-4a28-54b78eae1c75",
"name": "Supportive",
"sort_order": 3,
"set_status": "declined",
"suggest_task_after": null,
"template_id": null,
"content_suggestions": [
{
"id": "fe7f4d0f-a70c-4a28-3821-3f7648ac52fb",
"type": "email",
"name": "lorem",
"subject": "ipsum",
"content": "ka passa",
"template_ids": null,
"team_id": null
},
{
"id": "fc0c7a34-4a28-47b5-a70c-f6a649b410ca",
"type": "email",
"name": "Lorem ipsum",
"subject": null,
"content": "Class aptent taciti socosqu",
"template_ids": null,
"team_id": null
}
],
"extra_step": [
{
"id": "86247236-4d4c-b406-dc8f-fed9d7db97c3",
"sort_order": 1,
"name": "Declined because of something"
},
{
"id": "3441fe6b-4ac1-49c0-987a-65c0a8ff238a",
"sort_order": 2,
"name": "Declined because of something other"
},
{
"id": "3b71a00f-8d2b-43e2-adca-99e3a2d4e572",
"sort_order": 3,
"name": "Etiam dapibus"
}
],
"additional_steps": null,
"automated_communications": [],
"chance_of_success": 0
}
]
},
"roles":[
{
"id": 138,
"name": "dolore",
"created_at": "2018-10-09 12:11:09",
"updated_at": "2018-10-10 08:01:12"
}
],
"team_id": null,
"group_id": null,
"created_at": "2015-03-04 11:51:19",
"updated_at": "2015-03-05 08:47:27"
}
],
"escalation_accept": 86400,
"escalation_activity": 86400,
"disabled": false,
"enable_escalation": true,
"enable_team_settings": false,
"escalation_active": [
{
"day_of_week": 0,
"closed": true,
"open": "13:08:06",
"close": "14:10:37"
},
{
"day_of_week": 1,
"closed": false,
"open": "21:10:40",
"close": "15:33:16"
},
{
"day_of_week": 2,
"closed": false,
"open": "12:28:19",
"close": "12:12:00"
},
{
"day_of_week": 3,
"closed": false,
"open": "10:16:56",
"close": "17:37:48"
},
{
"day_of_week": 4,
"closed": false,
"open": "15:25:50",
"close": "09:04:30"
},
{
"day_of_week": 5,
"closed": false,
"open": "01:29:40",
"close": "03:26:00"
},
{
"day_of_week": 6,
"closed": false,
"open": "03:32:12",
"close": "01:16:08"
}
],
"lead_count": 22,
"escalates_at": null,
"sort_order": 0,
"created_at": "2017-05-01 06:17:38",
"updated_at": "2017-05-09 17:32:45"
}
]
}
Create lead type
POST /lead-types
Parameters
namestring- Required
descriptionstring- Required
relations_pathsarray- Required
relations_paths.*UUID
rolesarrayroles.*integer
escalation_acceptinteger - See Escalation durationsescalation_activityinteger - See Escalation durationsescalation_activearray - See Escalation durationsescalation_active.*.day_of_weekinteger- Required
- Between 0 and 6
escalation_active.*.closedboolean- Required
escalation_active.*.opendate- Required if
escalation_active.*.closedisfalse - H:i:s format
- Required if
escalation_active.*.closedate- Required if
escalation_active.*.closedisfalse - H:i:s format
- Required if
enable_escalationbooleanenable_team_settingsbooleandisabledbooleanusersarrayusers.*.idinteger- Required
users.*.escalation_notificationsbooleanusers.*.assignment_notificationsboolean
autoreplyobjectenabledbooleanautoreply_outside_office_hours_onlybooleancontentstringsubjectstringfromstringtemplate_idinteger
assignment_schemestring (first_in_first_out(default),evenly_distributed), see Assignment Schemes.
Escalation durations
Durations are in seconds.
escalation_accept: The number of seconds a user has to accept the lead before it's escalated/revoked.escalation_activity: The number of seconds a user has to create an activity on the case before it's escalated/revoked.
For example, if a Lead is created with a Lead Type that has escalation_accept set to 7200, the Lead will be marked as escalated when it hasn't been accepted within 7200 seconds (i.e. 2 hours).
Escalation active hours
For each day of the week, "opening hours" for escalations can be defined. If an escalation is processed when the day is "closed", it will be ignored.
The day_of_week property is zero-indexed and starts on Sunday, e.g. Sunday is 0, Saturday is 6. If closed is true, the whole day is closed. Otherwise, if false, the open and close times can be defined, or be set to null to be open the whole day. open and close is 24-hour based, e.g. 18:00:00 for 6pm.
In the following example, Monday-Thursday is open from 08:00 to 16:00, Friday is 09:00 to 15:30, and weekends are closed. Any escalations occurring on Fridays at 15:31 to Monday at 07:59 will be processed Monday morning at 08:00, so escalation responsible users will receive a notification, and the Lead is marked as escalated.
Assignment Schemes
Per default, with the first_in_first_out assignment scheme, the lead will be visible to the whole company or team, depending on how the lead is created.
If evenly_distributed is specified, EASI'R will automatically distribute the leads to the users by assigning the each lead directly to a user, based on who was assigned last. When the lead is escalated, however, the lead becomes visible for the whole team again. The assigned users are taken from the users property on the lead type or lead type team settings.
Payload
{
"name": "Website leads",
"description": "lorem ipsum dolor sit amet",
"relations_paths": [
"9eae431b-3d0f-4528-9c59-e9d1a40fcd04"
],
"roles": [1,33],
"assignment_scheme": "first_in_first_out",
"escalation_accept": 86400,
"escalation_activity": 172800,
"escalation_active": [
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 1
},
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 2
},
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 3
},
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 4
},
{
"closed": false,
"open": "09:00:00",
"close": "15:30:00",
"day_of_week": 5
},
{
"closed": true,
"day_of_week": 6
},
{
"closed": true,
"day_of_week": 0
}
],
"disabled": false,
"autoreply": {
"template_id": 2,
"from": "Best Sales",
"subject": "Some subject in response to lead beeing created",
"content": "some content in response to lead beeing created",
"enabled": true,
"autoreply_outside_office_hours_only": true
}
}
Response
Status code 201
Deprecated response fields
relations_paths.is_sales_typewill be removed from the response in 2019/11/01
{
"id": "b151c11f-f634-49e0-8b27-b274dfa55199",
"name": "Website leads",
"description": "lorem ipsum dolor sit amet",
"relations_paths": [
{
"id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": "Sales Path",
"is_sales_type": true,
"activity_types": {
"milestones": [],
"supportive": []
},
"team_id": null,
"group_id": null,
"created_at": "2015-03-04 11:51:19",
"updated_at": "2015-03-05 08:47:27"
}
],
"roles":[
{
"id": 1,
"name": "dolore",
"created_at": "2015-02-01 12:11:09",
"updated_at": "2015-03-01 08:01:12"
},
{
"id": 33,
"name": "dolorum",
"created_at": "2015-02-03 12:12:19",
"updated_at": "2015-03-03 10:01:12"
}
],
"assignment_scheme": "first_in_first_out",
"escalation_accept": 86400,
"escalation_activity": 86400,
"disabled": false,
"enable_escalation": true,
"enable_team_settings": false,
"escalation_active": [
{
"day_of_week": 0,
"closed": true,
"open": "13:08:06",
"close": "14:10:37"
},
{
"day_of_week": 1,
"closed": false,
"open": "21:10:40",
"close": "15:33:16"
},
{
"day_of_week": 2,
"closed": false,
"open": "12:28:19",
"close": "12:12:00"
},
{
"day_of_week": 3,
"closed": false,
"open": "10:16:56",
"close": "17:37:48"
},
{
"day_of_week": 4,
"closed": false,
"open": "15:25:50",
"close": "09:04:30"
},
{
"day_of_week": 5,
"closed": false,
"open": "01:29:40",
"close": "03:26:00"
},
{
"day_of_week": 6,
"closed": false,
"open": "03:32:12",
"close": "01:16:08"
}
],
"lead_count": 22,
"escalates_at": null,
"sort_order": 0,
"created_at": "2017-05-01 06:17:38",
"updated_at": "2017-05-09 17:32:45"
}
Update lead type
PUT /lead-types/:lead_type_id
Parameters
- Uses same parameters as Create lead type
Payload
{
"name": "Website leads has been updated",
"description": "lorem ipsum dolor sit amet",
"relations_paths": [
"9eae431b-3d0f-4528-9c59-e9d1a40fcd04"
],
"roles": [1],
"assignment_scheme": "first_in_first_out",
"escalation_accept": 86400,
"escalation_activity": 172800,
"escalation_active": [
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 1
},
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 2
},
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 3
},
{
"closed": false,
"open": "08:00:00",
"close": "16:00:00",
"day_of_week": 4
},
{
"closed": false,
"open": "09:00:00",
"close": "15:30:00",
"day_of_week": 5
},
{
"closed": true,
"day_of_week": 6
},
{
"closed": true,
"day_of_week": 0
}
],
"disabled": false
}
Response
Status code 200
Deprecated response fields
relations_paths.is_sales_typewill be removed from the response in 2019/11/01
{
"id": "b151c11f-f634-49e0-8b27-b274dfa55199",
"name": "Website leads has been updated",
"description": "lorem ipsum dolor sit amet",
"relations_paths": [
{
"id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": "Sales Path",
"is_sales_type": true,
"activity_types": {
"milestones": [],
"supportive": []
},
"team_id": null,
"group_id": null,
"created_at": "2015-03-04 11:51:19",
"updated_at": "2015-03-05 08:47:27"
}
],
"roles":[
{
"id": 1,
"name": "dolore",
"created_at": "2015-02-01 12:11:09",
"updated_at": "2015-03-01 08:01:12"
}
],
"assignment_scheme": "first_in_first_out",
"escalation_accept": 86400,
"escalation_activity": 86400,
"disabled": false,
"enable_escalation": true,
"enable_team_settings": false,
"escalation_active": [
{
"day_of_week": 0,
"closed": true,
"open": "13:08:06",
"close": "14:10:37"
},
{
"day_of_week": 1,
"closed": false,
"open": "21:10:40",
"close": "15:33:16"
},
{
"day_of_week": 2,
"closed": false,
"open": "12:28:19",
"close": "12:12:00"
},
{
"day_of_week": 3,
"closed": false,
"open": "10:16:56",
"close": "17:37:48"
},
{
"day_of_week": 4,
"closed": false,
"open": "15:25:50",
"close": "09:04:30"
},
{
"day_of_week": 5,
"closed": false,
"open": "01:29:40",
"close": "03:26:00"
},
{
"day_of_week": 6,
"closed": false,
"open": "03:32:12",
"close": "01:16:08"
}
],
"lead_count": 22,
"escalates_at": null,
"sort_order": 0,
"created_at": "2017-05-01 06:17:38",
"updated_at": "2017-05-09 17:32:45"
}
Delete lead type
DELETE /lead-types/:lead_type_id
Response
Status code 204
Lead Type Team Settings
Update team settings
PUT /lead-types/:lead_type_id/settings
Each team can configure some attributes of Lead Types in their own way that will override the company-wide settings:
Only available to users with the opportunities right
Parameters
relations_pathsarray- Required
relations_paths.*UUID
escalation_acceptintegerescalation_activityintegerescalation_activearray - The "opening hours" for each weekday. See below.- See Escalation durations
escalation_active.*.day_of_weekinteger- Required
- Between 0 and 6
escalation_active.*.closedboolean- Required
escalation_active.*.opendate- Required if
escalation_active.*.closedisfalse - H:i:s format
- Required if
escalation_active.*.closedate- Required if
escalation_active.*.closedisfalse - H:i:s format
- Required if
disabledbooleanusersarrayusers.*.idinteger- Required
users.*.escalation_notificationsbooleanusers.*.assignment_notificationsboolean
autoreplyobjectenabledbooleanautoreply_outside_office_hours_onlybooleancontentstringsubjectstringfromstringtemplate_idinteger
assignment_schemestring (first_in_first_out(default),evenly_distributed), see Assignment Schemes.
Payload
{
"disabled": true,
"users": [
{
"id": 786,
"escalation_notifications": true,
"assignment_notifications": false
},
{
"id": 787,
"escalation_notifications": false,
"assignment_notifications": true
}
],
"relations_paths": [
"eabda55c-de1e-4544-99f3-19db2b686cbe"
],
"escalation_accept": 86400,
"escalation_activity": 86400,
"escalation_active": [
{
"closed": false,
"day_of_week": 6,
"open": "08:00:00",
"close": "13:00:00"
},
{
"closed": true,
"day_of_week": 5
},
{
"closed": true,
"day_of_week": 1
}
],
"autoreply": {
"template_id": 2,
"from": "Best Sales",
"subject": "Some subject in response to lead beeing created",
"content": "some content in response to lead beeing created",
"enabled": true,
"autoreply_outside_office_hours_only": false
},
"assignment_scheme": "first_in_first_out",
}
Response
Status code 200
Get settings for specific team
GET /lead-types/:leadTypeId/settings/:teamId
Agencies can retrieve a team's settings for a lead type. For example: getting a list of users to contact in the case of an escalated lead.
Only available to users with the agency right
Response
Status code 200
Deprecated response fields
relations_paths.is_sales_typewill be removed from the response in 2019/11/01
{
"users": [
{
"assignment_notifications": false,
"escalation_notifications": true,
"user": {
"id": 786,
"first_name": "Taurean",
"last_name": "Ledner",
"phone_number": "578.595.1147x347",
"job_title": "Sales Executive",
"email": "27Darren.Rowe@yahoo.com",
"email_notifications": false,
"profile_picture": "https://randomuser.me/api/portraits/thumb/women/woman/17.jpg",
"company": {
"id": 416,
"name": "Langosh LLC",
"billing": {
"invoice_email": "zLemke@gmail.com",
"address_1": "994 Balistreri Vista Suite 239",
"address_2": "",
"zip_code": "39046",
"city": "McLaughlinburgh",
"state": "",
"country": null
},
"phone_number": "735.088.6599x682",
"website": "http://www.Streich.com",
"vat": "1234567890123456",
"logo_1": null,
"logo_2": null,
"timezone": null,
"locale": null,
"language": {
"code": "en",
"name": "English"
},
"currency": null,
"settings": {
"b2c": {
"allow": false,
"default": false
},
"theme": "default",
"product": {
"mode": "advanced"
},
"default_account_id": null,
"teams_can_create_relations_paths": true,
"groups_can_create_relations_paths": true,
"use_social_lookup": false
},
"plan": null,
"created_at": "2016-08-18 09:08:14",
"updated_at": "2016-08-18 09:08:14"
},
"created_at": "2016-08-18 09:08:14",
"updated_at": "2016-08-18 09:08:14"
}
},
{
"assignment_notifications": true,
"escalation_notifications": false,
"user": {
"id": 787,
"first_name": "Michelle",
"last_name": "Beatty",
"phone_number": "1-583-598-1273",
"job_title": "Sales Executive",
"email": "6148Marcelina.Crona@Baumbach.net",
"email_notifications": false,
"profile_picture": "https://randomuser.me/api/portraits/thumb/women/man/25.jpg",
"company": {
"id": 416,
"name": "Langosh LLC",
"billing": {
"invoice_email": "zLemke@gmail.com",
"address_1": "994 Balistreri Vista Suite 239",
"address_2": "",
"zip_code": "39046",
"city": "McLaughlinburgh",
"state": "",
"country": null
},
"phone_number": "735.088.6599x682",
"website": "http://www.Streich.com",
"vat": "1234567890123456",
"logo_1": null,
"logo_2": null,
"timezone": null,
"locale": null,
"language": {
"code": "en",
"name": "English"
},
"currency": null,
"settings": {
"b2c": {
"allow": false,
"default": false
},
"theme": "default",
"product": {
"mode": "advanced"
},
"default_account_id": null,
"teams_can_create_relations_paths": true,
"groups_can_create_relations_paths": true,
"use_social_lookup": false
},
"plan": null,
"created_at": "2016-08-18 09:08:14",
"updated_at": "2016-08-18 09:08:14"
},
"created_at": "2016-08-18 09:08:14",
"updated_at": "2016-08-18 09:08:14"
}
}
],
"relations_paths": [
{
"id": "eabda55c-de1e-4544-99f3-19db2b686cbe",
"name": "General sales",
"is_sales_type": false,
"activity_types": {
"milestones": null,
"supportive": null
},
"team_id": null,
"group_id": null,
"created_at": "2016-08-18 09:08:14",
"updated_at": "2016-08-18 09:08:14"
}
],
"disabled": true,
"escalation_accept": 86400,
"escalation_activity": 86400,
"escalation_active": [
{
"day_of_week": 1,
"closed": true,
"open": null,
"close": null
},
{
"day_of_week": 5,
"closed": true,
"open": null,
"close": null
},
{
"day_of_week": 6,
"closed": false,
"open": "08:00:00",
"close": "13:00:00"
}
],
"assignment_scheme": "first_in_first_out",
}
Get Leads by Lead Type
GET /lead-types/:lead_type_id/leads
This is primarily intended for the Opportunities section in the application, and displays unaccepted leads assigned to the current team of the user.
Query string parameters
- Supports Pagination
assigned_user_idsinteger, comma-separated - shows leads assigned to specific users (admins only)team_idsinteger, comma-separated - shows leads assigned to specific teams
Response
Status code 200
{
"data": [
{
"id": "177a16d3-fbe1-4186-bfbc-51925de2557c",
"user_id": 0,
"lead_type_id": "990f3e13-d891-460e-82da-5af3a223b6b3",
"b2c": true,
"interest": "dolores ipsa voluptas",
"lead_source": null,
"lead_data": null,
"rejections": null,
"acceptions": null,
"assignments": null,
"escalations": null,
"case_id": null,
"account_id": null,
"account": {
"fixed_fields": [
{
"field_id": 9,
"text_value": "Lakin Inc"
}
],
"custom_fields": [
{
"field_id": 7,
"text_value": "Wayne.Hartmann@Hauck.com"
}
]
},
"contact_id": null,
"contact": {
"fixed_fields": [
{
"field_id": 18,
"text_value": "Freeman"
},
{
"field_id": 19,
"text_value": "Cruickshank"
},
{
"field_id": 21,
"numeric_value": 69122283
}
],
"custom_fields": [
{
"field_id": 13,
"text_value": "Velva38@yahoo.com"
}
]
},
"created_at": "2015-05-25 05:30:20",
"updated_at": "2015-05-25 05:30:20"
}
],
"pagination": {
"total": 10,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": null
}
}
}
Sort lead types
PUT /lead-types/sort
Only available for admins. You can combine this with sorting of lead type bundles.
Parameters
lead_typesarray- Required without
lead_type_bundles lead_types.*.idUUID- Required
lead_types.*.sort_orderinteger- Required
- Minimum 0
- Required without
lead_type_bundlesarray- Required without
lead_types lead_type_bundles.*.idinteger- Required
lead_type_bundles.*.sort_orderinteger- Required
- Minimum 0
- Required without
Payload
{
"lead_types": [
{
"id": "01e6b3ba-8673-41ba-8604-4d3959e03778",
"sort_order": 1
}
]
}
Response
Status code 204