WorkPulseSolutions
Integrations Featured

Session Alert Webhooks

Send session start and stop alerts to your system, test the connection and check delivery history.

332 views
10 min read
Updated 2 weeks ago
#webhooks #session alerts #integrations #signatures #api

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

  1. Open Settings → Session Alerts.
  2. Find Webhook in Delivery tools and click Set up, or Configure for an existing connection.
  3. Enter the full receiving URL. It must be a publicly reachable HTTPS endpoint on port 443.
  4. Select session.started, session.stopped or both, and turn Endpoint enabled on when the receiver is ready.
  5. Click Save webhook.
Configure session webhook dialog showing receiving URL, event choices and endpoint enabled
Enter your endpoint and choose its events here. This example has no destination or secret configured.

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.

Session alerts page with the global Live alerts switch and start and stop event choices
The global Live alerts switch controls real email and webhook alerts. Saving the webhook alone does not turn this switch on.

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

HeaderPurpose
Content-Type: application/jsonThe request body is JSON.
X-Workpulse-Eventsession.started, session.stopped or session.notification.test.
X-Workpulse-Event-IDStable UUID for the event.
X-Workpulse-TimestampUnix timestamp used when generating the signature.
X-Workpulse-SignatureHMAC-SHA256 signature in the form v1=HEX_DIGEST.
Idempotency-KeyThe 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)
  1. Reject the request if the timestamp is missing, invalid or older than five minutes.
  2. Calculate the expected value from the unmodified raw body.
  3. Compare the expected and supplied signatures with a constant-time comparison.
  4. Only then parse and process the JSON.
  5. Do not log the signing secret or full sensitive payloads.

Responses, retries and duplicates

  • Return any 2xx response within 10 seconds to mark the delivery successful.
  • Redirects are not followed.
  • HTTP 408, 425, 429 and 5xx responses are retried after approximately 60 seconds, 5 minutes and 30 minutes, for up to four attempts.
  • Other 4xx responses are terminal failures and can be replayed from Recent deliveries after the problem is corrected.
  • Use the event ID or Idempotency-Key to make repeated attempts safe. A manual replay retains the event ID and sets delivery.replay to true.
  • An endpoint is automatically paused after 20 consecutive failures. Correct the receiver, re-enable it and send a test.

Troubleshooting

What you seeWhat to check
Webhook is lockedConfirm the plan or custom entitlements include API Access, Webhooks and Session Activity Notifications.
Test remains pendingThe WorkPulse queue worker may be unavailable. Contact support with the approximate test time.
HTTP 401 or 403Check that the receiver uses the current signing secret and verifies the exact raw body.
HTTP 404Check the full path and deployment of the receiving endpoint.
HTTP 429 or 5xxWorkPulse retries automatically. Review receiver capacity and logs.
Test works but live events do notEnable global Live alerts and select the event both globally and on the endpoint.
Unexpected duplicateDeduplicate with the event ID or Idempotency-Key.
Secret safety

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?