Leads

Retrieve and update lead information.

Get Leads

GET https://api.clients.icaal.co.uk/leads

This endpoint will list all leads ordered by the most recent.

Query Parameters

Name
Type
Description

page

integer

Offset the results page.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

{
  "current_page": 1,
  "data": [
    {
      "id": 1,
      "reference": "92ccb3f8-358f-4ffc-be49-683f5a0b3a65",
      "name": "Casement Window Lead",
      "value": 0,
      "description": null,
      "postcode": "SO14 2AL",
      "user_agent": "Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/89.0.4389.82 Safari\/537.36",
      "ip": "192.168.10.1",
      "referrer": "Direct",
      "referrer_url": null,
      "device_type": "desktop",
      "device_name": "Apple Macintosh",
      "browser": "Chrome",
      "browser_version": "89.0.4389.82",
      "os": "OS X",
      "os_version": "10.15.0",
      "status": "open",
      "type": "quote",
      "test": 1,
      "created_at": "2021-01-01T12:00:00.000000Z",
      "updated_at": "2021-01-01T12:00:00.000000Z",
    }
  ],
  "first_page_url": "https://api.clients.icaal.co.uk/leads?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "https://api.clients.icaal.co.uk/leads?page=1",
  "next_page_url": null,
  "path": "https://api.clients.icaal.co.uk/leads",
  "per_page": 20,
  "prev_page_url": null,
  "to": 20,
  "total": 1
}

Create Lead

POST https://api.clients.icaal.co.uk/leads

Create a new lead with associated customer data.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

Request Body

Name
Type
Description

name

string

The name of the lead (e.g. Casement Window Lead).

first_name

string

The customer's first name.

last_name

string

The customer's last name.

company_name

string

The company associated with the customer.

email

string

The customer's email address.

phone

string

The customer's telephone number.

mobile

string

The customer's mobile number.

postcode

string

The UK postcode of the lead.

referrer

string

One of the following values: Canvasser, Email, Existing Customer, Facebook, Live Chat, Phone, Purchased Lead, Showroom, Website

status

string

The status of the lead. Check the lead statuses endpoint for a list of valid values.

user_id

integer

The ID of the user to assign to the lead.

Retrieve Lead

GET https://api.clients.icaal.co.uk/leads/:reference

Retrieve a specific lead and it's associated data.

Path Parameters

Name
Type
Description

reference

string

The UUID that identifies the lead.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

Update Lead

PATCH https://api.clients.icaal.co.uk/leads/:reference

Update an existing lead.

Path Parameters

Name
Type
Description

reference

string

The UUID that identifies the lead.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

Request Body

Name
Type
Description

value

integer

The numeric value of the lead in GBP.

status

string

Status of the lead.

Schedule Appointment

POST https://api.clients.icaal.co.uk/leads/:reference/appointments

Schedule an appointment for a lead.

Path Parameters

Name
Type
Description

reference

string

The UUID that identifies the lead.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

Request Body

Name
Type
Description

notify

boolean

Notify user of appointment.

user_id

integer

The user to assign the appointment to.

date

string

The requested appointment datetime formatted as dd/mm/yyyy hh:mm

Schedule Callback

POST https://api.clients.icaal.co.uk/leads/:reference/callbacks

Schedule a callback for a lead.

Path Parameters

Name
Type
Description

reference

string

The UUID that identifies the lead.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

Request Body

Name
Type
Description

notify

boolean

Notify user of callback.

user_id

integer

The user to assign the appointment to.

date

string

The requested callback datetime formatted as dd/mm/yyyy hh:mm

Attach a file

POST https://api.clients.icaal.co.uk/leads/:reference/attachments

Attach a file to a lead (max 10mb). This should be sent a multipart form data.

Path Parameters

Name
Type
Description

reference

string

The UUID that identifies the lead.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

Content-Type

string

multipart/form-data

Request Body

Name
Type
Description

name

string

The name of the file.

file

string

The file in one of the following formats jpeg,png,gif,svg,pdf,txt,xlsx,docx

List Lead Statuses

GET https://api.clients.icaal.co.uk/leads/statuses

List available lead statuses.

Headers

Name
Type
Description

Authorization

string

Authenticate using the bearer token.

Last updated