Authentication
All requests require a Bearer token: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.
- cURL
- Node.js
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.- cURL
- Node.js
200 OK
GET /v1/leads/:id
Get a lead by ID (UUID), including its segments.- cURL
- Node.js
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 ofemail, data, or segment_ids is required.
*At least one of the three is required. For partial attribute merging, see Attributes.
- cURL
- Node.js
200 OK
email already exists on another lead in the project, it responds 409.
DELETE /v1/leads/:id
Deletes a lead and its segment memberships.- cURL
- Node.js
200 OK
Segments
POST /v1/leads/:id/segments
Adds a lead to one or more segments.- cURL
200 OK
404 and adds none.
DELETE /v1/leads/:id/segments/:segmentId
Removes a lead from a segment.- cURL
200 OK
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.- cURL
- Node.js
200 OK
DELETE /v1/leads/:email/tags
Removes tags from a lead.- cURL
- Node.js
200 OK
GET /v1/leads/:email/tags
Lists a lead’s tags.- cURL
- Node.js
200 OK
Attributes
Custom attributes in the lead’sdata 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.- cURL
- Node.js
200 OK
GET /v1/leads/:email/attributes
Returns the lead’s attributes, excluding the reserved key_tags.
- cURL
- Node.js
200 OK
Errors
Error format:
500 errors may include a details field with the error detail.
See the Node.js SDK guide.