All webhooks
AI agents
AI suggestion created
ai.suggestion.createdFires when the AI copilot generates a reply suggestion for a conversation. A suggestion is a draft text the operator can accept (sent as an outbound message, optionally edited) or reject via the `/v1/conversations/{conversation}/ai-suggestions/{suggestion}/accept` and `/reject` endpoints.
HTTP request
AISAR sends a signed POST request to your webhook_url:
http
POST {webhook_url}
Content-Type: application/json
X-AISAR-Signature: sha256=...
{
"event": "ai.suggestion.created",
"event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2026-03-26T12:00:00.000000Z",
"company_id": 1,
"data": {
"suggestion": {
"id": 5821,
"instance_id": 12,
"conversation_id": 3344,
"message_id": 99812,
"suggested_text": "Здравствуйте! Доставка по городу занимает 1-2 дня.",
"status": "pending",
"accepted_by": null,
"final_text": null,
"tokens_used": 184,
"created_at": "2026-03-26T12:00:00.000000Z",
"updated_at": "2026-03-26T12:00:00.000000Z"
}
}
}The X-AISAR-Signature header carries an HMAC-SHA256 signature of the request body — use it to verify the request came from AISAR.
Example payload
json
{
"event": "ai.suggestion.created",
"event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
"timestamp": "2026-03-26T12:00:00.000000Z",
"company_id": 1,
"data": {
"suggestion": {
"id": 5821,
"instance_id": 12,
"conversation_id": 3344,
"message_id": 99812,
"suggested_text": "Здравствуйте! Доставка по городу занимает 1-2 дня.",
"status": "pending",
"accepted_by": null,
"final_text": null,
"tokens_used": 184,
"created_at": "2026-03-26T12:00:00.000000Z",
"updated_at": "2026-03-26T12:00:00.000000Z"
}
}
}Payload fields
| Field | Type | Description |
|---|---|---|
suggestion.id | integer | Suggestion ID |
suggestion.instance_id | integer | AI agent instance that produced the suggestion |
suggestion.conversation_id | integer | Target conversation |
suggestion.message_id | integer|null | Inbound message that triggered the suggestion |
suggestion.suggested_text | string | Draft reply text |
suggestion.status | string | `pending`, `accepted`, `rejected`, `expired` |
suggestion.accepted_by | integer|null | User ID that accepted (set on acceptance) |
suggestion.final_text | string|null | Text actually sent (may differ from `suggested_text` if edited) |
suggestion.tokens_used | integer | LLM tokens consumed |