Sending events to your own systems with webhooks
Updated Oct 30, 2026
A webhook sends a signed JSON request to a URL you choose each time something
happens in Aigento, such as a new ticket or a customer reply. Use it to update
your own order system, CRM or data warehouse.
Add a webhook
- Go to Settings → Webhooks. Only owners and admins can see it.
- Click Add webhook, give it a name, enter an
https://URL and choose
the events it receives. - Copy the signing secret. It is shown once. Roll secret in the ⋯
menu gives you a new one, and the old one stops working at once. - Click Send test. Aigento posts a
pingevent, and the result shows
under the webhook.
A workspace can have up to 10 webhooks. The URL must be a public HTTPS
address; private and local network addresses are refused.
Events
| Event | When it is sent |
|---|---|
ticket.created | A ticket is opened |
ticket.updated | A ticket's status, priority, tags, subject, assignee or category changes |
ticket.status_changed | A ticket's status changes |
ticket.assigned | A ticket is assigned or unassigned |
ticket.resolved | A ticket is resolved |
ticket.closed | A ticket is closed |
ticket.escalated | The AI agent hands a ticket to your team |
message.created | A customer, teammate or AI reply is added |
message.updated | A teammate edits a live-chat reply they sent |
customer.created | A customer record is created |
customer.updated | A customer record changes |
Internal notes and system messages are never sent. A reply is sent once the
customer has it: a draft waiting for approval, a reply still in its undo
window, a rejected or cancelled reply, and a reply written while the
workspace is in sandbox mode are never sent. Opening or marking a ticket read
is not an update.
The request
Each event is a POST with a JSON body:
{
"id": "01a1757a-0b7e-7c1d-9f2e-3a4b5c6d7e8f",
"type": "message.created",
"version": 1,
"createdAt": "2026-10-26T09:15:00.000Z",
"workspaceId": "01a17000-0000-7000-8000-000000000001",
"data": {
"message": {
"id": "01a1757a-0b7e-7c1d-9f2e-000000000002",
"ticketId": "01a1757a-0b7e-7c1d-9f2e-000000000003",
"ticketNumber": 42,
"direction": "inbound",
"authorType": "customer",
"text": "Where is my order?",
"createdAt": "2026-10-26T09:15:00.000Z"
}
}
}Ticket events carry data.ticket (id, number, subject, status, priority,
channel, tags, assignee and customer) as it is when the request is sent.ticket.updated adds data.changed, the fields that changed.ticket.status_changed, ticket.resolved and ticket.closed adddata.status and data.previousStatus, which describe the change itself, so
a retry after the ticket was reopened still says resolved.ticket.assigned adds data.previousAssigneeId.
Message events carry data.message with its current text; an edited message
adds editedAt. Customer events carry data.customer (id, email, name). The id is the same
on every retry of one event, so use it to ignore duplicates. Amessage.created event is sent at most once per message.
The headers are:
Aigento-Event— the event typeAigento-Delivery— this delivery's idAigento-Timestamp— Unix seconds when the request was signedAigento-Signature—v1=and the hex HMAC-SHA256 of<timestamp>.<body>, keyed with your signing secret
Verify the signature
Check the signature against the raw request body before you trust it, and
refuse old timestamps so a captured request cannot be replayed.
import crypto from 'node:crypto';
export function verifyAigentoWebhook(rawBody, headers, secret) {
const timestamp = headers['aigento-timestamp'];
const signature = headers['aigento-signature'] ?? '';
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const expected =
'v1=' +
crypto
.createHmac('sha256', secret)
.update(`${timestamp}.${rawBody}`)
.digest('hex');
const a = Buffer.from(signature);
const b = Buffer.from(expected);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}Retries and turning off
- Answer with any
2xxstatus within 10 seconds. Redirects are not followed. - A network error, a timeout, a
5xxor a429is retried up to six times
over about an hour. Any other4xxis not retried. - After three such failures in a row, Aigento waits a few minutes before it
sends to that URL again. Those attempts count as retries. - After 20 failed deliveries in a row Aigento turns the webhook off and emails
the workspace owner. Fix the endpoint, then switch it back on. - Recent deliveries under each webhook lists the last 50 with their status,
response code, time taken and attempts. Redeliver sends a finished one
again.
Deliveries are kept for 30 days.