Skip to content

CRM

Leads

Contacts in your pipelines. Creating a lead logs a “Lead created” activity and starts any flow listening for new leads.

POST/v1/api/product/erix/crm/leads

Create a lead in a pipeline.

firstNamestringRequired
Contact’s first name.
phonestringRequired
Mobile number with country code, e.g. +91XXXXXXXXXX.
lastNamestringOptional
Contact’s last name.
emailstringOptional
Email address.
sourcestringOptional
Where the lead came from, e.g. website.
pipelineIdstringOptional
Defaults to your default pipeline.
stageIdstringOptional
Defaults to the pipeline’s first stage.
valuenumberOptional
Deal value.
metadataobjectOptional
Your own key/value data.

POST/v1/api/product/erix/crm/leads/upsert

Find a lead by phone, then update it or create it. Best for forms and webhooks.

leadDataobjectRequired
Lead fields; must include phone.
refsobjectOptional
Your own ids, e.g. { "orderId": "…" }. Saved on the lead for lookups.
pipelineIdstringOptional
Pipeline for a new lead.
stageIdstringOptional
Stage to create in, or move an existing lead to.
triggerstringOptional
A label for what caused the upsert, saved on the lead.

GET/v1/api/product/erix/crm/leads

Paginated, filterable list of leads.

searchstringOptional
Matches name, phone or email.
statusstringOptional
Lead status.
pipelineId / stageIdstringOptional
Limit to a pipeline or stage.
source / tagsstringOptional
Filter by source or tag.
startDate / endDateISO dateOptional
Created within this range.
page / limitnumberOptional
Pagination.
sortBy / sortDirstringOptional
Sort field and asc or desc.

GET/v1/api/product/erix/crm/leads/:leadId

Get one lead.

GET/v1/api/product/erix/crm/leads/phone/:phone

Look up a lead by phone number.

PATCH/v1/api/product/erix/crm/leads/:leadId

Update a lead’s fields.

PATCH/v1/api/product/erix/crm/leads/:leadId/move

Move a lead to another stage. Won and lost stages update its status.

stageIdstringRequired
Target stage.

PATCH/v1/api/product/erix/crm/leads/:leadId/tags

Add or remove tags.

addstring[]Optional
Tags to add.
removestring[]Optional
Tags to remove.

DELETE/v1/api/product/erix/crm/leads/:leadId

Archive a lead (soft delete).

const { data: lead } = await ecod.product.erix.leads.upsert({
  leadData: { firstName: "Asha", phone: "+91XXXXXXXXXX" },
  refs: { orderId: "ORD-1001" },
});

const { data: page } = await ecod.product.erix.leads.list({
  search: "Asha",
  limit: 20,
});

await ecod.product.erix.leads.move(lead.id, "STAGE_ID");
await ecod.product.erix.leads.tags(lead.id, { add: ["vip"] });