Reporting
Get averages
GET reports/averages
Query string parameters
activity_type_ids
UUID - Comma separated list of idscreated_from_lead
booleanindicators
string - Comma separated list of ids- Required
interval
string- one of:
year
,quarter
,month
,week
,day
,hour
,minute
,second
- default value:
month
- one of:
lead_sources
string - Comma separated listlead_type_ids
UUID - Comma separated list of idsproduct_ids
UUID - Comma separated list of idsrelations_path_ids
UUID - Comma separated list of idsstart_at
date- Y-m-d H:i:s format
end_at
date- Y-m-d H:i:s format
Response
Status code 200
{
"interval": "month",
"data": [
{
"indicator": "leads.accepted",
"user": 1,
"value": 12
}
]
}
Get metrics
GET reports/metrics
Query string parameters
activity_type_ids
UUID - Comma separated list of idscreated_from_lead
booleangroup_by
string- one of
activity_type
,company
,group
,lead_source
,lead_type
,relations_path
,team
,user
- default value:
user
- one of
group_ids
string - Comma separated list of idsindicators
string - Comma separated list of indicators- Required
lead_sources
string - Comma separated listlead_type_ids
UUID - Comma separated list of idsproduct_ids
UUID - Comma separated list of idsrelations_path_ids
UUID - Comma separated list of idsstart_at
date- Y-m-d H:i:s format
end_at
date- Y-m-d H:i:s format
team_ids
integer - Comma separated list of idsuser_ids
integer - Comma separated list of ids
Response
Status code 200
{
"group_by": [
"team"
],
"data": [
{
"indicator": "leads.accepted",
"value": 5,
"team_id": 1
},
{
"indicator": "leads.accepted",
"value": 4,
"team_id": 2
},
{
"indicator": "leads.assigned",
"value": 2,
"team_id": 1
},
{
"indicator": "leads.assigned",
"value": 4,
"team_id": 2
}
]
}
Get time series
GET reports/time-series
Query string parameters
activity_type_ids
UUID - Comma separated list of idscreated_from_lead
booleangroup_by
string- one of
activity_type
,company
,group
,lead_source
,lead_type
,relations_path
,team
,user
- default value:
user
- default value:
- one of
group_ids
UUID - Comma separated list of idsindicators
string - Comma separated list of indicators- Required
lead_sources
string - Comma separated listlead_type_ids
UUID - Comma separated list of idsproduct_ids
UUID - Comma separated list of idsrelations_path_ids
UUID - Comma separated list of idsstart_at
date- Y-m-d H:i:s format
end_at
date- Y-m-d H:i:s format
team_ids
integer - Comma separated list of idsuser_ids
integer - Comma separated list of ids
Response
Status Code 200
{
"group_by": [
"company"
],
"interval": "month",
"data": [
{
"indicator": "cases.closed",
"key": "2017-01-01 00:00:00",
"value": 33,
"end_at": "2017-01-31 23:59:59",
"start_at": "2017-01-01 00:00:00"
},
{
"indicator": "cases.closed",
"key": "2017-02-01 00:00:00",
"value": 22,
"end_at": "2017-02-28 23:59:59",
"start_at": "2017-02-01 00:00:00"
},
{
"indicator": "cases.closed",
"key": "2017-03-01 00:00:00",
"value": 23,
"end_at": "2017-03-31 23:59:59",
"start_at": "2017-03-01 00:00:00"
},
{
"indicator": "cases.closed",
"key": "2017-04-01 00:00:00",
"value": 14,
"end_at": "2017-04-30 23:59:59",
"start_at": "2017-04-01 00:00:00"
}
]
}
Get indicators
GET reports/indicators
Return list of available indicators
Response
{
"data": [
{
"name": "accounts.b2b.created",
"group": "contacts"
},
{
"name": "accounts.b2b.deleted.total",
"group": "usage"
},
{
"name": "accounts.b2b.total",
"group": "usage"
},
{
"name": "accounts_contacts.without_address",
"group": "contacts"
}
]
}
Indicator sets
Get indicator set list
GET reports/indicator-sets
Query string parameters
per_page
integerpage
integerids
string - Commas separated list of ids
Response
{
"pagination": {
"page": 1,
"per_page": 50,
"total": 2
},
"data": [
{
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My new set name",
"indicators": [
"contacts.b2c.created",
"leads.accepted",
"leads.assigned"
]
},
{
"id": "1420334c-6d91-481b-a1e8-408037a588dd",
"name": "Leads accepted and assigned",
"indicators": [
"contacts.b2c.created",
"leads.accepted",
"leads.assigned"
]
}
]
}
Get indicator set
GET reports/indicator-sets/:indicator_set_id
Response
Status Code 200
{
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My set",
"indicators": [
"leads.accepted",
"leads.assigned"
]
}
Create indicator set
POST reports/indicator-sets
Parameters
name
string- Required
indicators
array of indicator names- Required
- Can't be empty
indicators.*
string
Payload
{
"name": "My set",
"indicators": ["leads.accepted", "leads.assigned"]
}
Response Status Code 200
{
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My set",
"indicators": [
"leads.accepted",
"leads.assigned"
]
}
Update indicator set
PUT reports/indicator-sets/:indicator_set_id
Parameters
Uses same parameters as Create indicator set
Payload
{
"name": "My new set name",
"indicators": [
"leads.accepted",
"leads.assigned",
"contacts.b2c.created"
]
}
Response
Status Code 200
{
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My new set name",
"indicators": [
"contacts.b2c.created",
"leads.accepted",
"leads.assigned"
]
}
Delete indicator set
DELETE reports/indicator-sets/:indicator_set_id
Response Status code 204
Report export
Create new export
GET reports/export
Query string parameters
activity_type_ids
UUID - Comma separated list of idscreated_from_lead
booleangroup_by
string- one of
activity_type
,company
,group
,lead_source
,lead_type
,relations_path
,team
,user
- default value:
user
- one of
group_ids
string - Comma separated list of idsindicators
string - Comma separated list of indicators- Required
lead_sources
string - Comma separated listlead_type_ids
UUID - Comma separated list of idsproduct_ids
UUID - Comma separated list of idsrelations_path_ids
UUID - Comma separated list of idsstart_at
date- Y-m-d H:i:s format
end_at
date- Y-m-d H:i:s format
team_ids
integer - Comma separated list of idsuser_ids
integer - Comma separated list of ids
Response
{
"export_id": "b795b892-d6e0-4d4c-8f0f-9a10ee035f81",
"file_id": null,
"status": null
}
Get export status
GET reports/export/:export_id
Parameters
id
UUID
Response
{
"export_id": "b795b892-d6e0-4d4c-8f0f-9a10ee035f81",
"file_id": "e2d814a4-6dc4-4000-8f14-c5c9e452ca14",
"status": "done"
}
Scheduled reports
Get scheduled reports list
GET reports/scheduled
Query string parameters
per_page
integerpage
integerindicator_set_id
UUID
Response Status Code 200
{
"data": [
{
"id": "2daec72f-a824-40b5-b2ef-52c04b922ed8",
"indicator_set": {
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My new set name"
},
"name": "leads monthly",
"recipients_count": 2,
"delivery_frequency": "month",
"next_delivery": "2019-02-01",
"created_at": "2019-01-24 14:32:34",
"updated_at": "2019-01-24 14:32:34"
}
],
"pagination": {
"total": 1,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": null
}
}
}
Get scheduled report
GET reports/scheduled/:scheduled_report_id
Response
Status Code 200
{
"id": "2daec72f-a824-40b5-b2ef-52c04b922ed8",
"indicator_set": {
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My new set name"
},
"name": "leads monthly",
"filters": {
"relations_paths": null,
"lead_sources": null,
"lead_types": null,
"groups": null,
"teams": null
},
"recipients": [
{
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": "+4588888888",
"job_title": "Sales Executive",
"email": "jane@example.com",
"email_notifications": false,
"profile_picture": null,
"system_user": false,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
{
"id": 8,
"first_name": "Maegan",
"last_name": "Weber",
"phone_number": "746-831-5137",
"job_title": "Data Scientist - User Analysis",
"email": "maegan@example.com",
"email_notifications": false,
"profile_picture": null,
"system_user": false,
"created_at": "2018-08-20 18:46:48",
"updated_at": "2019-01-21 12:05:05"
}
],
"recipients_count": 2,
"delivery_frequency": "month",
"next_delivery": "2019-02-01",
"created_at": "2019-01-24 14:32:34",
"updated_at": "2019-01-24 14:32:34"
}
Create scheduled report
POST reports/scheduled
Parameters
name
string- required
indicator_set_id
UUID- required
delivery_frequency
string- required
- one of:
day
,week
,month
,quarter
,year
recipient_user_ids
array *requiredrecipient_user_ids.*
integer
filters
objectfilters.relation_path_ids
arrayfilters.relation_path_ids.*
UUID
filters.lead_type_ids
arrayfilters.lead_type_ids.*
UUID
filters.lead_sources
arrayfilters.lead_sources.*
string
filters.group_ids
array- Admin only
filters.group_ids.*
integer
filters.team_ids
array- Admin or Group Admin only
filters.team_ids.*
integer
Payload
{
"name": "leads monthly",
"indicator_set_id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"delivery_frequency": "month",
"recipient_user_ids": [1, 8]
}
Response Status Code 200
{
"id": "2daec72f-a824-40b5-b2ef-52c04b922ed8",
"indicator_set": {
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My new set name"
},
"name": "leads monthly",
"filters": {
"relations_paths": null,
"lead_sources": null,
"lead_types": null,
"groups": null,
"teams": null
},
"recipients": [
{
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": "+4588888888",
"job_title": "Sales Executive",
"email": "jane@example.com",
"email_notifications": false,
"profile_picture": null,
"system_user": false,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
{
"id": 8,
"first_name": "Maegan",
"last_name": "Weber",
"phone_number": "746-831-5137",
"job_title": "Data Scientist - User Analysis",
"email": "maegan@example.com",
"email_notifications": false,
"profile_picture": null,
"system_user": false,
"created_at": "2018-08-20 18:46:48",
"updated_at": "2019-01-21 12:05:05"
}
],
"recipients_count": 2,
"delivery_frequency": "month",
"next_delivery": "2019-02-01",
"created_at": "2019-01-24 14:32:34",
"updated_at": "2019-01-24 14:32:34"
}
Update scheduled report
PUT reports/scheduled/:scheduled_report_id
Parameters
Uses same parameters as Create scheduled report
Payload
{
"name": "leads yearly",
"indicator_set_id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"delivery_frequency": "year",
"recipient_user_ids": [1, 8, 12]
}
Response Status Code 200
{
"id": "2daec72f-a824-40b5-b2ef-52c04b922ed8",
"indicator_set": {
"id": "87f41a74-97db-4671-ba29-2b8fee49c47c",
"name": "My new set name"
},
"name": "leads yearly",
"filters": {
"relations_paths": null,
"lead_sources": null,
"lead_types": null,
"groups": null,
"teams": null
},
"recipients": [
{
"id": 1,
"first_name": "Jane",
"last_name": "Doe",
"phone_number": "+4588888888",
"job_title": "Sales Executive",
"email": "jane@example.com",
"email_notifications": false,
"profile_picture": null,
"system_user": false,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
{
"id": 8,
"first_name": "Maegan",
"last_name": "Weber",
"phone_number": "746-831-5137",
"job_title": "Data Scientist - User Analysis",
"email": "maegan@example.com",
"email_notifications": false,
"profile_picture": null,
"system_user": false,
"created_at": "2018-08-20 18:46:48",
"updated_at": "2019-01-21 12:05:05"
},
{
"id": 12,
"first_name": "John",
"last_name": "Brown",
"phone_number": "741-822-5155",
"job_title": "Data Scientist - User Analysis",
"email": "john@example.com",
"email_notifications": false,
"profile_picture": null,
"system_user": false,
"created_at": "2018-10-20 18:46:48",
"updated_at": "2019-01-19 12:05:05"
}
],
"recipients_count": 3,
"delivery_frequency": "year",
"next_delivery": "2020-01-01",
"created_at": "2019-01-24 14:32:34",
"updated_at": "2019-01-24 14:32:34"
}
Delete scheduled report
DELETE reports/scheduled/:scheduled_report_id
Response
Status code 204
Reporting endpoints bellow are marked as depricated. The endpoints are scheduled for removal on January 1, 2019.
Get performance
GET reports/performance
Deprecated; will be removed as of January 1, 2019
Query string parameters
start_date
date- Y-m-d H:i:s format
- default: now minus 1 month
end_date
date- Must be after
start_date
- Y-m-d H:i:s format
- default: now plus 1 month
- Must be after
users
integer - Comma separated list of ids.teams
integer - Comma separated list of ids.products
UUID - Comma separated list of ids.categories
integer - Comma separated list ids.relations_path_id
UUID - Comma separated list of ids.lead_type_id
UUID - Comma separated list of lead ids.
Return value depends on your company.settings.product_mode
Response
Status code 200
{
"past": [
{
"date": "2015-05-23 00:00:00",
"value": 89619
}
],
"future": [
{
"date": "2015-06-22 00:00:00",
"value": 6990.5935065777
}
]
}
Notify
POST /reports/performance/notify
Deprecated; will be removed as of January 1, 2019
Parameters
notify.users
array- Required without notify.teams
notify.users.*
integer
notify.teams
array- Required without notify.users
notify.teams.*
integer
message
string - Message to display in notification.- Required
Payload
{
"notify": {
"users": [1,2],
"teams": [1]
},
"message": "Some content"
}
Response
Status code 204
Export
GET /reports/performance/export/pdf
Deprecated; will be removed as of January 1, 2019
Query string parameters
start_date
date- Y-m-d H:i:s format
- default: now minus 1 month
end_date
date- Must be after
start_date
- Y-m-d H:i:s format
- default: now plus 1 month
- Must be after
users
integer - Comma separated list of ids.teams
integer - Comma separated list of ids.products
UUID - Comma separated list of ids.categories
integer - Comma separated list ids.relations_path_id
UUID - Comma separated list of ids.lead_type_id
UUID - Comma separated list of lead ids.
The URL returned is valid for 5 minutes.
Response
Status code 200
{
"url": "*URL TO PDF*"
}
Pipeline
Get pipeline
GET /reports/pipeline
Deprecated; will be removed as of January 1, 2019
Returns the value in your pipeline by relations paths
Response
Status code 200
{
"data": [
{
"id": "1eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": "Relations path",
"value": 248,
"sum": 574493.76266962
},
{
"id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": "Second relations path",
"value": 245,
"sum": 594525.37285339
}
]
}
Get pipeline by relations path
GET /reports/pipeline/:relations_path_id
Deprecated; will be removed as of January 1, 2019
Query string parameters
start_date
date- Y-m-d H:i:s format
- default: now minus 1 month
end_date
date- Must be after
start_date
- Y-m-d H:i:s format
- default: now plus 1 month
- Must be after
users
integer - Comma separated list of ids.teams
integer - Comma separated list of ids.products
uuid - Comma separated list of ids.categories
integer - Comma separated list ids.
Returns your milestones and the predicted revenue.
Return value depends on your company.settings.product_mode
Response
Status code 200
{
"data": [
{
"id": "143cef92-f9b4-4fcb-b4e4-834f34915973",
"name": "Milestone 2",
"chance_of_success": 30,
"value": 149,
"sum": 412428.89628741
},
{
"id": "1203539b-f06c-442c-8ad0-f5a56f0615f6",
"name": "Contract",
"chance_of_success": 100,
"value": 144,
"sum": 358156.1110869
}
]
}
Get cases from milestone in pipeline
GET /reports/pipeline/relations_path_id/activities/:activity_id
Deprecated; will be removed as of January 1, 2019
Query string parameters
- Supports Pagination
Response
Status code 200
{
"data": [
{
"id": "de422243-645b-3111-a832-9ede3c2e41ae",
"case_number": 10,
"status": "open",
"account": {
"id": "76f3b0b7-5026-36d9-bdd3-622e27a2a917",
"name": "Sandberg A/S"
},
"contact": {
"id": "d6c702ef-1806-36c7-81bc-1a4f9555ed8b",
"name": "Alice Brandt"
},
"user": {
"id": 20,
"name": "Demarcus Adams"
},
"relations_path": {
"id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": null
},
"chance_of_success": 56,
"milestones": [
{
"id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
"name": "Contract",
"done": false
},
{
"id": "943cef92-f9b4-4fcb-b4e4-834f34915973",
"name": "Milestone 2",
"done": true
}
],
"latest_activity_at": "2015-05-16 06:24:46",
"estimated_close_date": "2016-03-08",
"created_at": "2015-02-24 12:34:56",
"updated_at": "2015-02-24 12:34:56"
}
],
"pagination": {
"total": 10,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": "null"
}
}
}
Relations
GET /reports/relations
Deprecated; will be removed as of January 1, 2019
For all relations endpoints you can use these query parameters
Query string parameters
start_date
date- Y-m-d H:i:s format
- default: now minus 1 month
end_date
date- Must be after
start_date
- Y-m-d H:i:s format
- default: now
- Must be after
users
integer - Comma separated list of ids.teams
integer - Comma separated list of ids.products
UUID - Comma separated list of ids.categories
integer - Comma separated list ids.group_by
string - This will change the output slightly, and nest the data.user
orteam
- default: null
lead_type_id
UUID - Comma separated list of lead ids.
Response
Status code 200
{
"statuses": {
"total": 1502,
"closed": 490,
"open": 493,
"declined": 519
},
"relations_paths": [
{
"id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": "Nam lacinia malesuada tellus",
"value": 741
}
]
}
For a specific relations path
GET /reports/relations/:relations_path_id
Deprecated; will be removed as of January 1, 2019
Response
Status code 200
{
"activities": [
{
"id": "943cef92-f9b4-4fcb-b4e4-834f34915973",
"name": "Milestone 2",
"value": 505,
"closed": 158,
"conversion_rate": 31.287128712871
},
{
"id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
"name": "Contract",
"value": 485,
"closed": 154,
"conversion_rate": 31.752577319588
}
]
}
Get a list of cases/contacts for a given activity-type
GET /reports/relations/:relations_path_id/activities/:activity_type_id
Deprecated; will be removed as of January 1, 2019
Parameters
user_id
integer - Show only activities for this user.team_id
integer - Show only activities for this team.lead_type_id
UUID - Comma separated list of lead type ids.
Response
Status code 200
{
"data": [
{
"id": "0a963440-e98b-3236-aada-bef846c610db",
"case_number": 4,
"status": "closed",
"account": {
"id": "3cb87c2f-0feb-3b10-90a1-b5d01bb3eb69",
"name": "B2C - Krogh & Vester"
},
"contact": {
"id": "068c7b4e-0bf5-3b97-9978-2be606e83df2",
"name": "Anton Dalsgaard"
},
"user": {
"id": 2,
"name": "Gisselle Wisoky"
},
"relations_path": {
"id": "9eae431b-3d0f-4528-9c59-e9d1a40fcd04",
"name": null
},
"chance_of_success": 82,
"milestones": [
{
"id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
"name": "Contract",
"done": true
},
{
"id": "943cef92-f9b4-4fcb-b4e4-834f34915973",
"name": "Milestone 2",
"done": true
}
],
"latest_activity_at": "2015-02-24 12:34:56",
"estimated_close_date": "2015-02-24",
"created_at": "2015-02-24 12:34:56",
"updated_at": "2015-05-30 07:11:35"
}
],
"pagination": {
"total": 10,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": null
}
}
}
Export
You can export from 2 endpoints
GET /reports/relations/export/pdf
Deprecated; will be removed as of January 1, 2019
GET /reports/relations/:relations_path_id/export/pdf
Deprecated; will be removed as of January 1, 2019
The URL returned is valid for 5 minutes.
Response
Status code 200
{
"url": "*URL TO PDF*"
}
Notify
You can export from 2 endpoints
POST /reports/relations/notify
Deprecated; will be removed as of January 1, 2019
POST /reports/relations/:relations_path_id/notify
Deprecated; will be removed as of January 1, 2019
Parameters
You can use the same params as for GET /reports/relations
and GET /reports/relations/:relations_path_id
notify.users
array- Required without notify.teams
notify.users.*
integer
notify.teams
array- Required without notify.users
notify.teams.*
integer
message
string - Message to display in notification.- Required
Payload
{
"notify": {
"users": [1, 2],
"teams": [1]
},
"message": "Some content"
}
Response
Status code 204
Avg process time
GET /reports/relations/:relations_path_id/process-time
Deprecated; will be removed as of January 1, 2019
Response
Status code 200
{
"data": [
{
"process_time": {
"diff_in_seconds": 16283,
"years": 0,
"months": 0,
"days": 0,
"hours": 4,
"minutes": 31,
"seconds": 23
},
"milestones": {
"from": {
"id": "943cef92-f9b4-4fcb-b4e4-834f34915973",
"name": "Milestone 2",
"sort_order": 2,
"set_status": "open",
"suggest_task_after": 172800,
"template_id": null,
"content_suggestions": null,
"extra_step": null,
"additional_steps": null,
"chance_of_success": 30
},
"to": {
"id": "a203539b-f06c-442c-8ad0-f5a56f0615f6",
"name": "Contract",
"sort_order": 1,
"set_status": "closed",
"suggest_task_after": 172800,
"template_id": null,
"content_suggestions": null,
"extra_step": null,
"additional_steps": [
"product_details",
"correspondence",
"automations"
],
"chance_of_success": 100
}
}
}
]
}
Campaign
Campaign report
You can get a report on your sent email campaigns.
GET /campaigns/:campaign_id/report
Deprecated; will be removed as of January 1, 2019
Query string parameters
start_date
date- Y-m-d H:i:s format
- default: campaign
start_date
end_date
date- Must be after
start_date
- Y-m-d H:i:s format
- default: campaign
start_date
plus 1 month
- Must be after
Response
Status code 200
{
"stats": {
"sent": 415,
"click": 40,
"open": 214
},
"links": [
{
"url": "http://example.com",
"value": 13
}
],
"date_histogram": [
{
"date": "2015-05-01 00:00:00",
"open": 2,
"click": 0
}
]
}
Leads
For all leads endpoints you can use these query parameters
Query string parameters
start_date
date- Y-m-d H:i:s format
- default: now minus 1 month
end_date
date- Must be after
start_date
- Y-m-d H:i:s format
- default: now
- Must be after
teams
integer - Comma separated list of ids.
Overview
GET /reports/leads
Deprecated; will be removed as of January 1, 2019
Query string parameters
- Supported query string parameters Leads
Response
Status code 200
{
"data": [
{
"name": "Magazine order",
"id": "2acb4738-dcd6-4e6e-aeb6-ed45ddeb9ab6",
"value": 6
},
{
"name": "Interested Buyer",
"id": "31401e63-3c07-4035-b727-5040dc55ff8c",
"value": 15
},
{
"name": "Test drive",
"id": "990f3e13-d891-460e-82da-5af3a223b6b3",
"value": 23
},
{
"name": "all",
"id": "all",
"value": 44
}
]
}
For a specific lead type
GET /reports/leads/:lead_type_id
Deprecated; will be removed as of January 1, 2019
Query string parameters
lead_type_id
UUID - Can also beall
, if you want to see all lead types.- Supported query string parameters Leads
Response
Status code 200
{
"data": [
{
"escalated": 4,
"accepted": 8,
"rejected": 10,
"assigned": 18,
"received": 30,
"escalated_no_first_activity": 4,
"revoked": 15,
"date_histogram": [
{
"date": "2015-10-01 00:00:00",
"escalated": {
"value": 0
},
"accepted": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
},
"avg_first_activity_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"rejected": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"assigned": {
"value": 0
},
"received": {
"value": 0
},
"escalated_no_first_activity": {
"value": 0
},
"revoked": {
"value": 0
}
},
{
"date": "2015-11-01 00:00:00",
"escalated": {
"value": 0
},
"accepted": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
},
"avg_first_activity_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"rejected": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"assigned": {
"value": 0
},
"received": {
"value": 0
},
"escalated_no_first_activity": {
"value": 0
},
"revoked": {
"value": 0
}
},
{
"date": "2015-12-01 00:00:00",
"escalated": {
"value": 0
},
"accepted": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
},
"avg_first_activity_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"rejected": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"assigned": {
"value": 0
},
"received": {
"value": 0
},
"escalated_no_first_activity": {
"value": 0
},
"revoked": {
"value": 0
}
},
{
"date": "2016-01-01 00:00:00",
"escalated": {
"value": 0
},
"accepted": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
},
"avg_first_activity_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"rejected": {
"value": 0,
"avg_process_time": {
"diff_in_seconds": 0,
"years": 0,
"months": 0,
"days": 0,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"assigned": {
"value": 0
},
"received": {
"value": 0
},
"escalated_no_first_activity": {
"value": 0
},
"revoked": {
"value": 0
}
},
{
"date": "2016-02-01 00:00:00",
"escalated": {
"value": 4
},
"accepted": {
"value": 8,
"avg_process_time": {
"diff_in_seconds": 172800,
"years": 0,
"months": 0,
"days": 2,
"hours": 0,
"minutes": 0,
"seconds": 0
},
"avg_first_activity_time": {
"diff_in_seconds": 86400,
"years": 0,
"months": 0,
"days": 1,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"rejected": {
"value": 10,
"avg_process_time": {
"diff_in_seconds": 172800,
"years": 0,
"months": 0,
"days": 2,
"hours": 0,
"minutes": 0,
"seconds": 0
}
},
"assigned": {
"value": 18
},
"received": {
"value": 30
},
"escalated_no_first_activity": {
"value": 4
},
"revoked": {
"value": 20
}
}
]
}
]
}
Tasks
Current
GET /reports/tasks/current
Deprecated; will be removed as of January 1, 2019
Query string parameters
users
integer - Comma separated list of ids.group_by
string - This will change the output slightly, and nest the data.user
orteam
- default: null
lead_type_id
UUID - Comma separated list of idsrelations_path_id
UUID - Comma separated list of ids.
Response
Status code 200
Without grouping
{
"tasks": {
"pending": 0,
"later": 2,
"overdue": 0
}
}
With grouping
{
"tasks": [
{
"id": 1,
"name": "Jane Doe",
"data": {
"pending": 0,
"later": 2,
"overdue": 0
}
}
]
}
Overview
GET /reports/tasks
Deprecated; will be removed as of January 1, 2019
Query string parameters
users
integer - Comma separated list of ids.teams
integer - Comma separated list of ids.group_by
string - This will change the output slightly, and nest the data.user
orteam
- default: null
lead_type_id
UUID - Comma separated list of idsrelations_path_id
UUID - Comma separated list of ids.
Response
Status code 200
{
"tasks": {
"in_date_range": {
"overdue_completed": 1,
"created": 460,
"completed": 142
},
"type_count": [
{
"name": "meeting",
"value": 700
},
{
"name": "call",
"value": 650
},
{
"name": "email",
"value": 650
}
]
}
}
Notify
POST /reports/tasks/notify
Parameters
notify.users
array- Required with out notify.teams
notify.users.*
integer
notify.teams
array- Required without notify.users
notify.teams.*
integer
message
string - Message to display in notification.- Required
Payload
{
"notify": {
"users": [1, 2],
"teams": [1]
},
"message": "Content of the message"
}
Response
Status code 204
Notified report
GET /reports/notified/:notified_report_id
The returned url is valid for 5 minutes.
Response
Status code 200
{
"url": "*URL TO PDF*"
}
Scheduled reports
Get all reports
GET /reports/scheduled-reports
Deprecated; will be removed as of January 1, 2019
Query string parameters
mine
bolean - Show your own reports.- Supports Pagination
Response
Status code 200
{
"data": [
{
"id": "e3666d8b-0d5a-4706-9553-c607c2d33345",
"name": "Second scheduled report",
"type": "tasks",
"user": {
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"team": {
"id": 1,
"name": "Team 1",
"address_1": "Savannah 123",
"address_2": "Under the tree on the left",
"zip_code": "4730",
"city": "Umzimkulu",
"state": "KwaZulu-Natal",
"country": null,
"phone_number": "031 308 7900",
"website": "https://easir.com",
"vat": "1234567890123456",
"group": null,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"schedule": {
"occurs": "daily",
"hour": 8
},
"created_at": "2015-06-16 12:13:00",
"updated_at": "2015-06-16 12:13:00"
}
],
"pagination": {
"total": 2,
"page": 1,
"per_page": 15,
"urls": {
"previous": null,
"next": null
}
}
}
Get a report
GET /reports/scheduled-reports/:scheduled_report_id
Deprecated; will be removed as of January 1, 2019
If you have a filter on your report it can be quiet verbose.
Response
Status code 200
{
"id": "e3666d8b-0d5a-4706-9553-c607c2d33345",
"name": "Second scheduled report",
"type": "tasks",
"user": {
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"team": {
"id": 1,
"name": "Team 1",
"address_1": "Savannah 123",
"address_2": "Under the tree on the left",
"zip_code": "4730",
"city": "Umzimkulu",
"state": "KwaZulu-Natal",
"country": null,
"phone_number": "031 308 7900",
"website": "https://easir.com",
"vat": "1234567890123456",
"group": null,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"schedule": {
"occurs": "daily",
"hour": 8
},
"filter": [],
"created_at": "2015-06-16 12:13:00",
"updated_at": "2015-06-16 12:13:00"
}
Create a report
POST /reports/scheduled-reports
Parameters
name
string- Between 1 and 255 characters
- Required
type
stringrelations
,leads
,tasks
orperformance
- Required
users
array - Users to receive the report.users.*
integer
schedule.occurs
stringdaily
,weekly
ormonthly
- Required
schedule.week_day
integer- Required if
schedule.occurs
isweekly
- 0 sunday - 6 saturday
- Required if
schedule.month_day
string- Required if
schedule.occurs
ismonthly
start
orend
- Required if
schedule.hour
integer- Between 0 and 23
- Required
filter.users
arrayfilter.users.*
integer
filter.teams
arrayfilter.teams.*
integer
filter.products
arrayfilter.products.*
UUID
filter.categories
arrayfilter.categories.*
integer
filter.group_by
string- If
type
isrelations
orleads
- Can be
team
,user
oractivities
- If
filter.relations_path_id
UUID - You can filter with a relations path id.- If
type
isrelations
ortasks
- If
filter.lead_type_id
UUID - You can filter with a lead type id.- If
type
isleads
,relations
ortasks
- If
Payload
{
"name": "My report",
"type": "relations",
"users": [
1,
2,
4
],
"schedule": {
"occurs": "daily",
"month_day": "end",
"hour": 14
},
"filter": {
"users": [
1
],
"teams": [
1
],
"group_by": "team",
"products": [
"f066bc3e-347f-3768-a280-b24aab19318f"
],
"categories": [
2
],
"relations_path_id": "1eae431b-3d0f-4528-9c59-e9d1a40fcd04"
}
}
Response
Status code 201
{
"id": "2d8818f7-ec90-4bd7-9855-f92b0d62b276",
"name": "My report",
"type": "relations",
"user": {
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"team": {
"id": 1,
"name": "Team 1",
"address_1": "Savannah 123",
"address_2": "Under the tree on the left",
"zip_code": "4730",
"city": "Umzimkulu",
"state": "KwaZulu-Natal",
"country": null,
"phone_number": "031 308 7900",
"website": "https://easir.com",
"vat": "1234567890123456",
"group": null,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"users": [
{
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
{
"id": 2,
"first_name": "Larue",
"last_name": "Ruecker",
"phone_number": "(521)317-9044x4393",
"job_title": "Business Insights Analyst",
"email": "0@example.com",
"profile_picture": null,
"created_at": "2014-07-02 03:45:53",
"updated_at": "2015-06-16 12:13:34"
},
{
"id": 4,
"first_name": "Charley",
"last_name": "Reilly",
"phone_number": "052.033.5256x688",
"job_title": "Data Analyst",
"email": "contacts@easir.com",
"profile_picture": null,
"created_at": "2015-06-03 19:10:13",
"updated_at": "2015-06-16 05:25:42"
}
],
"schedule": {
"occurs": "daily",
"month_day": "end",
"hour": 14
},
"filter": {
"users": [
{
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
}
],
"teams": [
{
"id": 1,
"name": "Team 1",
"address_1": "Savannah 123",
"address_2": "Under the tree on the left",
"zip_code": "4730",
"city": "Umzimkulu",
"state": "KwaZulu-Natal",
"country": null,
"phone_number": "031 308 7900",
"website": "https://easir.com",
"vat": "1234567890123456",
"group": null,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
}
],
"products": [
{
"id": "f066bc3e-347f-3768-a280-b24aab19318f",
"category": {
"id": 4,
"name": "Category 4",
"created_at": "2015-02-03 12:00:00",
"updated_at": "2015-02-03 12:00:00"
},
"fixed_fields": [
{
"id": 29,
"type": "text",
"name": "product_id",
"label": "Product id",
"value": "PRODUCT_ID",
"validation": null,
"required": false,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 30,
"type": "text",
"name": "name",
"label": "Name",
"value": "dolor",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 31,
"type": "numeric",
"name": "list_price",
"label": "List price",
"value": 331.35,
"validation": "numeric",
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 32,
"type": "numeric",
"name": "purchase_price",
"label": "Purchase price",
"value": 6.86,
"validation": "numeric",
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 33,
"type": "single_choice",
"name": "type",
"label": "Type",
"value": {
"id": 501,
"value": "Hours"
},
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 34,
"type": "numeric",
"name": "vat",
"label": "VAT",
"value": 26,
"validation": "numeric",
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
}
],
"custom_fields": [
{
"id": 14,
"type": "text",
"name": "custom_product_field",
"label": "Custom product field",
"value": null,
"validation": null,
"required": false,
"hidden": false,
"read_only": false,
"sort_order": 0
}
],
"created_at": "2015-02-24 12:34:56",
"updated_at": "2015-02-24 12:34:56"
}
],
"categories": [
{
"id": 2,
"name": "Category 2",
"created_at": "2015-02-03 12:00:00",
"updated_at": "2015-02-03 12:00:00"
}
]
},
"created_at": "2015-06-16 12:50:09",
"updated_at": "2015-06-16 12:50:09"
}
Update a report
PUT /reports/scheduled-reports/:scheduled_report_id
Deprecated; will be removed as of January 1, 2019
Parameters
- Uses same parameters as Create a report
Payload
{
"name": "Donec ultricies turpis ut cursus semper",
"type": "relations",
"users": [
1,
2,
4
],
"schedule": {
"occurs": "daily",
"month_day": "end",
"hour": 14
},
"filter": {
"users": [
1
],
"teams": [
1
],
"group_by": "team",
"products": [
"f066bc3e-347f-3768-a280-b24aab19318f"
],
"categories": [
2
],
"relations_path_id": "1eae431b-3d0f-4528-9c59-e9d1a40fcd04"
}
}
Response
Status code 200
{
"id": "2d8818f7-ec90-4bd7-9855-f92b0d62b276",
"name": "Donec ultricies turpis ut cursus semper",
"type": "relations",
"user": {
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"team": {
"id": 1,
"name": "Team 1",
"address_1": "Savannah 123",
"address_2": "Under the tree on the left",
"zip_code": "4730",
"city": "Umzimkulu",
"state": "KwaZulu-Natal",
"country": null,
"phone_number": "031 308 7900",
"website": "https://easir.com",
"vat": "1234567890123456",
"group": null,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
"users": [
{
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
},
{
"id": 2,
"first_name": "Larue",
"last_name": "Ruecker",
"phone_number": "(521)317-9044x4393",
"job_title": "Business Insights Analyst",
"email": "0@example.com",
"profile_picture": null,
"created_at": "2014-07-02 03:45:53",
"updated_at": "2015-06-16 12:13:34"
},
{
"id": 4,
"first_name": "Charley",
"last_name": "Reilly",
"phone_number": "052.033.5256x688",
"job_title": "Data Analyst",
"email": "contacts@easir.com",
"profile_picture": null,
"created_at": "2015-06-03 19:10:13",
"updated_at": "2015-06-16 05:25:42"
}
],
"schedule": {
"occurs": "daily",
"month_day": "end",
"hour": 14
},
"filter": {
"users": [
{
"id": 1,
"first_name": "Doe",
"last_name": "John",
"phone_number": "+4588888888",
"job_title": "Animal",
"email": "info@easir.com",
"profile_picture": "http://api.randomuser.me/portraits/thumb/women/5.jpg",
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
}
],
"teams": [
{
"id": 1,
"name": "Team 1",
"address_1": "Savannah 123",
"address_2": "Under the tree on the left",
"zip_code": "4730",
"city": "Umzimkulu",
"state": "KwaZulu-Natal",
"country": null,
"phone_number": "031 308 7900",
"website": "https://easir.com",
"vat": "1234567890123456",
"group": null,
"created_at": "2014-01-01 12:45:56",
"updated_at": "2014-01-02 00:11:22"
}
],
"products": [
{
"id": "f066bc3e-347f-3768-a280-b24aab19318f",
"category": {
"id": 4,
"name": "Category 4",
"created_at": "2015-02-03 12:00:00",
"updated_at": "2015-02-03 12:00:00"
},
"fixed_fields": [
{
"id": 29,
"type": "text",
"name": "product_id",
"label": "Product id",
"value": "PRODUCT_ID",
"validation": null,
"required": false,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 30,
"type": "text",
"name": "name",
"label": "Name",
"value": "dolor",
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 31,
"type": "numeric",
"name": "list_price",
"label": "List price",
"value": 331.35,
"validation": "numeric",
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 32,
"type": "numeric",
"name": "purchase_price",
"label": "Purchase price",
"value": 6.86,
"validation": "numeric",
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 33,
"type": "single_choice",
"name": "type",
"label": "Type",
"value": {
"id": 501,
"value": "Hours"
},
"validation": null,
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
},
{
"id": 34,
"type": "numeric",
"name": "vat",
"label": "VAT",
"value": 26,
"validation": "numeric",
"required": true,
"hidden": false,
"read_only": false,
"sort_order": 0
}
],
"custom_fields": [
{
"id": 14,
"type": "text",
"name": "custom_product_field",
"label": "Custom product field",
"value": null,
"validation": null,
"required": false,
"hidden": false,
"read_only": false,
"sort_order": 0
}
],
"created_at": "2015-02-24 12:34:56",
"updated_at": "2015-02-24 12:34:56"
}
],
"categories": [
{
"id": 2,
"name": "Category 2",
"created_at": "2015-02-03 12:00:00",
"updated_at": "2015-02-03 12:00:00"
}
]
},
"created_at": "2015-06-16 12:50:09",
"updated_at": "2015-06-16 12:50:50"
}
Delete a report
DELETE /reports/scheduled-reports/:scheduled_report_id
Deprecated; will be removed as of January 1, 2019
Response
Status code 204