Skip to main content

Webhooks

A webhook lets an application be notified when a user's access changes, so it can drop cached permissions or react in real time — instead of polling.

Registering

Register one per application (POST /api/webhooks) with the URL to POST to and, optionally, the event types to receive. An empty selection means all events.

const wh = await mgmt.webhooks.register({
organizationId, applicationId, url: 'https://app.acme.com/hooks/latchvector',
});
// wh.secret is shown exactly once — store it now.

Events

EventFired when
role.assignedA role is assigned to a user
role.revokedA role is revoked from a user
role.permissions_changedA role's permission set changes
user.disabledA user is disabled
user.enabledA user is re-enabled
user.erasedA user is erased (data erasure)

Verifying the signature

Every delivery is signed with the secret shown at registration. Verify it before trusting the payload — reject anything that doesn't match. Rotate the secret with POST /api/webhooks/{id}/rotate-secret (the old one stops working immediately).

Managing

  • PUT /api/webhooks/{id} — change URL, events, or pause/resume (active).
  • DELETE /api/webhooks/{id} — stop deliveries.

In the console, an application's webhook URL and on/paused state are shown right in the Applications table.