LeadFlowXLeadFlowX

AI-Powered B2B CRM

API: Leads

Create, read, update, and delete leads.

List Leads

GET
/api/leads

List leads for the authenticated organization

Auth: Session

Query Parameters

ParameterTypeDescription
stagestringFilter by pipeline stage (e.g., INBOUND, HIGH_INTENT)
searchstringSearch across name, email, company
limitnumberMax results (default: 50)

Create Lead

POST
/api/leads

Create a new lead

Auth: Session

Request Body

ParameterTypeDescription
namestringLead full name(required)
emailstringLead email (must be unique)(required)
phonestringPhone number
titlestringJob title
companystringCompany name
locationstringLocation
linkedinstringLinkedIn URL
sourcestringSource label (default: WEB_FORM)
Response (201)
{ "id": "clx...", "name": "Jane Doe", "email": "jane@acme.com", "pipelineStage": "INBOUND", ... }

Update Lead

PUT
/api/leads/[id]

Update any lead fields

Auth: Session

Send any subset of lead fields. Empty strings are ignored; use null to clear a field.

Close Lead

POST
/api/leads/[id]/close

Close as won or lost

Auth: Session

Request
{ "outcome": "won", "earnings": 5000 }
Response
{ "status": "CLOSED_WON", "leadId": "clx...", "earnings": 5000 }

Email Sequences

POST
/api/leads/[id]/sequence

Create an email sequence

Auth: Session

Request Body

ParameterTypeDescription
templateStylestringStyle: professional, minimal, bold, elegant, friendly
intervalValuenumberDays between emails (default: 2)
intervalUnitstringUnit: days, weeks, hours
emailAccountIdstringEmail account to send from
useAIbooleanGenerate emails with AI (default: true)
customEmailsarrayManual emails: [{subject, body}]

Use the action field in PUT to: activate, send, cancel, or regenerate the sequence.