Client: leads
Recording a lead against a project.
const { leadId } = await oprag.leads.create({
projectId: "proj_abc123",
visitorId,
name: "Ada Lovelace",
email: "ada@example.com",
conversationId,
sourceQuestion: "Do you offer volume pricing?",
}); | Field | Required | Description |
|---|---|---|
projectId | Yes | Project the lead belongs to. |
visitorId | Yes | The same visitor id sent with the chat turn. |
name / email | No | Whatever the form collected. |
conversationId | No | Ties the lead to its conversation in the dashboard. |
sourceQuestion | No | The question that triggered the capture. |
When a chat.ask returns the lead_capture_prompt branch, render promptMessage and fields, then submit what you collect here. Underneath: POST /v1/projects/{projectId}/leads.
Ready to ship?
Get started free