Skip to content

Leads

List, create, read, update and move leads through your pipeline.

3 min read

List leads

http
GET /api/v1/leads
ParameterDescription
filter[status]Status public id
filter[owner]Membership public id
filter[source]Source public id
filter[created_at]A date range, or a keyword such as last_30_days
filter[score_band]hot, warm or cold
sortcreated_at, updated_at, score or next_action_at; prefix - for descending (default -created_at)
page[size]Up to 200; defaults to 50
page[after]Cursor taken from links.next
Note
Filter values are public ids, not names or slugs. An unrecognised filter key is refused with 400 (unknown_filter_field), but a public id that matches nothing returns 200 with an empty list — so when you add a filter, verify it returns the rows you expect, not merely that it returned 200.

Results are always scoped to what your token's membership may see. A manager's token returns their team; an agent's token returns their own leads. There is no parameter that widens this.

Create a lead

http
POST /api/v1/leads
json
{
  "first_name": "Aarav",
  "last_name": "Patel",
  "phone": "9812300045",
  "email": "aarav@example.com",
  "source": "01H8XGJWBWBAQ4S1PT7C2N3M4K",
  "city": "Mumbai",
  "custom_fields": { "product_interest": "Annual plan" }
}

Distribution rules apply only to a lead created without an owner, which is routed like one from a web form. Sending owner assigns the lead to that member, and a token whose role keeps the leads it creates (Agent and Team Lead by default) assigns it to the token's member; neither is routed.

Duplicate detection runs on phone and email. A match returns 201 with the existing lead rather than creating a second record, and logs the request as a repeat enquiry on it (its duplicate_count goes up by one) — so a retry does not create a second lead, though it does count as another enquiry.

Read a lead

http
GET /api/v1/leads/{public_id}

Returns the lead with its contact, source, status, attribution and custom fields; add ?include=owner to fill in its owner. For the timeline, call GET /api/v1/leads/{public_id}/timeline.

Update a lead

http
PATCH /api/v1/leads/{public_id}

Send only the fields you are changing. Every change is written to the audit trail with the member your token belongs to recorded as the actor, so an API-driven edit is as traceable as one made in the interface.

Move a lead's stage

http
POST /api/v1/leads/{public_id}/status
json
{ "status": "01H8XGK2M4P5Q6R7S8T9V0W1X2", "note": "Customer confirmed budget" }
Important
Use this rather than PATCHing a status field. It records a proper stage transition, and transitions are what funnel, velocity and conversion reporting read. PATCH has no status field: a status sent there is ignored and the lead stays in its stage.

Stuck on a response you did not expect? Send us the request_id from the error body and we can trace the exact call — contact support.

Leads — API reference — atomcrm.ai