API: AI Agents
Configure and run AI agents for lead processing.
Agent Configuration
GET
/api/agents/configList all agent configurations
Auth: Session
PUT
/api/agents/configEnable/disable an agent
Auth: Session
| Parameter | Type | Description |
|---|---|---|
| agentType | string | WEB_SCRAPER, INTENT_SCORER, or OUTREACH_DRAFTER(required) |
| enabled | boolean | Enable or disable the agent |
| autoRun | boolean | Auto-run when new leads arrive |
Run Agent (Batch)
POST
/api/agents/runRun an agent on up to 5 leads
Auth: Session
Request
{ "agentType": "WEB_SCRAPER" }Response
{ "agent": "WEB_SCRAPER", "processed": 3, "results": [{ "leadId": "clx...", "name": "Jane", "status": "enriched" }] }Single Lead Operations
POST
/api/agents/enrichEnrich a single lead
Auth: Session
POST
/api/agents/scoreScore a single lead
Auth: Session
POST
/api/agents/draftDraft outreach for a single lead
Auth: Session
All three accept either leadId or individual fields (name, company, etc.).
Full Pipeline
POST
/api/agents/pipelineRun enrich → score → draft for a lead
Auth: Session
Request
{ "leadId": "clx...", "step": "enrich" }Omit step to run all three steps. Valid steps: enrich, score, draft.