API Reference
Complete reference for all LeadFlowX API endpoints.
Authentication
Most endpoints require session authentication (cookie-based). Webhook endpoints use token-based auth via the URL path.
Base URL
https://leadflowx-neon.vercel.app/api
Endpoints by Category
Leads
/api/leadsList leads with optional stage/search filters
Auth: Session
/api/leadsCreate a new lead
Auth: Session
/api/leads/[id]Get lead details with events and agent actions
Auth: Session
/api/leads/[id]Update lead fields
Auth: Session
/api/leads/[id]Delete a lead
Auth: Session
/api/leads/[id]/closeClose lead as won or lost
Auth: Session
/api/leads/[id]/repliesGet email replies for a lead
Auth: Session
/api/leads/[id]/sequenceGet email sequence for a lead
Auth: Session
/api/leads/[id]/sequenceCreate email sequence
Auth: Session
/api/leads/[id]/sequenceUpdate/activate/send/cancel sequence
Auth: Session
Webhooks
/api/webhook/[token]Ingest a lead via per-user webhook
Auth: Token (URL)
/api/webhooks/leadIngest a lead (general webhook)
Auth: None
/api/email-accountsList email accounts
Auth: Session
/api/email-accountsAdd email account
Auth: Session
/api/email-accountsUpdate email account
Auth: Session
/api/email-accountsDelete email account
Auth: Session
/api/email-accounts/testVerify SMTP connection
Auth: None
/api/email-accounts/send-testSend a test email
Auth: None
/api/email-accounts/imap-detectAuto-detect IMAP settings
Auth: None
AI Agents
/api/agents/configList agent configurations
Auth: Session
/api/agents/configUpdate agent config (enable/disable)
Auth: Session
/api/agents/runRun an agent (batch mode)
Auth: Session
/api/agents/enrichEnrich a single lead
Auth: Session
/api/agents/scoreScore a single lead
Auth: Session
/api/agents/draftDraft outreach for a lead
Auth: Session
/api/agents/pipelineList leads ready for processing
Auth: Session
/api/agents/pipelineRun full pipeline for a lead
Auth: Session
Queue & Settings
/api/queueGet queue status
Auth: Session
/api/queueQueue actions (process, retry, toggle)
Auth: Session
/api/settingsGet all settings
Auth: Session
/api/settingsUpdate settings
Auth: Session
/api/sourcesList available lead sources
Auth: Session
/api/duplicatesList duplicate leads
Auth: Session
/api/notificationsList notifications
Auth: Session
See the individual API pages for detailed request/response schemas for each endpoint.