1. Staff webhooks
Handwrite Admin
  • Handwrite Admin
    • Start here — staff console
    • Admin API specification notes
    • Admin socket specification notes
    • Staff role and permission matrix
    • Staff workflows and architecture
    • Admin source and validation status
    • Customer accounts
      • README — GET /api/admin/accounts/{sub}/billing
      • README — GET /api/admin/accounts/{sub}/cloud/documents/{id}
      • README — GET /api/admin/accounts/{sub}/cloud/documents
      • README — POST /api/admin/accounts/{sub}/cloud/keys/{keyId}/revoke
      • README — GET /api/admin/accounts/{sub}/cloud/keys
      • README — GET /api/admin/accounts/{sub}/cloud/oauth
      • README — GET /api/admin/accounts/{sub}/cloud/orgs
      • README — GET /api/admin/accounts/{sub}/cloud/settings
      • README — GET /api/admin/accounts/{sub}/cloud/usage
      • README — GET /api/admin/accounts/{sub}/cloud/webhooks
      • README — POST /api/admin/accounts/{sub}/delete
      • README — POST /api/admin/accounts/{sub}/disable
      • README — POST /api/admin/accounts/{sub}/enable
      • README — POST /api/admin/accounts/{sub}/mfa-reset
      • README — POST /api/admin/accounts/{sub}/password-reset
      • README — POST /api/admin/accounts/{sub}/purge
      • README — POST /api/admin/accounts/{sub}/restore
      • README — GET /api/admin/accounts/{sub}
      • README — PATCH /api/admin/accounts/{sub}
      • README — POST /api/admin/accounts/{sub}/sign-out
      • README — GET /api/admin/accounts
      • GET /api/admin/accounts/{sub}/billing
      • GET /api/admin/accounts/{sub}/cloud/documents/{id}
      • GET /api/admin/accounts/{sub}/cloud/documents
      • POST /api/admin/accounts/{sub}/cloud/keys/{keyId}/revoke
      • GET /api/admin/accounts/{sub}/cloud/keys
      • GET /api/admin/accounts/{sub}/cloud/oauth
      • GET /api/admin/accounts/{sub}/cloud/orgs
      • GET /api/admin/accounts/{sub}/cloud/settings
      • GET /api/admin/accounts/{sub}/cloud/usage
      • GET /api/admin/accounts/{sub}/cloud/webhooks
      • POST /api/admin/accounts/{sub}/delete
      • POST /api/admin/accounts/{sub}/disable
      • POST /api/admin/accounts/{sub}/enable
      • POST /api/admin/accounts/{sub}/mfa-reset
      • POST /api/admin/accounts/{sub}/password-reset
      • POST /api/admin/accounts/{sub}/purge
      • POST /api/admin/accounts/{sub}/restore
      • GET /api/admin/accounts/{sub}
      • PATCH /api/admin/accounts/{sub}
      • POST /api/admin/accounts/{sub}/sign-out
      • GET /api/admin/accounts
    • Staff administration
      • README — POST /api/admin/admins/{sub}/password-reset
      • README — PATCH /api/admin/admins/{sub}
      • README — DELETE /api/admin/admins/{sub}/sessions
      • README — GET /api/admin/admins
      • README — POST /api/admin/admins
      • POST /api/admin/admins/{sub}/password-reset
      • PATCH /api/admin/admins/{sub}
      • DELETE /api/admin/admins/{sub}/sessions
      • GET /api/admin/admins
      • POST /api/admin/admins
    • Operations
      • README — GET /api/admin/alarms
      • README — GET /api/admin/audit
      • README — GET /api/admin/billing
      • README — GET /api/admin/config
      • README — PUT /api/admin/config
      • README — GET /api/admin/deletions
      • README — GET /api/admin/icloud/probe
      • README — POST /api/admin/jobs/rollup
      • README — GET /api/admin/me
      • README — GET /api/admin/overview
      • README — GET /api/admin/usage/accounts/{sub}
      • README — GET /api/admin/usage/orgs/{id}
      • README — GET /api/admin/usage/rollup
      • GET /api/admin/alarms
      • GET /api/admin/audit
      • GET /api/admin/billing
      • GET /api/admin/config
      • PUT /api/admin/config
      • GET /api/admin/deletions
      • GET /api/admin/icloud/probe
      • POST /api/admin/jobs/rollup
      • GET /api/admin/me
      • GET /api/admin/overview
      • GET /api/admin/usage/accounts/{sub}
      • GET /api/admin/usage/orgs/{id}
      • GET /api/admin/usage/rollup
    • Authentication
      • README — POST /api/admin/auth/challenge
      • README — POST /api/admin/auth/sign-in
      • README — POST /api/admin/auth/sign-out-all
      • README — POST /api/admin/auth/sign-out
      • README — POST /api/admin/auth/step-up
      • POST /api/admin/auth/challenge
      • POST /api/admin/auth/sign-in
      • POST /api/admin/auth/sign-out-all
      • POST /api/admin/auth/sign-out
      • POST /api/admin/auth/step-up
    • Staff webhooks
      • README — DELETE /api/admin/hooks/{id}
      • README — POST /api/admin/hooks/{id}/test
      • README — GET /api/admin/hooks
      • README — POST /api/admin/hooks
      • README — staff webhook delivery
      • DELETE /api/admin/hooks/{id}
        DELETE
      • POST /api/admin/hooks/{id}/test
        POST
      • GET /api/admin/hooks
        GET
      • POST /api/admin/hooks
        POST
    • Organisations
      • README — POST /api/admin/orgs/{id}/api-access
      • README — GET /api/admin/orgs/{id}/audit
      • README — GET /api/admin/orgs/{id}/members
      • README — GET /api/admin/orgs/{id}
      • README — GET /api/admin/orgs/{id}/usage
      • POST /api/admin/orgs/{id}/api-access
      • GET /api/admin/orgs/{id}/audit
      • GET /api/admin/orgs/{id}/members
      • GET /api/admin/orgs/{id}
      • GET /api/admin/orgs/{id}/usage
    • Schools
      • README — POST /api/admin/schools/{orgId}/close
      • README — GET /api/admin/schools/{orgId}
      • README — PATCH /api/admin/schools/{orgId}
      • README — GET /api/admin/schools
      • POST /api/admin/schools/{orgId}/close
      • GET /api/admin/schools/{orgId}
      • PATCH /api/admin/schools/{orgId}
      • GET /api/admin/schools
    • Sessions
      • README — DELETE /api/admin/sessions/{id}
      • README — GET /api/admin/sessions
      • DELETE /api/admin/sessions/{id}
      • GET /api/admin/sessions
    • Support
      • README — GET /api/admin/support/canned/{id}
      • README — PUT /api/admin/support/canned/{id}
      • README — DELETE /api/admin/support/canned/{id}
      • README — GET /api/admin/support/canned
      • README — POST /api/admin/support/canned
      • README — GET /api/admin/support/tickets/{id}/attachments/{n}
      • README — GET /api/admin/support/tickets/{id}/link
      • README — POST /api/admin/support/tickets/{id}/link
      • README — POST /api/admin/support/tickets/{id}/note
      • README — POST /api/admin/support/tickets/{id}/reply
      • README — GET /api/admin/support/tickets/{id}
      • README — PATCH /api/admin/support/tickets/{id}
      • README — POST /api/admin/support/tickets/{id}/school
      • README — POST /api/admin/support/tickets/{id}/spam
      • README — GET /api/admin/support/tickets
      • GET /api/admin/support/canned/{id}
      • PUT /api/admin/support/canned/{id}
      • DELETE /api/admin/support/canned/{id}
      • GET /api/admin/support/canned
      • POST /api/admin/support/canned
      • GET /api/admin/support/tickets/{id}/attachments/{n}
      • GET /api/admin/support/tickets/{id}/link
      • POST /api/admin/support/tickets/{id}/link
      • POST /api/admin/support/tickets/{id}/note
      • POST /api/admin/support/tickets/{id}/reply
      • GET /api/admin/support/tickets/{id}
      • PATCH /api/admin/support/tickets/{id}
      • POST /api/admin/support/tickets/{id}/school
      • POST /api/admin/support/tickets/{id}/spam
      • GET /api/admin/support/tickets
    • Health
      • README — GET /api/health
      • GET /api/health
  1. Staff webhooks

