AISARAISAR
All webhooks

AI agents

AI suggestion created

ai.suggestion.created

Fires 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

FieldTypeDescription
suggestion.idintegerSuggestion ID
suggestion.instance_idintegerAI agent instance that produced the suggestion
suggestion.conversation_idintegerTarget conversation
suggestion.message_idinteger|nullInbound message that triggered the suggestion
suggestion.suggested_textstringDraft reply text
suggestion.statusstring`pending`, `accepted`, `rejected`, `expired`
suggestion.accepted_byinteger|nullUser ID that accepted (set on acceptance)
suggestion.final_textstring|nullText actually sent (may differ from `suggested_text` if edited)
suggestion.tokens_usedintegerLLM tokens consumed