Leads & CRM

Manage leads & CRM

Lead Overview

GET ‎https://<domain>/<api prefix>/<version>/leads/overview/

This API endpoint will return lead summary and appointments.

Query Parameters

Headers

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "LeadsData": {
            "status": [
                {
                    "status": <status>,
                    "count": <count>,
                    "Description": "<short_description>",
                    "Color": "<color>"
                },
                ...
            ],
            "source": [
                {
                    "source": <source>
                    "count": <count>
                },
                ...
            ]
        },
        "TotalLeads": <total_leads_count>,
        "appointments": [
            {
                "appointment_note": "<appointment_note>",
                "appointment_status": "<appointment_status>",
                "appointment_date": "<appointment_date>",
                "appointment_to": "<appointment_to>"
            }
        ]
    }
}

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

List Leads

GET ‎https://<domain>/<api prefix>/<version>/leads/list/

This API endpoint will return a list of owned leads. Use the same URL to get a list of assigned leads with a query parameter list_type as 'assigned'.

Query Parameters

Headers

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "results": [
            {
                "id": <lead_id>,
                "slug": "<lead_slug>",
                "first_name": "<first_name>",
                "last_name": "<last_name>",
                "name": "<full_name>",
                "phone": "<phone_number>",
                "email": "<email_address>",
                "added_on": "<created_date>",
                "status": "<lead_status>",
                "source": "<lead_source>",
                "owner": "<owner_name>"
            }
            ...
        ],
        "count": <list_count>,
        "previous": <previous_page_url>,
        "next": <next_page_url>
    }
}

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/

This API endpoint will return a list of appointments.

Query Parameters

Headers

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "results": [
            {
                "id": <appointment_id>,
                "lead_id": <lead_id>,
                "lead": "<lead_name>",
                "leadslug": "<lead_slug>",
                "leadstatus": "<lead_status>",
                "fromdate": "<from_date>",
                "appointment_note": "<appointment_note>",
                "appointment_status": "<appointment_status>",
                "todate": "<to_date>"
            }
            ...
        ],
        "count": <list_count>,
        "previous": <previous_page_url>,
        "next": <next_page_url>
    }
}

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/

This API endpoint will return details of a lead.

Query Parameters

Headers

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {
        "id": <lead_id>,
        "slug": "<lead_slug>",
        "first_name": "<first_name>",
        "name": "<name>",
        "last_name": "<last_name>",
        "phone": "<phone_number>",
        "email": "<email_address>",
        "status": "<lead_status>",
        "source": "<lead_source>",
        "message": "<lead_message>",
        "added_on": "<created_date>",
        "recent_activities": [
            {
                "id": <activity_id>,
                "activity_type": "<activity_type>",
                "created": "<activity_added_date>",
                "activity": "<activity>"
            },
            ...
        ],
        "notes": [
            {
                "id": <note_id>,
                "note": "<note>",
                "note_created": "<note_created_date>",
                "user": "<note_created_user>"
            }
            ...
        ],
        "conversion": <conversion_percentage>
    }
}

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

Create Appointment

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

This API endpoint will create an appointment in a lead.

Headers

Request Body

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

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

Update Appointment

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

This API endpoint will update an appointment.

Query Parameters

Headers

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

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

Delete Appointment

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

This API endpoint will delete an appointment.

Headers

Request Body

​HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

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

Create Lead

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

This API endpoint will create a lead.

Headers

Request Body

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

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

Update Lead

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

This API endpoint will update a lead.

Headers

Request Body

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

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

Delete Lead

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

This API endpoint will delete a lead.

Headers

Request Body

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

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

curl_close($curl);
echo $response;

Error Responses

Create Lead Note

POST ‎https://<domain>/<api prefix>/<version>/leads/create/leadnote/

This API endpoint will create a note on lead.

Headers

Request Body

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/create/leadnote/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>'
  },
  formData: {
    'slug': '<lead_slug>',
    'note': '<note>'
  }
};
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/leadnote/',
  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>','note' => '<note>'),
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access token>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Delete Lead Note

POST ‎https://<domain>/<api prefix>/<version>/leads/delete/leadnote/

This API endpoint will delete a note of lead.

Headers

Request Body

HTTP/1.1 200 OK
Content-Type: application/json

Body:
{
    "status_code": 200,
    "errors": {},
    "data": {}
}

Sample Code

Node

var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://<domain>/<api prefix>/<version>/delete/leadnote/',
  'headers': {
    'apikey': '<apikey>',
    'Authorization': 'Bearer <access token>'
  },
  formData: {
    'note_id': '<note_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/leadnote/',
  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('note_id' => '<nit_id>'),
  CURLOPT_HTTPHEADER => array(
    'apikey: <apikey>',
    'Authorization: Bearer <access-token>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Error Responses

Last updated