README — staff webhook delivery

An owner can register up to five staff webhook endpoints through the Admin hooks API. Delivery is an outbound HTTPS POST to the registered URL, not an inbound Handwrite route or a WebSocket. This contract is separate from regular-account document webhooks. Keep the receiver and its signing secret within the authorized staff integration.

Categories and body#

CategoryEvents
securityDenied sign-ins/step-ups, staff identity/role changes, configuration/hook changes and qualifying denied or failed actions.
accessCustomer or school access restrictions/restoration, credential revocation and organisation API blocking.
userCustomer name/email changes, deletion requests and restoration.
retentionHolds, purges, school closure, export and erasure actions.
data_accessAudited viewing of private customer metadata/content fields and attachment downloads; potentially high volume.
An event can have multiple categories. type is staff. plus the first category in the defined category order; use categories to inspect every match. Routine desk work and rollups do not necessarily produce a staff webhook. Test delivery uses staff.security, action hooks.test, audit ID test and sequence zero.
type StaffHookEvent = {
  id: string;
  type: `staff.${"security" | "access" | "user" | "retention" | "data_access"}`;
  categories: string[];
  created: string;
  data: {
    action: string;
    outcome: string;
    actor: { sub: string; role: string };
    target: { type: string; id: string };
    at: string;
    audit: { id: string; seq: number };
  };
};
Payloads contain action/actor/target identifiers and audit position, not the audit reason, before/after values, names, emails or document text. Treat identifiers as internal information. created is event creation time; data.at is the audit entry time. The sequence can support reconciliation but does not establish delivery ordering.

