Webhooks¶
When something your application cares about happens inside AIR — a
duty-of-care alert, a reply waiting for someone whose phone is asleep, a
moderated peer message, a finished quiz — AIR sends a signed HTTP POST to the
webhook address registered on your team's SDK door.
One principle shapes every event: webhooks are delivery; the API is the source of truth. An event tells you that something exists or happened. It carries ids, counts and lines AIR has written — never a participant's own words. Fetch content through the authenticated partner API.
Transport¶
| Method and body | POST, application/json; charset=utf-8 |
| Timeout | 10 seconds |
| Success | any 2xx |
| Retries | 3 attempts: immediately, after about 30 seconds, after about 5 minutes |
| Permanent failure | any 4xx other than 408 or 429 — AIR stops retrying and the event is gone |
So the status you answer is a decision, not a courtesy:
- Answer
401to a bad signature. - Answer
5xxif your handler fails, so AIR retries. Catching your own error and answering200turns a passing failure into a lost event. - Answer
200once the event is safely stored, and do slow work (push notifications, email) afterwards.
Headers¶
| Header | Purpose |
|---|---|
X-AIR-Event |
The event kind, so you can route without parsing |
X-AIR-Event-Id |
The event's id. The same across retries — dedupe on it |
X-AIR-Signature |
sha256=<lowercase hex> — see below |
X-AIR-Delivery-Attempt |
1 for the first attempt, then 2, 3 |
User-Agent |
AIR/1.0 (webhook) |
The envelope¶
Every event shares one envelope, so you can switch on event without
reparsing:
{
"event": "overseer.alert",
"event_id": "01H8…",
"occurred_at": "2026-10-16T10:14:02.118Z",
"delivery_attempt": 1,
"tenant_id": "943d…",
"team_id": "632d…",
"data": { }
}
| Field | Type | Notes |
|---|---|---|
event |
string | The event kind — see the events |
event_id |
uuid | Stable across retries of one event. Your idempotency key |
occurred_at |
ISO 8601 | When it happened, not when this attempt was sent |
delivery_attempt |
int | 1-based |
tenant_id |
uuid | The organisation that owns the team |
team_id |
uuid | The team the event belongs to |
data |
object | Event-specific — see below |
Optional fields may be added to data without notice; handle fields you don't
recognise by ignoring them. A breaking change to an event's shape would arrive
as a new event name.
Verifying the signature¶
The signature is HMAC-SHA256 over the raw request body, keyed with your
door's signing secret, sent as X-AIR-Signature: sha256=<hex>. Verify it
before you parse the JSON — re-serialising the body changes the bytes.
import crypto from "node:crypto";
function verify(rawBody, signingSecret, headerValue) {
const [scheme, hex] = (headerValue ?? "").split("=");
if (scheme !== "sha256" || !hex) return false;
const expected = crypto
.createHmac("sha256", signingSecret)
.update(rawBody)
.digest("hex");
return (
expected.length === hex.length &&
crypto.timingSafeEqual(Buffer.from(expected, "hex"), Buffer.from(hex, "hex"))
);
}
import hashlib, hmac
def verify(raw_body: bytes, signing_secret: str, header_value: str) -> bool:
scheme, _, received = (header_value or "").partition("=")
if scheme != "sha256" or not received:
return False
expected = hmac.new(signing_secret.encode(), raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, received)
The SDKs do this for you:
- JavaScript:
@glowar-ltd/sdk-js—handleWebhook, or the mountablecreateWebhookRoute/createWebhookMiddleware. - Python:
air-sdk—handle_webhook.
Signing is version 1
Today the signature covers the body only; there is no timestamp header.
A second version that also signs a timestamp has been proposed but is not
sent. Deduplicating on event_id protects you against a replayed
delivery in the meantime.
You only receive what the door subscribes to¶
Apart from overseer.alert, which always delivers, every event kind is
opt-in per door. The door names the kinds it should receive, and AIR sends
those and nothing else.
This is set on the AIR side, on the team's door, by whoever administers it — so if you are integrating, tell them which kinds your handler covers. AIR refuses to save a webhook address and secret with nothing subscribed, and a door left in that state from earlier reports itself and raises an alert inside AIR. But from your side a door subscribed to nothing looks exactly like a quiet day: no request arrives, so there is no failure to see.
If you have built your handler, verified your secret and received nothing, that is the first thing to check — see a door is live but receiving nothing. You can also read the door's subscriptions yourself: reading your door.
The events¶
These are every kind AIR delivers to a partner today.
| Event | Needs | When |
|---|---|---|
overseer.alert |
— (always delivered) | A conversation tripped a duty-of-care rule about someone an overseer looks after |
air.message.ready |
— | A message was announced to its recipient: a colleague's reply, a peer message or a peer picture |
air.job.started |
— | A piece of work began |
air.job.image.generating |
— | A picture is being made |
air.job.completed |
— | The work finished |
air.job.failed |
— | The work failed |
peer.message.assessed |
Care | Every peer message, with its moderator's verdict |
peer.media.assessed |
Care | Every peer picture, with its verdict |
alert.peer.message_held |
Care | A held peer message was sent anyway by its sender |
alert.peer.media_held |
Care | A peer picture was held |
alert.peer.pattern |
Care | A worrying pattern between two participants |
alert.peer.participant_pattern |
Care | A worrying pattern around one participant, across everyone they hear from |
digest.peer.wellbeing |
Care | A daily, word-free summary for a participant who had peer activity |
relationship.revoked |
Care | A peer relationship was withdrawn |
quiz.assignment.completed |
Assessment | A quiz you launched was finished |
"Needs" names the practice the team must have applied for the event to exist at all.
Two more requests may arrive that you do not subscribe to:
air.webhook.test— sent once, to a new address, when you register it. Answer200and do nothing else.policy.changed— sent when someone in AIR changes a team-level setting you cannot change yourself, such as how long peer messages are kept. Update any cached copy of the team's policy.
Not sent to partners
Older versions of these pages and of the SDKs mention
conversation.opened, conversation.ended, file.scanned and
alert.media.blocked. None of them is delivered to a partner. To follow an
upload's progress, use the partner API's file progress route.
overseer.alert¶
AIR's duty-of-care guarantee, and the one event no door can opt out of. A participant's conversation tripped one or more rules that an overseer must hear about; Airica, the organisation's AI Resource Manager, has written the alert, and AIR delivers it to each overseer's channel — for an SDK door, this webhook.
{
"event": "overseer.alert",
"data": {
"alert_id": "01H8…",
"severity": "urgent",
"participant": { "address_book_id": "a2a0…", "display_name": "Logan" },
"overseer": { "address_book_id": "1731…", "display_name": "Sam" },
"bot": { "id": "98af…", "display_name": "Wren" },
"tripped_rules": [
{ "rule_id": "ff63…", "category": "safety", "rule_text": "…", "source": "platform" }
],
"message": "When Logan was talking to Wren this afternoon, he mentioned feeling unsafe. The chat is open if you'd like to step in.",
"conversation_id": "cdf9…",
"message_id": "01H8…"
}
}
| Field | Type | Notes |
|---|---|---|
alert_id |
uuid | The alert. One alert may produce several delivery attempts, all with the same event_id |
severity |
enum | urgent | informational |
participant |
object | Who was talking, by their address-book name |
overseer |
object | Who is being told |
bot |
object | The colleague, by the name your users know it by |
tripped_rules |
array | The rules that fired; source is platform, org, bot or participant |
message |
string | The alert as written for the overseer — relay it as is if you don't write your own |
conversation_id |
uuid | The conversation |
message_id |
uuid | The message that tripped it |
An alert that cannot reach its overseer is the failure AIR designs hardest
against. If your receiver answers 401 — usually a stale secret — AIR stops
retrying and raises it inside AIR. See
alerts are not reaching an overseer.
air.message.ready¶
The doorbell. A backgrounded phone has no open connection, so a reply that lands while someone is away is one they never learn about. This event says a message exists; you turn it into a push notification, and the app fetches the content through the route it already uses.
data: conversation_id, participant_id (the recipient, never the
sender) and kind — colleague, peer or peer_media. Never a body, a
preview, a sender's name or an unread count.
- It rings with the announcement, not the storage. A message that arrives inside the recipient's quiet hours is stored at once but announced when the window opens, and this event fires then. When a backlog is released, you get one event for the conversation, not one per message.
- It is not gated on presence. Whether a socket looks open is never consulted.
- A held peer message rings nothing, in either direction.
quiz.assignment.completed¶
Fired when a quiz you launched has been answered. Scores and ids only — never a question or an answer. It is sent only for your own participants: an organisation giving a set to its own staff on the same team is never reported to you.
If any answer was waiting for a person to mark (needs_review above 0,
passed null), the event is sent again for the same assignment_id once
the last of them is marked, with the settled numbers. Treat the later one as
the result.
{
"event": "quiz.assignment.completed",
"data": {
"conversation_id": "cdf9…",
"assignment_id": "91c4…",
"session_id": "7e21…",
"set_id": "5b0e…",
"set_name": "Fire safety refresher",
"stakes": "rehearsal",
"subject_kind": "person",
"contact_id": "a2a0…",
"total": 10,
"correct": 8,
"needs_review": 0,
"score": 0.8,
"passed": null,
"late": false
}
}
| Field | Type | Notes |
|---|---|---|
conversation_id |
uuid | The thread the quiz ran in |
assignment_id |
uuid | Matches assignment_id from the launch response |
session_id |
uuid | The sitting itself |
set_id |
uuid | The set that was answered |
set_name |
string | The set's name |
stakes |
enum | compliance | rehearsal | play (rehearsal was called practice before October 2026) |
subject_kind |
string | person for a launch |
contact_id |
uuid | Your handle for the participant you launched it for |
total |
int | Questions in the sitting |
correct |
int | How many were right |
needs_review |
int | Answers still waiting for a person to mark |
score |
number | 0–1 |
passed |
bool | null | null when the set has no pass mark, or while an answer is still waiting for a person |
late |
bool | Finished after its due date — it still counts as finished |
The Care events¶
These exist only on a team that has applied the Care practice. Each carries ids, levels, counts and lines AIR has composed — a peer message's own text is never stored by AIR and can never appear in a payload.
| Event | data |
|---|---|
peer.message.assessed |
relationship_id, participant_id (the sender), level (0–3), delivered, and when present overridden, kind, coaching, suggestion, rewrite |
peer.media.assessed |
the picture's verdict — whether it was delivered or held; never the picture |
alert.peer.message_held |
relationship_id, participant_id (the sender), level, account |
alert.peer.media_held |
relationship_id, participant_id (the sender), reason |
alert.peer.pattern |
relationship_id, participant_id, pattern (bullying | drift | override_surge), account, window_days |
alert.peer.participant_pattern |
participant_id, pattern, account, distinct_senders, window_days |
digest.peer.wellbeing |
participant_id, window_days, messages, delivered, held, overridden, trend (improving | steady | concerning), signal (calm | coached | guarded) |
relationship.revoked |
relationship_id, receipt_id, revoked_at, and when given reason |
Reading your door¶
GET /v1/partner/door
Authorization: Bearer <partner key>
Returns the configuration AIR holds for your door, so you can check at start-up that both sides still agree:
{
"team": { "id": "…", "name": "…" },
"status": "live",
"webhook": {
"url": "https://…/api/webhooks/air",
"signing_secret": "…",
"signing_secrets": ["…", "…"],
"rotating": true,
"subscribed_events": ["overseer.alert", "air.message.ready"]
},
"retention": { "peer_text_days": 30 },
"last_delivery": { "event": "air.message.ready", "status": "delivered", "http_status": 200, "at": "…" }
}
Check that webhook.url is yours and that subscribed_events covers what you
handle. last_delivery is AIR's view of your receiver: a 401 there means
your signature check is failing, which is what a rotation you have not picked
up looks like.
status is live, provisioning, maintenance (only ever a planned
window, with available_from saying when it ends) or suspended, with a
closure_reason of technical, commercial or withdrawn. If the door
read itself fails, treat the door as live and carry on.
Rotating the signing secret¶
A rotation overlaps at both ends, so nothing in flight is lost:
| AIR signs with | You should accept | |
|---|---|---|
| Rotation scheduled | old | old and new |
| About 24 hours later | new | new and old |
| About an hour after that | new | new |
Your rule is simply: accept any secret in signing_secrets. The secret is
never shown in AIR's own screens and never handed over by a person — you
collect it from the door read. When a signature fails, re-read the door before
giving up.
Registering your own webhook address¶
POST /v1/partner/door/webhook
{ "url": "https://…" }
The one write on the door, so a renamed host fixes itself on your next deploy. Two rules keep it safe:
- The address must sit beneath the door's webhook origin, which an administrator sets in AIR. A door with no webhook origin refuses registration.
- AIR sends a signed
air.webhook.testto the new address and needs a200back before switching. Until then the old address keeps working.
The webhook origin is not the same as the door's browser origin — the address your users' browsers load the chat from. They are kept apart on purpose: a webhook should never reach the app a child uses.
Related¶
- Partner API — fetching what an event points at.
- JavaScript SDK — a receiver you mount rather than write.
- A door is live but receiving nothing
- Alerts are not reaching an overseer