Skip to content
AISARAISAR
Snippets

Snippets

Snippet updated

snippet.updated

Fires when the name, text or attachments of a quick reply change. The payload carries the new state, and `changes` lists what changed. A save that changed nothing (the same name and text, removing a file that does not exist) sends no event. 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.updated",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-13T11:00: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-13T11:00:00.000000Z"
    },
    "changes": ["message"]
  }
}

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.updated",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-13T11:00: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-13T11:00:00.000000Z"
    },
    "changes": ["message"]
  }
}

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)
changesarrayWhat changed, names only. A closed set: `name`, `message`, `files` (`files` means an attachment was added or removed). The event goes out only with a non-empty list