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 /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=2On 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=nameYou 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 /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"
}
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)
PUT /api/v2/leads/:idYou may provide a partial list of fields to update
{
"lead": {
"number": "102"
}
}
Unique Fields: number (HTTP 422 on failure)
DELETE /api/v2/leads/:idDeleting a lead will result in the deletion of all associated Estimates and Contacts. Deletions are permanent and not reversible.