Session Alert Webhooks
Send session start and stop alerts to your system, test the connection and check delivery history.
A session webhook tells another system when an employee starts or stops real tracked work. Break sessions are excluded. A developer will need to prepare the receiving endpoint and verify the signed requests.
1. Check access
The company needs Session Activity Notifications, API Access and Webhooks. The company owner or a user with Manage Session Notifications can configure the connection.
2. Open the webhook form
- Open Settings → Session Alerts.
- Find Webhook in Delivery tools and click Set up, or Configure for an existing connection.
- Enter the full receiving URL. It must be a publicly reachable HTTPS endpoint on port 443.
- Select session.started, session.stopped or both, and turn Endpoint enabled on when the receiver is ready.
- Click Save webhook.
After saving a new secret, copy its full value immediately into your receiver’s protected settings. The full value is shown once; later screens show only its ending characters. Never put the signing secret in browser code or a support screenshot.
3. Test, then enable real alerts
Choose Test webhook and check that the test is Delivered in Recent deliveries. A test sends a sample request to your endpoint; it does not start an employee work session.
For real events, turn on Live alerts, select the required start and stop events in the global alert rules, then click Save alert settings. The event must be selected both globally and on the webhook.
4. Check failures before replaying
Read the status, attempts and error in Recent deliveries. A successful test with no live events usually means Live alerts is off or the event choices do not match. A pending test can indicate that background delivery is unavailable; give support the test time.
For rejected requests, check the URL, current signing secret and receiver logs. Use replay only after fixing the problem. The receiver must recognise repeated event IDs so retries do not carry out the same business action twice.
After 20 consecutive failed attempts the endpoint is paused automatically. Correct the receiver, re-enable the endpoint and test it. Rotating the signing secret invalidates the old value immediately, so update the receiver before relying on further deliveries.
Developer reference: payload, signatures and retries
The reference below is for the developer implementing the receiver. Read the exact raw request body before parsing JSON.
Request headers
| Header | Purpose |
|---|---|
Content-Type: application/json | The request body is JSON. |
X-Workpulse-Event | session.started, session.stopped or session.notification.test. |
X-Workpulse-Event-ID | Stable UUID for the event. |
X-Workpulse-Timestamp | Unix timestamp used when generating the signature. |
X-Workpulse-Signature | HMAC-SHA256 signature in the form v1=HEX_DIGEST. |
Idempotency-Key | The stable event ID. Store it so duplicate attempts are safe. |
Example session.started payload
{
"id": "019f1234-5678-7abc-9def-0123456789ab",
"type": "session.started",
"occurred_at": "2026-08-23T09:15:00Z",
"tenant": {
"id": "019d1234-5678-7abc-9def-0123456789ab",
"name": "Example Company"
},
"user": {
"id": "019e1234-5678-7abc-9def-0123456789ab",
"name": "Example Employee",
"email": "employee@example.com"
},
"session": {
"id": 321,
"start_time": "2026-08-23T09:15:00Z",
"end_time": null,
"duration_seconds": null,
"team": {"id": 4, "name": "Operations"},
"project": {"id": 18, "name": "Client work"},
"session_type": {"id": 1, "name": "Desktop"},
"auto_closed": false,
"closure_reason": null
},
"is_test": false,
"delivery": {"attempt": 1, "replay": false},
"schema_version": "1.0"
}Team or project can be null when the matching inclusion setting is off or the session has no value. A stopped event includes end_time, duration_seconds, and automatic-closure context.
Verify the signature
Read the request as raw bytes before parsing JSON. Join the timestamp, one period and the exact raw body, then calculate a hexadecimal HMAC-SHA256 with the signing secret.
signed_value = X-Workpulse-Timestamp + "." + exact_raw_request_body
expected = "v1=" + HMAC_SHA256_HEX(signing_secret, signed_value)- Reject the request if the timestamp is missing, invalid or older than five minutes.
- Calculate the expected value from the unmodified raw body.
- Compare the expected and supplied signatures with a constant-time comparison.
- Only then parse and process the JSON.
- Do not log the signing secret or full sensitive payloads.
Responses, retries and duplicates
- Return any
2xxresponse within 10 seconds to mark the delivery successful. - Redirects are not followed.
- HTTP
408,425,429and5xxresponses are retried after approximately 60 seconds, 5 minutes and 30 minutes, for up to four attempts. - Other
4xxresponses are terminal failures and can be replayed from Recent deliveries after the problem is corrected. - Use the event ID or
Idempotency-Keyto make repeated attempts safe. A manual replay retains the event ID and setsdelivery.replaytotrue. - An endpoint is automatically paused after 20 consecutive failures. Correct the receiver, re-enable it and send a test.
Troubleshooting
| What you see | What to check |
|---|---|
| Webhook is locked | Confirm the plan or custom entitlements include API Access, Webhooks and Session Activity Notifications. |
| Test remains pending | The WorkPulse queue worker may be unavailable. Contact support with the approximate test time. |
| HTTP 401 or 403 | Check that the receiver uses the current signing secret and verifies the exact raw body. |
| HTTP 404 | Check the full path and deployment of the receiving endpoint. |
| HTTP 429 or 5xx | WorkPulse retries automatically. Review receiver capacity and logs. |
| Test works but live events do not | Enable global Live alerts and select the event both globally and on the endpoint. |
| Unexpected duplicate | Deduplicate with the event ID or Idempotency-Key. |
Rotate the secret immediately if it is exposed or lost. Rotation invalidates the old value, so update the receiver and send a new test before relying on live alerts.
Was this article helpful?