Leads

Save a lead and queue its notification email

POST /api/v1/agents/{agentId}/leads

Save a lead and queue its notification email

Requires leads:write and company access to the agent. Supports CONTACT, CALLBACK, OFFER, WHATSAPP and MAKE_APPOINTMENT using the existing lead submission schemas. CONVERSATION leads are derived from conversation-sharing activity, not created by this endpoint. The conversation must already exist for this agent. Appointment actionId must reference an enabled IFRAME action on this agent. Consent collection and wording belong to the calling application. Reuse submissionKey on retries to deduplicate the saved lead and email job. Success confirms persistence and email queue acknowledgement, not final email delivery. Non-contact notifications go to the company owner/superuser; contacts prefer the configured contact-form recipient.

Parameters

Name In Type Description
agentId * path integer

Request body

object

Field Type Description
chatIdentifier * string
submissionKey * string
fullName string
emailAddress string
phoneNumber string
companyName string
actionId integer
actionType * string
details * object

Responses

Status Schema Description
200 object

Lead saved and notification queued

400

Invalid input, unknown conversation, or conflicting submission key

401

Missing or invalid authentication

403

Missing leads:write scope

404

Agent not found or inaccessible

500

Persistence or email queue failure; retry with the same submissionKey

Example 200 response
{
    "ok": true,
    "id": 1
}