Skip to main content
POST
Send a message to a lead on behalf of an agent, just as you would from the app. Provide the message content or omit body to have the agent generate it based on the lead’s context and outstanding requests. Messages are sent immediately and appear on the lead’s timeline. They bypass approval requirements and working-hour restrictions, but respect channel opt-outs.

Authentication

Requires the x-api-key header with a valid workspace API key.

Path Parameters

string
required
The unique identifier of the lead

Request Body

string
required
The agent sending the message. The message is sent from this agent’s email address or phone number.
enum
required
SMS, EMAIL, or WHATSAPP
string
The message text. For SMS and EMAIL, leave it out to have the agent write the message based on what it still needs from the lead. This requires the agent to be collecting a checklist from the lead. For WHATSAPP, send either body or templateId.
string
EMAIL only. Required when you send body for a new thread. When the agent writes the message, it writes the subject too unless you send one. Not accepted with inReplyToMessageId or replyToLatestThread, since a reply keeps its thread’s subject.
string
EMAIL only. The ID of an email in this lead’s conversation with the agent, sent or received. The message is sent as a reply on that email’s thread.
boolean
EMAIL only. Set to true to reply on the most recent email thread between the agent and the lead, without needing a message ID. Returns a 404 if there is no email thread yet. Can’t be combined with inReplyToMessageId. Without either field, the email starts a new thread.
string
WHATSAPP only. The Twilio content template SID (HX...) of an approved template. Its variables are filled in from the lead and agent.
object
WHATSAPP only, with templateId. Values for template variables that can’t be filled in from the lead or agent, keyed by variable name (e.g. { "LEAD_NAME": "Jordan" } for a lead with no first name). The variables are AGENT_NAME, COMPANY_NAME, LEAD_NAME, and PORTAL_LINK.

Response

boolean
Whether the message was sent
object