Skip to main content
Manage your project’s leads (contacts) via API: CRUD, segments, tags, and attributes.

Authentication

All requests require a Bearer token:
Learn more in Public API v1.

Endpoints

POST /v1/leads

Creates or updates one or more leads. If the email already exists, it is updated (upsert). If an email is repeated in a bulk request, it is deduplicated and the last occurrence wins.
Response 201 Created
created: true = new lead. created: false = existing lead updated. If a segment_id does not exist, the leads are still created and the response includes a warnings field (array of strings) with the segments that were not found.

GET /v1/leads

Lists leads with pagination, ordered by creation date descending.
Response 200 OK

GET /v1/leads/:id

Get a lead by ID (UUID), including its segments.
Response 200 OK
shopify_customer_id is the customer’s ID in Shopify if the lead comes from the Shopify sync; null otherwise.

PUT /v1/leads/:id

Updates a lead. At least one of email, data, or segment_ids is required. *At least one of the three is required. For partial attribute merging, see Attributes.
Response 200 OK
Errors: if the new email already exists on another lead in the project, it responds 409.

DELETE /v1/leads/:id

Deletes a lead and its segment memberships.
Response 200 OK

Segments

POST /v1/leads/:id/segments

Adds a lead to one or more segments.
Response 200 OK
Errors: if any segment does not exist in the project, it responds 404 and adds none.

DELETE /v1/leads/:id/segments/:segmentId

Removes a lead from a segment.
Response 200 OK
Errors: if the lead does not belong to the segment, it responds 404.

Tags

Tags are text labels. They are stored as an array under the reserved key _tags within the lead’s attributes (data). The :email in the path must be URL-encoded (for example, jane%40acme.com).

POST /v1/leads/:email/tags

Adds tags to a lead; they are merged with the existing ones, without duplicates.
Response 200 OK

DELETE /v1/leads/:email/tags

Removes tags from a lead.
Response 200 OK

GET /v1/leads/:email/tags

Lists a lead’s tags.
Response 200 OK

Attributes

Custom attributes in the lead’s data field. They are merged (shallow) with the existing ones; the reserved key _tags is preserved. The :email in the path must be URL-encoded.

POST /v1/leads/:email/attributes

Sets custom attributes on a lead. The body is a flat JSON object.
Response 200 OK

GET /v1/leads/:email/attributes

Returns the lead’s attributes, excluding the reserved key _tags.
Response 200 OK

Errors

Error format:
500 errors may include a details field with the error detail. See the Node.js SDK guide.