Authentication and acknowledgement#

The sender uses Content-Type: application/json, User-Agent: Handwrite-Staff-Webhooks/1.0, Handwrite-Event-Id, Handwrite-Event-Type and Handwrite-Signature. The signature is t=<Unix seconds>,v1=<hex HMAC-SHA256> over the exact <timestamp>.<raw body> string using the endpoint's secret. Verify the raw request bytes before parsing/re-serializing JSON, use a constant-time comparison, and apply a receiver timestamp/replay policy. The secret is revealed once by hook creation; it is not a staff session or a personal developer token.
Return a 2xx response within the ten-second delivery timeout. Other status codes and transport failures retry. Delivery resolves and pins a permitted public HTTPS address and does not follow an untrusted redirect to a private host.

Retries and reconciliation#

There are up to eight attempts in total, with backoff beginning at one minute and doubling toward roughly an hour; exhausted messages go to the configured dead-letter queue. Store event IDs to make receiver processing idempotent. Return success for an already processed event. Do not assume exactly-once or ordered delivery.
Webhook queuing must not fail the originating audit write. An unavailable queue or queue failure can therefore leave an audit event without a delivered webhook: reconcile important workflows against the authorized audit interface. A deleted endpoint or one that no longer subscribes to any event category is skipped. Endpoint registration data is cached for up to one minute per process, and the worker rechecks subscription at delivery. Console fields report the last delivery time, outcome, HTTP status and error.
Source: shared/staff-hooks.ts, shared/staff-hook-categories.ts, admin/src/jobs/staff-hooks.ts, admin/src/admin/staff-hooks-admin.ts, and src/cloud/webhooks.ts. This is the source-derived receiver contract; no live delivery was sent during this documentation task.
Modified at 2026-10-26 13:41:16
Previous
README — POST /api/admin/hooks
Next
DELETE /api/admin/hooks/{id}
Built with