How AI agents add reactions and receive client reaction events
To have an AI agent add or remove a reaction, send a request to /api/connect/react with the message ID and emoji. To notify your n8n workflow about client reactions, turn on Notify the AI about client reactions in the AI gateway settings.
How to add or remove a reaction
Send POST /api/connect/react with the header Authorization: Bearer <token>. The token is the value of the Callback token field on the Connect your AI page. This is the same token used to reply to clients.
Include message_id and emoji in the request body. You can react to a client message or a message sent by the agent.
To remove a reaction, pass an empty string: "emoji": "".
POST https://app.anylinga.com/api/connect/react
Authorization: Bearer <Callback token>
Content-Type: application/json
{
"message_id": "6a1f3c2e-9b7d-4e5a-8c21-0d4b7e9f2a13",
"emoji": "👍"
}
Where to find message_id
message_id is the message ID in AnyLinga. To react to a client message, use the message_id field from the incoming message received by the workflow.
To react to the agent's text, use the message_id field from AnyLinga's response to the callback or /api/connect/send. If only templates were sent, without text, the response does not include a message_id field.
Which channels support reactions
An AI agent can add reactions in WhatsApp connected via QR code, WhatsApp Business API, and Telegram bots.
In other channels—personal Telegram, Instagram, Facebook, TikTok, MAX, LinkedIn, and web chat—AnyLinga returns 422 reactions_not_supported. In personal Telegram, Telegram business bots do not have permission to add reactions.
The manager sees the agent's reaction on the same message in the Kommo chat, just like an employee's reaction. If the reaction is successfully mirrored, the response is {"ok": true, "crm_mirrored": true}.
If the reaction could not be mirrored in Kommo, the response includes "crm_mirrored": false. The reaction was still sent to the client.
What the API responses mean
Check the response code and the crm_mirrored value to distinguish between sending the reaction to the client and displaying it in Kommo.
| Response | Meaning |
|---|---|
200 | The reaction was sent to the client; crm_mirrored indicates whether it appeared in Kommo. |
400 | message_id does not look like a message ID, or emoji contains more than one emoji. |
401 | Invalid Callback token. |
404 message_not_found | The message does not exist or belongs to another account. |
422 reactions_not_supported | AnyLinga does not support adding reactions in this channel. |
422 no_messenger_id | The message has no ID in the messenger, so there is no message to react to. |
502 send_failed | The messenger rejected the reaction, for example, if emoji does not contain an emoji. |
How to enable client reaction notifications
Before enabling notifications, make sure the workflow checks the event field: regular client messages do not have this field.
1. Open the AI gateway settings
- Go to Tools & Settings → AI gateway and open the Connect your AI page.
2. Enable reaction notifications
- Under the Enable gateway toggle, find Notify the AI about client reactions and turn it on.
- The setting is saved as soon as you click it. You do not need to click Save.
How to handle a client_reaction event
When a client adds or removes a reaction, a client_reaction event is sent to the same n8n webhook URL with the same X-AnyLinga-Signature signature. You do not need to reply through the callback; the webhook must return 2xx. Deal filters do not apply to this event.
Use the event field to distinguish the event from a client message. Use message_id to identify which message the client reacted to.
| Field | Contents |
|---|---|
event | client_reaction. |
conversation_id | The conversation. |
channel | The channel. |
contact_id | The contact in Kommo or null. |
message_id | The message the client reacted to: the same ID as in the incoming message or callback response. |
message_direction | inbound for a reaction to a client message, outbound for a reaction to a business message. |
emoji | The reaction emoji. |
action | react if the client added a reaction, unreact if they removed it. |
ts | The time. |
unreact is sent with the emoji the client removed. A reaction to an old message that is not in AnyLinga does not produce an event.Related questions
Which fields the workflow receives, how an AI agent and a manager work in the same chat, 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.