Webhooks
Subscribe to outbound events and receive HTTP POST notifications when shifts are filled, credentials expire, payroll runs are submitted, and more.Event Types
Create a Subscription
orgUnitId as a query parameter or JSON field targeting the customer org unit (team).
The response includes a signingSecret (shown once):
Payload Format
Wire JSON body (also stored on delivery rows):data fields vary by event (for example payroll_completed includes payrollRunId, externalPayrollId, and status).
Signature Verification
Every webhook includes anX-NexSpace-Signature header for verification:
X-NexSpace-Event. Verify the body with HMAC-SHA256:
Retry Policy
A delivery is considered successful when your endpoint responds with a2xx
status. Any other status (or a connection error/timeout) schedules a retry on a
fixed exponential backoff — the initial send plus up to 5 retries (6 attempts
total):
Retries are processed by a background job that ticks about once a minute, so
nextRetryAt on a delivery row is the earliest a re-attempt will fire, not an
exact time. Each attempt is recorded on the delivery (status code, response
body, error) and visible via Delivery Inspection. Every
retry request also carries an X-NexSpace-Retry header with the attempt number.
Auto-disable (dead-letter)
If the final (6th) attempt still fails, the subscription is automatically disabled (isActive: false) so a broken endpoint stops consuming retries. When
this happens NexSpace:
- stamps the reason and last error on the subscription’s
metadata(disabledReason: "max_retries_exceeded",disabledAt,lastError), - writes an audit-log entry (
WEBHOOK_SUBSCRIPTION_DISABLED), and - notifies the subscription’s creator in-app so a human can act.
PATCH /api/webhooks/{id} with { "isActive": true } (or from Settings →
Platform webhooks). New events resume delivery immediately; NexSpace does not
replay events that occurred while the subscription was disabled.
Delivery Inspection
View recent delivery attempts for a subscription:Test Events
POST /api/webhooks/{id}/test sends a type: test signed POST to that subscription’s URL only, even if the subscription does not list test or * — use this to verify connectivity.
Local debugging with the CLI
nexspace events listen starts a local HTTP receiver, creates a temporary
subscription, verifies X-NexSpace-Signature when signingSecret is returned,
and prints deliveries as JSONL. Cloud API hosts cannot reach 127.0.0.1 — tunnel
first:
NEXSPACE_BASE_URL at a local API if you do not need a tunnel. See
CLI Commands → Webhooks & events.
