curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS",
"body": "Hi Jordan, just following up on your application."
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "EMAIL",
"subject": "Your application",
"body": "Hi Jordan,\n\nJust following up on your application."
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS"
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "WHATSAPP",
"templateId": "HXb5b62575e6e4ff6129ad7c8efe1f983e"
}'
const options = {
method: "POST",
headers: {
"x-api-key": "<your-api-key>",
"Content-Type": "application/json",
},
body: JSON.stringify({
agentId: "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
channel: "SMS",
body: "Hi Jordan, just following up on your application.",
}),
};
fetch(
"https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages",
options,
)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
import requests
url = "https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages"
headers = {
"x-api-key": "<your-api-key>",
"Content-Type": "application/json",
}
payload = {
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS",
"body": "Hi Jordan, just following up on your application.",
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.json())
{
"success": true,
"message": {
"id": "7c2e9f41-5b8d-4a3e-b6f0-2d1c8e7a9b54",
"channel": "SMS",
"lifecycle": "SENT",
"body": "Hi Jordan, just following up on your application.",
"subject": null
}
}
{
"success": false,
"error": "channel is required"
}
Messages
Send Message
Send an SMS, email, or WhatsApp message to a lead from one of your agents
POST
/
api
/
v1
/
leads
/
{leadId}
/
messages
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS",
"body": "Hi Jordan, just following up on your application."
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "EMAIL",
"subject": "Your application",
"body": "Hi Jordan,\n\nJust following up on your application."
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS"
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "WHATSAPP",
"templateId": "HXb5b62575e6e4ff6129ad7c8efe1f983e"
}'
const options = {
method: "POST",
headers: {
"x-api-key": "<your-api-key>",
"Content-Type": "application/json",
},
body: JSON.stringify({
agentId: "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
channel: "SMS",
body: "Hi Jordan, just following up on your application.",
}),
};
fetch(
"https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages",
options,
)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
import requests
url = "https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages"
headers = {
"x-api-key": "<your-api-key>",
"Content-Type": "application/json",
}
payload = {
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS",
"body": "Hi Jordan, just following up on your application.",
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.json())
{
"success": true,
"message": {
"id": "7c2e9f41-5b8d-4a3e-b6f0-2d1c8e7a9b54",
"channel": "SMS",
"lifecycle": "SENT",
"body": "Hi Jordan, just following up on your application.",
"subject": null
}
}
{
"success": false,
"error": "channel is required"
}
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 thex-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 WHATSAPPstring
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
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS",
"body": "Hi Jordan, just following up on your application."
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "EMAIL",
"subject": "Your application",
"body": "Hi Jordan,\n\nJust following up on your application."
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS"
}'
curl --request POST \
--url https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages \
--header 'x-api-key: <your-api-key>' \
--header 'Content-Type: application/json' \
--data '{
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "WHATSAPP",
"templateId": "HXb5b62575e6e4ff6129ad7c8efe1f983e"
}'
const options = {
method: "POST",
headers: {
"x-api-key": "<your-api-key>",
"Content-Type": "application/json",
},
body: JSON.stringify({
agentId: "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
channel: "SMS",
body: "Hi Jordan, just following up on your application.",
}),
};
fetch(
"https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages",
options,
)
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
import requests
url = "https://api-v2.getomni.ai/api/v1/leads/a9d0a790-201b-47e9-84ed-cc7eed1270c5/messages"
headers = {
"x-api-key": "<your-api-key>",
"Content-Type": "application/json",
}
payload = {
"agentId": "3f1c2b7e-8d4a-4c6f-9e2b-1a5d7c9e0f12",
"channel": "SMS",
"body": "Hi Jordan, just following up on your application.",
}
response = requests.request("POST", url, json=payload, headers=headers)
print(response.json())
{
"success": true,
"message": {
"id": "7c2e9f41-5b8d-4a3e-b6f0-2d1c8e7a9b54",
"channel": "SMS",
"lifecycle": "SENT",
"body": "Hi Jordan, just following up on your application.",
"subject": null
}
}
{
"success": false,
"error": "channel is required"
}
