Skip to content
AISARAISAR
Snippets

Snippets

Snippet created

snippet.created

Fires when a new quick reply appears in the library. The payload carries the template text and the attachment list. The quick reply library is shared by the whole company, so the integration channel filter (`channelFilter`) does not apply to these events.

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": "snippet.created",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-12T09:30:00.000000Z",
  "company_id": 1,
  "data": {
    "snippet": {
      "id": 7,
      "name": "Прайс",
      "message": "Наш прайс во вложении",
      "files": [
        { "id": 15, "name": "price.pdf", "size": 12288, "type": "application/pdf" }
      ],
      "created_at": "2026-11-12T09:30:00.000000Z",
      "updated_at": "2026-11-12T09:30: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": "snippet.created",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-12T09:30:00.000000Z",
  "company_id": 1,
  "data": {
    "snippet": {
      "id": 7,
      "name": "Прайс",
      "message": "Наш прайс во вложении",
      "files": [
        { "id": 15, "name": "price.pdf", "size": 12288, "type": "application/pdf" }
      ],
      "created_at": "2026-11-12T09:30:00.000000Z",
      "updated_at": "2026-11-12T09:30:00.000000Z"
    }
  }
}

Payload fields

FieldTypeDescription
snippet.idintegerSnippet ID
snippet.namestringThe name an operator finds the reply by
snippet.messagestringThe full template text. It is a template written by an employee, not correspondence with a customer
snippet.filesarrayAttachments `[{id, name, size, type}]`: `size` in bytes, `type` is the MIME type. The event has no download link; read the file via `GET /v1/snippets/{snippet}/files/{snippetFile}/download` with the API token
snippet.created_atstringCreation time (ISO 8601)
snippet.updated_atstringLast change time (ISO 8601)