Leads

Leads represent companies, groups, organizations or other contact containers that are prospective Clients. Leads can contain estimates and contacts. Leads JSON objects are very similar to Clients because a Lead can be converted to a Client.

Get All Leads

GET /api/v2/leads
{
  "page_count": 7
  "page_size": 10
  "total_count": 61
  "leads": [
    {
      "number": "101"
      "name": "ACME Corp"
      "city": "New York"
      "address": "123 Main St."
      "zip": "12345"
      "country": "US"
      "id": 2123
      "invoice_extra_fields": null
      "website": "http://www.example.com"
      "address_2": "Suite 101"
      "description": "A sample API Lead"
      "state": "NY"
    },
    ...
  ]
}
GET /api/v2/leads?page=2

On a bulk GET Clientary will return 20 results at once. To paginate through more results, you can use the page parameter.

GET /api/v2/leads?sort=name

You can get the most recently created leads by name, rather than the default sort which is based on date (by newest first). Another possible value is oldest which allows sorting by oldest Leads first.

Get A Lead

GET /api/v2/leads/:id
{
  "number": "101"
  "name"": "ACME Corp"
  "city": "New York"
  "address": "123 Main St."
  "zip": "12345"
  "country": "US"
  "id": 2123
  "invoice_extra_fields": null
  "website": "http://www.example.com"
  "address_2": "Suite 101"
  "description": "A sample API Lead"
  "state": "NY"
}

Create A New Lead

POST /api/v2/Lead
{
  "lead": {
    "name": "ACME Corp"
  }
}

Required Fields: name (HTTP 422 on failure)
Unique Fields: number (HTTP 422 on failure)
Other Requirements: must meet plan limits (HTTP 426 on failure)

Update A Lead

PUT /api/v2/leads/:id

You may provide a partial list of fields to update

{
  "lead": {
    "number": "102"
  }
}

Unique Fields: number (HTTP 422 on failure)

Delete A Lead

DELETE /api/v2/leads/:id

Deleting a lead will result in the deletion of all associated Estimates and Contacts. Deletions are permanent and not reversible.