Leads & CRM

Manage leads & CRM

Lead Overview

get
https://<domain>/<api prefix>/<version>/leads/overview/

Sample Code

Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/leads/overview/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/leads/overview/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Responses

Status Code
Error Type
Field
Description
400
Validation Error
appointment
Invalid appointment filter value.

List Leads

get
https://<domain>/<api prefix>/<version>/leads/list/

Sample Code

Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/leads/list/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/leads/list/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

List Appointments

get
https://<domain>/<api prefix>/<version>/leads/appointments/list/

Sample Code

Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/appointments/list/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/appointments/list/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Lead Details

get
https://<domain>/<api prefix>/<version>/leads/view/lead/

Sample Code

Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/view/lead/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/view/lead/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Responses

Status Code
Error Type
Field
Description
400
Validation Error
slug
This field is required and this may not be blank.
Requested slug is invalid.

Create Appointment

post
https://<domain>/<api prefix>/<version>/leads/create/appointment/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/create/appointment/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
},
formData: {
'slug': '<lead_slug>',
'appointment_date': '<yyyy-mm-dd HH:MM>',
'appointment_note': '<appointment_note>',
'appointment_status': '<appointment_status>',
'appointment_to': '<yyyy-mm-dd HH:MM>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/create/appointment/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('slug' => '<lead_slug>','appointment_date' => '<yyyy-mm-dd HH:MM>','appointment_note' => '<appointment_note>','appointment_status' => '<appointment_status>','appointment_to' => '<yyyy-mm-dd HH:MM>'),
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Responses

Status Code
Error Type
Field
Description
401
Request Failed
Body data not found.
Appointment schedule exists for this time.
End Date Can't be prior to Start Date.
Please Specify a date in the future.
400
Validation Error
slug
This field is required.
This field is may not be blank.
Requested slug is invalid.
You can't take appointment under this lead.
400
Validation Error
appointment_date
This field is required.
This field is may not be blank.
Invalid date format.
400
Validation Error
appointment_to
This field is required.
This field is may not be blank.
Invalid date format.
400
Validation Error
appointment_note
Ensure this field has no more than 200 characters.
400
Validation Error
appointment_status
Invalid appointment status.

Update Appointment

post
https://<domain>/<api prefix>/<version>/leads/update/appointment/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/update/appointment/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
},
formData: {
'appointment_id': '<appointment_id>'
'slug': '<lead_slug>',
'appointment_date': '<appointment_date>',
'appointment_note': '<appointment_note>',
'appointment_status': '<appointment_status>',
'appointment_to': '<appointment_to>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/update/appointment/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('slug' => '<lead_slug>','appointment_date' => '<appointment_date>','appointment_note' => '<appointment_note>','appointment_status' => '<appointment_status>','appointment_to' => '<appointment_to>','appointment_id' => '<appointment_id>'),
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Responses

Status Code
Error Type
Field
Description
401
Request Failed
Body data not found.
Appointment schedule exists for this time.
End Date Can't be prior to Start Date.
Please Specify a date in the future.
You can't update this appointment.
400
Validation Error
appointment_id
This field is required.
This field is may not be blank.
Invalid appointment id.
Requested appointment not found.
400
Validation Error
slug
This field is may not be blank.
Requested slug is invalid.
You can't take appointment under this lead.
400
Validation Error
appointment_date
This field is may not be blank.
Invalid date format.
400
Validation Error
appointment_to
This field is may not be blank.
Invalid date format.
400
Validation Error
appointment_note
Ensure this field has no more than 200 characters.
400
Validation Error
appointment_status
Invalid appointment status.

Delete Appointment

post
https://<domain>/<api prefix>/<version>/leads/delete/appointment/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/delete/appointment/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
},
formData: {
'appointment_id': '<appointment id>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/delete/appointment/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('appointment_id' => '<appointment id>'),
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Responses

Status Code
Error Type
Field
Description
401
Request Failed
You can't delete this appointment.
400
Validation Error
appointment_id
This field is required.
This field is may not be blank.
Invalid appointment id.
Requested appointment not found.

Create Lead

post
https://<domain>/<api prefix>/<version>/v1/leads/create/lead/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/v1/create/lead/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
},
formData: {
'first_name': '<first_name>',
'last_name': '<last_name>',
'email': '<email>',
'status': '<status>',
'source': '<source>',
'phone': '<phone>',
'location': '<location>',
'message': '<message>',
'assignee': '<assignee_username>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/v1/create/lead/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('first_name' => '<first_name>','last_name' => '<last_name>','email' => '<email>','status' => '<status>','source' => '<source>','phone' => '<phone>','location' => '<location>','message' => '<message>','assignee' => '<assignee>'),
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Response

Status Code
Error Type
Field
Description
400
Validation Error
first_name
This field is required.
This field may not be blank.
Ensure this field has no more than 255 characters.
400
Validation Error
last_name
This field is required.
This field may not be blank.
Ensure this field has no more than 255 characters.
400
Validation Error
email
This field is required.
This field may not be blank.
Ensure this field has no more than 255 characters.
Invalid email.
400
Validation Error
phone
This field is required.
This field may not be blank.
Phone number must be entered in the format: '999999999'. Up to 15 digits allowed.
400
Validation Error
location
Ensure this field has no more than 255 characters.
400
Validation Error
message
Ensure this field has no more than 255 characters.
400
Validation Error
status
<status> is not a valid choice.
400
Validation Error
source
<source> is not a valid choice.
400
Validation Error
assignee
This field may not be blank.
Assignee not found.

Update Lead

post
https://<domain>/<api prefix>/<version>/leads/update/lead/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/update/lead/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
},
formData: {
'first_name': '<first_name>',
'last_name': '<last_name>',
'email': '<email>',
'status': '<status>',
'source': '<source>',
'phone': '<phone>',
'location': '<location>',
'message': '<message>',
'slug': '<lead_slug>',
'assignee': '<assignee_username>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/update/lead/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('first_name' => '<first_name>','last_name' => '<last_name>','email' => '<email>','status' => '<status>','source' => '<source>','phone' => '<phone>','location' => '<location>','message' => '<message>','slug' => '<lead_slug>','assignee' => '<assignee_username>'),
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Error Responses

Status Code
Error Type
Field
Description
400
Validation Error
slug
This field is required.
This field may not be blank.
Ensure this field has no more than 258 characters.
400
Validation Error
first_name
This field is required.
This field may not be blank.
Ensure this field has no more than 255 characters.
400
Validation Error
last_name
This field is required.
This field may not be blank.
Ensure this field has no more than 255 characters.
400
Validation Error
email
This field is required.
This field may not be blank.
Ensure this field has no more than 255 characters.
Invalid email.
400
Validation Error
phone
This field is required.
This field may not be blank.
Phone number must be entered in the format: '999999999'. Up to 15 digits allowed.
400
Validation Error
location
Ensure this field has no more than 255 characters.
400
Validation Error
message
Ensure this field has no more than 255 characters.
400
Validation Error
status
<status> is not a valid choice.
400
Validation Error
source
<source> is not a valid choice.
400
Validation Error
assignee
This field may not be blank.
Assignee not found.
401
Request Failed
Requested lead does not esixt.
You are not owner of this lead.

Delete Lead

post
https://<domain>/<api prefix>/<version>/leads/delete/lead/

Sample Code

Node
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://<domain>/<api prefix>/<version>/delete/lead/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>'
},
formData: {
'slug': '<lead_slug>'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/delete/lead/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('slug' => 'binuser1'),
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>'
),
));
$response = curl_exec($curl);