How an AI agent can message a customer first or follow up
To message a customer without a new incoming message, send POST /api/connect/send from your workflow with the saved conversation_id and message text. AnyLinga will deliver the message to the customer on behalf of your AI.
How sending without an incoming message works
Your workflow must first save the conversation_id from an incoming request. Use this ID to send a reminder to an existing conversation in your account.
Delivery works the same way as a regular reply: reply_text is translated into the customer's language, and the message appears in the Kommo chat.
How to send a message from your workflow
1. Save the conversation ID
- Get
conversation_idfrom the incoming request and save it in your workflow.
2. Set up the HTTP request
- Use
POST /api/connect/sendon the same server specified in Callback URL. Replace the path/api/connect/callbackwith/api/connect/send. - Pass the same
Authorization: Bearer <Callback token>header.
3. Provide the request body and send it
- Include
conversation_idandreply_textand/ortemplate_ids. - For a text reminder, use the example below. If you are sending templates, include up to 5 templates in
template_ids.
{
"conversation_id": "3f6c2a1e-8b4d-4c7a-9e21-5d0b7a9c4f12",
"reply_text": "Hi, you asked about delivery. Are you still interested?"
}
When you can send a WhatsApp message
In WhatsApp and the WhatsApp Business API, you can only send a message within 24 hours of the customer's last message.
After that, the request returns 409 with the body {"error": "outside_window"}. This restriction also applies to templates. Other channels do not have this check.
Response codes
| Code | Meaning |
|---|---|
200 | Sent. |
400 | Missing conversation_id, or neither reply_text nor template_ids is provided. |
401 | Invalid token. |
404 | Conversation or template not found. |
409 outside_window | More than 24 hours have passed since the customer's last WhatsApp message. |
500 / 502 | Delivery failed. |
Related questions
how to send a template, photo, or video · which fields your workflow receives · how to connect an AI agent through n8n
Get in touch
We reply during business hours.
New to AnyLinga?
Try it yourself, or we'll set it up for you when you pay for the first month.