Skip to content

Event delivery
Webhook

Request

Aiwyn sends this request to a subscription's deliveryUrl each time an event it subscribes to happens (an entityType and operation from GET /api/v1/event-subscriptions/catalog). One request carries one event.

The same URL can also receive a subscription.disabled notification, which is not an event: its body is {type, timestamp, tenant, subscriptionId, deliveryUrl, consecutiveFailures, reason, lastStatusCode, lastErrorMessage}, it carries X-Aiwyn-Notification-Type: subscription.disabled and none of the X-Aiwyn-Event-Id, X-Aiwyn-Event-Operation or X-Aiwyn-Delivery-Id headers. Its X-Signature is computed the same way. Check X-Aiwyn-Notification-Type before parsing a request as an event.

Verify the signature before trusting the body. X-Signature is sha256= followed by the Base64 HMAC-SHA256 of the raw request body, keyed with your signing secret (GET /api/v1/event-subscriptions/webhook/secret). Compute it over the bytes you received, before parsing the JSON, and compare in constant time. POST /api/v1/webhook/test/generate and POST /api/v1/webhook/test/validate let you check your implementation.

Respond with any 2xx within 30 seconds. The response body is ignored.

  • A 5xx response or a connection error is retried up to two more times, about a minute and then five minutes later, with the same X-Aiwyn-Event-Id and a new X-Aiwyn-Delivery-Id. Any other non-2xx response, or no response within 30 seconds, is not retried. Reconcile missed events through the API.
  • A slow endpoint may still process a timed-out request, so acknowledge first and do the work afterwards.
  • The same change can be reported twice, as two events with different ids, so check whether you have already handled the change (the record's current state, or entityType, entityId and type) rather than relying on X-Aiwyn-Event-Id alone.
  • Deliveries are not guaranteed to arrive in event order; use event.eventTimestamp to order them.

Consent events (Engagement CONSENT_RECORDED) fire once a consent document's signers have settled on an outcome. With ALL_SIGNATURES_REQUIRED, every signer agreed (AFFIRMATIVE) or one declined (NEGATIVE). With ONE_SIGNATURE_REQUIRED, one signer agreed (AFFIRMATIVE) or every signer declined (NEGATIVE). They fire when the consent is answered, whether or not the engagement goes on to be signed. event.data.metadata carries engagementDocumentId, signatureRequirementType, consentStatus, decidedAt and one entry per signer in signers; event.data.relatedEntitiesData carries the engagement's clients, client groups and jobs. An answer given after the outcome is settled raises no new event. A paper consent the firm records when it executes an engagement manually raises the same event, with the staff member as the actor. decidedAt and consentProvidedAt have no offset: portal answers are in UTC, and a paper consent carries the time the firm entered. decidedAt is null for a decline recorded without a date.

File events (entityType File) are only delivered to an https URL. event.data.primaryRecord.file carries a short-lived signed downloadUrl (except for DELETED), and event.data.metadata is omitted.

Request item events (RequestItem SENT, APPROVED, REJECTED) carry the item in event.data.primaryRecord. event.data.metadata carries the item's previous status in status_old, plus recipients (id, name, email) for SENT and the reviewer's notes for REJECTED.

ClientRequest VIEWED is sent each time a staff member opens a client request in the Firm Portal. event.entityId is the client request's id. event.data.primaryRecord and relatedEntitiesData are null, so fetch the client request by that id if you need it, and don't rely on metadata.

Every attempt, with its status code and response, is listed by GET /api/v1/event-subscriptions/{id}/deliveries.

Headers
X-Signaturestringrequired

sha256= followed by the Base64 HMAC-SHA256 of the raw body, keyed with your signing secret.

Example:sha256=Epvu8EP9JvCXSg+nVg9aTomZkJ7u3vESqWQjFs1WmkA=
X-Aiwyn-Event-Idstringrequired

The event's id, the same as event.id.

Example:7001
X-Aiwyn-Event-Operationstringrequired

The event's operation, the same as event.type.

Example:POSTED
X-Aiwyn-Subscription-Idstringrequired

The id of the subscription this delivery is for.

Example:9
X-Aiwyn-Delivery-Idstring, (uuid)required

Unique per request, including a repeated delivery of the same event.

Example:0f6b1f7c-3c43-4c38-9a0e-0d3b8f7b2a51
X-Aiwyn-Timestampstring, (date-time)required

When this attempt was sent (ISO 8601, UTC).

Example:2026-11-01T18:04:05.123Z
X-Aiwyn-Tenantstringrequired

Your firm's tenant identifier.

Example:acmecpa
Bodyapplication/jsonrequired
eventobjectrequired
subscriptionobjectrequired
POST
event
Payload
{ "event": { "id": 7001, "type": "POSTED", "entityType": "Payment", "entityId": "48213", "eventTimestamp": "2026-11-01T18:04:03.517Z", "data": { … } }, "subscription": { "id": 9, "description": "Post payments to our ERP" } }

Responses

Delivered. Any 2xx status counts; the body is ignored.