List leads
leads:read
Query parameters
| Param | Type | Notes |
|---|---|---|
limit, offset, sortOrder, query | — | See Pagination. query matches first name, last name, email, company, and phone digits. |
sortBy | string | One of createdAt, firstName, email, company, status, source, estimatedValue. |
status | enum | Filter by LeadStatus. |
source | enum | Filter by LeadSource. |
Response 200
Create a lead
leads:write
At least one of email or phone is required. Empty strings are treated as missing.
Request body
Source field semantics. FlowEstate accepts any string for
source. Known LeadSource values are stored as-is. Unknown values are stored as other on the enum column, with the original string preserved in sourceMetadata.providedSource. This lets you keep your own UTM/campaign mapping without losing data.Response 201
Common errors
400 VALIDATION_ERROR— invalid email, or both email and phone missing.403 FORBIDDEN— plan limit reached. Message identifies the limit.
Webhook side effects
Alead.created event is dispatched with X-FlowEstate-Source: api.
Get a lead
leads:read. Returns the same shape as a list item. 404 NOT_FOUND if the lead doesn’t exist or belongs to another org.
Update a lead
leads:write. Same body as create, all fields optional. Must provide at least one field. The contact-identity rule (email or phone) still applies after the merge.
Pass null to clear a field; omit it to leave it untouched.
Webhook side effects
- Always:
lead.updated. - If
stageIdchanged:lead.stage_changed. - If
statuschanged towon:lead.won. Tolost:lead.lost. - If
assignedToIdchanged:lead.assigned(when set) orlead.unassigned(when cleared).
Delete a lead
leads:write.
Response 200
Webhook side effects
Alead.deleted event is dispatched.
Search a lead
leads:read. Designed for Zapier / Make “Find Lead” steps.
Query parameters
At least one of these is required:| Param | Description |
|---|---|
email | Exact match (normalized to lowercase). |
phone | Matches against the digit-only form of stored phones (so +1 (809) 555-1234 matches 8095551234). |
q | Fuzzy match on first/last name, email, company. |
limit | 1..50, default 10. |
Response 200
List activities
leads:read. Lists timeline activities (notes, calls, emails, meetings, system events).
Query parameters
| Param | Notes |
|---|---|
limit | 1..100, default 20. |
offset | Default 0. |
type | Filter by LeadActivityType. |
activityScope | Filter by LeadActivityScope. Defaults to lead_event. |
Response 200
Add a note
leads:write.
Request body
content is required, 1..5000 chars.
Response 201
Webhook side effects
Alead.note_added event is dispatched.
Log a communication
leads:write. Records a phone call, email, meeting, or social-media message against the lead’s timeline.
Request body
| Field | Required | Notes |
|---|---|---|
type | yes | One of call, email, meeting, social_message. |
direction | yes | inbound or outbound. |
content | no | Free text, ≤ 5000 chars. |
Response 201
Webhook side effects
Alead.communication_logged event is dispatched.