Standard Webhooks signatures
HMAC-SHA256 signatures in Standard Webhooks headers, checked by any Standard Webhooks library or the TypeScript and Python SDKs.
One feed records every change to mailboxes, calendars and contact books; pull it with a cursor, or receive each event as a signed webhook.
import { parseWebhook } from "@workwae/sdk";
export async function POST(request: Request) {
// Verify the raw body, before parsing it
const body = await request.text();
let event;
try {
event = await parseWebhook(secret, request.headers, body);
} catch {
return new Response("Invalid webhook", { status: 400 });
}
// Retries and replays reuse the id: deduplicate on it
const isNew = await markSeen(event.id);
if (isNew && event.known && event.type === "message.created") {
await queue.add(event.id, event.data.message.subject);
}
return new Response(null, { status: 204 });
}from collections.abc import Mapping
from workwae import UnknownEvent, WebhookVerificationError, parse_webhook
def receive(headers: Mapping[str, str], body: bytes) -> int:
# Verify the raw body, before parsing it
try:
event = parse_webhook(secret, headers, body)
except WebhookVerificationError:
return 400
# Retries and replays reuse the id: deduplicate on it
is_new = mark_seen(event.id)
if is_new and not isinstance(event, UnknownEvent) and event.type == "message.created":
queue.add(event.id, event.data.message.subject)
return 204
Webhooks and the feed carry the same events with the same ids: id, type, accountId, createdAt and data.
HMAC-SHA256 signatures in Standard Webhooks headers, checked by any Standard Webhooks library or the TypeScript and Python SDKs.
Each endpoint's whsec_ secret is shown once and sealed with keys held in Vault; after a rotation the old one keeps signing too for a grace period (24 hours by default, up to 7 days, or none).
Event types, accounts, and for messages mailbox or role, sender, recipient, subject, attachments and direction, up to 100 values per filter.
Failed deliveries are retried with doubling delays, up to an hour apart, for up to 3 days.
A 429, or a 503 with Retry-After, delays only that delivery.
Endpoints report failingSince and lastSuccessAt, and are disabled after 72 hours without a success.
The last 500 attempts per endpoint, for up to 7 days, with status, latency, error and the first kilobyte of your answer.
Queue one event whatever the filters, or up to 1,000 per call from a time range, with the same id and body and a fresh signature.
Signed test events of any type skip filters, and the console's tester URL records each delivery and checks its signature.
Filters run before anything is sent, so your endpoint never discards events it did not want.
message.* and send.* events; other events pass, and an event that cannot answer a criterion does not match it.@example.com matches the whole domain, and to covers to, cc and a bounce's failed recipients.outbound means mail in Sent or from the account's own addresses, and every send.*, message.bounced, message.opened and message.clicked event.message.deleted carries the message and its mailboxes as last indexed, so it matches like the message did.// New inbound mail to support@, from one account
const { endpoint, secret } = await workwae.webhooks.create({
url: "https://helpdesk.example.com/hooks/workwae",
description: "Support inbox",
filters: {
eventTypes: ["message.created"],
accountIds: [supportAccount.id],
message: {
mailboxRoles: ["inbox"],
direction: "inbound",
to: ["support@example.com", "@help.example.com"],
},
},
});
// Store the secret now: it is not shown again
await vault.put("workwae-webhook", secret);
// Try the receiver before real traffic exists
await workwae.webhooks.test({
endpointId: endpoint.id,
eventType: "message.created",
});
// Rotate: deliveries carry signatures by both secrets
// for graceSeconds (default 24 hours, at most 7 days);
// graceSeconds: 0 drops the old secret at once
const { secret: next } = await workwae.webhooks.rotateSecret({
endpointId: endpoint.id,
graceSeconds: 3600,
});# New inbound mail to support@, from one account
created = workwae.webhooks.create(
url="https://helpdesk.example.com/hooks/workwae",
description="Support inbox",
filters={
"event_types": ["message.created"],
"account_ids": [support_account.id],
"message": {
"mailbox_roles": ["inbox"],
"direction": "inbound",
"to": ["support@example.com", "@help.example.com"],
},
},
)
# Store the secret now: it is not shown again
vault.put("workwae-webhook", created.secret)
# Try the receiver before real traffic exists
workwae.webhooks.test(
endpoint_id=created.endpoint.id,
event_type="message.created",
)
# Rotate: deliveries carry signatures by both secrets
# for grace_seconds (default 24 hours, at most 7 days);
# grace_seconds=0 drops the old secret at once
rotated = workwae.webhooks.rotate_secret(
endpoint_id=created.endpoint.id,
grace_seconds=3600,
)
When your endpoint goes down, Workwae keeps the events until you fix the receiver and send what it missed.
failingSincefailing_since shows a streak long before the 72-hour limit.alreadyQueuedalready_queued.webhook-id stays safe to run.// Which endpoints are failing, or were disabled?
const { items } = await workwae.webhooks.list();
const unwell = items.filter((e) => !e.isEnabled || e.failingSince);
// What did the receiver answer?
const log = await workwae.webhooks.attempts({
endpointId,
result: "failed",
since: new Date("2026-11-02T00:00:00Z"),
});
for (const a of log.items) {
console.log(a.statusCode, a.error, a.responseExcerpt);
}
// Fixed: enable it again and deliver the missed day
await workwae.webhooks.update({ endpointId, isEnabled: true });
const { queued, alreadyQueued } = await workwae.webhooks.replay({
endpointId,
since: new Date("2026-11-02T00:00:00Z"),
until: new Date("2026-11-03T00:00:00Z"),
});
// Or just one event, whatever the filters
await workwae.webhooks.replayEvent({
endpointId,
eventId: "1001",
});from datetime import datetime, timezone
# Which endpoints are failing, or were disabled?
endpoints = workwae.webhooks.list()
unwell = [e for e in endpoints.items if not e.is_enabled or e.failing_since]
# What did the receiver answer?
log = workwae.webhooks.attempts(
endpoint_id=endpoint_id,
result="failed",
since=datetime(2026, 11, 2, tzinfo=timezone.utc),
)
for a in log.items:
print(a.status_code, a.error, a.response_excerpt)
# Fixed: enable it again and deliver the missed day
workwae.webhooks.update(endpoint_id=endpoint_id, is_enabled=True)
replay = workwae.webhooks.replay(
endpoint_id=endpoint_id,
since=datetime(2026, 11, 2, tzinfo=timezone.utc),
until=datetime(2026, 11, 3, tzinfo=timezone.utc),
)
print(replay.queued, replay.already_queued)
# Or just one event, whatever the filters
workwae.webhooks.replay_event(endpoint_id=endpoint_id, event_id="1001")
With no public endpoint, in a batch job, or when changes must apply in commit order, read the change feed with a saved cursor.
GET /v1/changes pages by transaction, so an event committed after a later one is never skipped.{ items, nextCursor }; the cursor is never null, and an empty page means caught up.changes helper moves past a page only once every event in it was consumed, so saving the cursor after processing gives at-least-once handling.types limits the feed to the events you handle; test events are never in it.known: falseUnknownEvent and its data unchecked, so it never breaks a receiver.import { changes } from "@workwae/sdk";
// Resume where you left off, with only the types you handle
const feed = changes(workwae.changes.list, {
cursor: await db.getCursor(),
types: [
"calendar_event.created",
"calendar_event.updated",
"calendar_event.deleted",
],
});
// Stops at an empty page: caught up
for await (const event of feed) {
await apply(event);
}
// Saved after processing: a crash mid-page replays that page
await db.saveCursor(feed.cursor);from workwae import changes
# Resume where you left off, with only the types you handle
feed = changes(
workwae.changes.list,
cursor=db.get_cursor(),
types=[
"calendar_event.created",
"calendar_event.updated",
"calendar_event.deleted",
],
)
# Stops at an empty page: caught up
for event in feed:
apply(event)
# Saved after processing: a crash mid-page replays that page
db.save_cursor(feed.cursor)
Each delivery is a JSON POST signed with HMAC-SHA256 over the id, timestamp and body, in the webhook-id, webhook-timestamp and webhook-signature headers; the SDKs' parseWebhookparse_webhook allows five minutes of clock tolerance. Answer any 2xx within 10 seconds and do the work in a queue of your own.
| Your endpoint | What Workwae does |
|---|---|
| Answers 2xx within 10 seconds | Success, logged with its status and latency. |
| Answers another status or a redirect, times out or refuses the connection | A failure, retried after 5 seconds, then doubling up to one hour with 20 percent jitter; redirects are never followed. |
Answers 429, or 503 with Retry-After | That delivery waits the Retry-After (seconds or an HTTP date, kept between 5 seconds and an hour), or 30 seconds without one, doubling if throttled again; it is not an attempt and does not count toward the 72 hours. |
| Succeeds again after failing | Deliveries waiting out a backoff are sent right away; throttled ones wait out their Retry-After. |
| Cannot be reached because Workwae's network or DNS is down | The outage is ours: retried after 30 seconds without counting against your endpoint, and still logged. |
| Still failing 3 days after an event was queued | The delivery is given up and marked failed; failed deliveries are deleted after 30 days. |
| Fails for 72 hours without a single success | Disabled: isEnabled becomes false, disabledReason says why, no new events arrive and queued deliveries wait. Re-enable it, then replay what it missed. |
https_required.user-agent: workwae-webhooks/1.Each type's data is typed in the SDKs, and the events guide has a sample body for each; events that concern no account carry a null accountId.
| Event | When it is sent |
|---|---|
| Accounts | |
account. | An account was connected, or signed in again (reauthorized: true). |
account. | Its status, externalRef, settings or connection changed, listed in fields. |
account. | The provider refused the grant, with the reason; the account must sign in again. |
account. | The first mail sync finished; nothing before it is announced. |
account. | An account was deleted; its data is purged after the retention period, or at once. |
account. | A deleted account's data is gone; names no account, since it outlives it. |
| Mailboxes | |
mailbox., mailbox. | A folder or label appeared or went away. |
mailbox. | Renamed, moved or given another role; counts change silently. |
| Messages | |
message. | Indexed: received, sent, drafted, or moved in from outside the sync window. |
message. | Read, flagged, moved, or linked to the outbox entry it copies. |
message. | Removed; carries it and its mailboxes as last indexed. |
message. | A delivery status notification reported failed recipients, with the outbox id for your sends. |
message. | AI classified a reply to one of your sends, when reply classification is on. |
message., message. | A send's open pixel loaded or tracked link followed, by a person or a machine. |
| Sends and suppressions | |
send. | The provider accepted a queued send. |
send. | An attempt failed; queued again for nextAttemptAt. |
send. | Failed for good: refused, or out of attempts. |
send. | A new send time before the first attempt. |
suppression. | An address was suppressed: an unsubscribe, a permanent bounce, or a detected opt-out. |
| Calendars | |
calendar. | The first calendar sync finished; nothing before it is announced. |
calendar., calendar., calendar. | A calendar appeared, changed or went away. |
calendar_event., calendar_event., calendar_event. | A single event, series or exception appeared, changed or went away; a series change is one update, and unmodified occurrences are never announced. |
booking., booking. | A scheduling link took a booking, or one was cancelled; the calendar event comes as its own events. How bookings work. |
| Contacts | |
contacts. | The first contacts sync finished; nothing before it is announced. |
contact., contact., contact. | A contact appeared, changed or went away. |
| Meetings, exports and tests | |
meeting_connection. | An account connected or reconnected its own Zoom or Webex grant. |
meeting_connection. | Zoom or Webex refused the meeting grant; mail and calendar sync go on. |
export., export. | A data export finished, downloadable until it expires, or failed. |
webhook. | Sent by the test action to the endpoint it names; never in the feed. |
Yes, retries and replays deliver the same event id again, in the webhook-id header and the body. Make your handling idempotent on that id.
No, a new account's first sync is quiet and ends with one account.initialized, plus calendar.initialized or contacts.initialized when those are on. Read existing mail through the API; every later change is announced.
As far as your tenant's eventRetentionDays, set between 7 and 30 days, which is also how long the feed keeps events. A range replay queues at most 1,000 events per call, so split larger ranges.
Workwae is in early access; tell us what you are building, and read the webhooks guide in the meantime.