Webhooks tell your system when something happens in a business, so it does not have to poll the API. EVoShifts sends a signed JSON POST to an HTTPS address of yours; then read the details you need with the API.
Setting up an endpoint
The owner adds the endpoint in the app (More → Business → API and webhooks → New webhook):
- the address:
https://, port 443, no user name or password in it; - the levels (the same rows as an API key, access levels) and the events to send: an event needs read access to its resource;
- the workplaces whose events it gets, an optional description and an expiry (7, 30, 60 or 90 days, or a date at most 365 days ahead). After the expiry nothing is sent until the owner saves the endpoint with a new one.
The app then shows the endpoint's signing secret (whsec_...) once; store it with your receiver. An owner can have up to 10 endpoints.
Events
| Event | Resource | When |
|---|---|---|
roster.published | Roster | A month is published or republished, or some of its days are published (a week or a custom range) |
shift.changed | Roster | A shift that was published changes its planned times, date or person, is marked as not worked (or no longer), or is deleted |
time_record.closed | Time | A shift's actual end is recorded (clock-out in the app, on the tablet or by a manager), or a recorded start or end is corrected |
absence.approved | Absences | An absence request is approved; one event per workplace it applies at: its own, every workplace where the person works for an absence at all their workplaces, and the other workplaces of the same company where they work for a company's absence |
daily_sales.saved | Sales | The day's net or gross takings are typed, imported (file, e-mail, till) or changed |
ping | none | "Send test" in the app |
Changes to draft shifts are not sent: the team does not see them yet. Events of a workplace whose plan is not active are not sent.
Payloads
Every delivery has the same envelope:
{
"id": "3f0c9a7e5b1d4c2a8e6f0b9d7c5a3e1f",
"type": "shift.changed",
"apiVersion": "v1",
"createdAt": "2026-03-10T10:00:00.000Z",
"workplaceId": "wp_gdansk",
"data": { }
}
data carries ids and the facts of the change, never names, pay or the kind of an absence: look people up with GET /workplaces/{id}/people. Shift times are the workplace's local times, like in the API. A time that is not set is an empty string. A retry sends the same id and body with a new signature.
| Event | data |
|---|---|
roster.published | rosterId, month (YYYY-MM), version, status (PUBLISHED, or DRAFT when only some days were published), publishedDays (those days of a draft, else null) |
shift.changed | shiftId, rosterId, date, deleted, userId (now; null when deleted or open), previousUserId, planned {start, end} (null when deleted), previousPlanned {start, end} |
time_record.closed | shiftId, rosterId, date, userId (who worked it), actual {start, end}, corrected (an end was recorded before) |
daily_sales.saved | date, netSales, grossSales (either may be null), source (MANUAL, CSV, POS) |
absence.approved | absenceId, userId, startDate, endDate, startTime, endTime (HH:mm for part of a day, else null) |
ping | message |
roster.published
{"rosterId": "wp_gdansk_2026_03", "month": "2026-03", "version": 4, "status": "PUBLISHED",
"publishedDays": null}
version rises with every publish. When only some days of a draft month are out, status is DRAFT and publishedDays lists the days of the month ([1, 2, 3, 4, 5, 6, 7]).
shift.changed
{"shiftId": "shift_123", "rosterId": "wp_gdansk_2026_03", "date": "2026-03-12",
"deleted": false, "userId": "user_456", "previousUserId": "user_123",
"planned": {"start": "2026-03-12T08:00:00", "end": "2026-03-12T16:00:00"},
"previousPlanned": {"start": "2026-03-12T08:00:00", "end": "2026-03-12T16:00:00"}}
userId is null for an open shift; for a deleted shift deleted is true, userId and planned are null and previousUserId / previousPlanned say what it was.
time_record.closed
{"shiftId": "shift_123", "rosterId": "wp_gdansk_2026_03", "date": "2026-03-12",
"userId": "user_123", "actual": {"start": "2026-03-12T07:58:00", "end": "2026-03-12T16:04:00"},
"corrected": false}
userId is who actually worked the shift (a colleague who covered, else the planned person). corrected is true when an end had been recorded before. For the hours as they count, read GET /workplaces/{id}/worked-time for the month.
absence.approved
{"absenceId": "abs_999", "userId": "user_123", "startDate": "2026-03-04", "endDate": "2026-03-06",
"startTime": null, "endTime": null}
startTime and endTime (HH:mm) are set when only part of one day is off.
daily_sales.saved
{"date": "2026-03-01", "netSales": 4000, "grossSales": 4320, "source": "POS"}
Amounts are in the workplace's currency. source is MANUAL, CSV or POS. The target and the labour totals are in GET /workplaces/{id}/daily-sales.
ping
{"message": "Test from EVoShifts"}
workplaceId is the endpoint's first workplace.
Delivery
POST /hooks/evoshifts HTTP/1.1
Host: example.com
Content-Type: application/json
User-Agent: EVoShifts-Webhooks/1
EVoShifts-Event: shift.changed
EVoShifts-Delivery: 3f0c9a7e5b1d4c2a8e6f0b9d7c5a3e1f
EVoShifts-Signature: t=1773136800,v1=5b1d0c3a...
{"id": "3f0c9a7e5b1d4c2a8e6f0b9d7c5a3e1f", "type": "shift.changed", ...}
- Answer with any 2xx within 10 seconds. The 10 seconds cover the whole attempt (connecting, TLS, sending, your answer's status line and headers). Your answer's body is never read. Answer first and do slow work afterwards, for example in a queue.
- Redirects are never followed and count as a failure.
- The same delivery can arrive more than once (a retry after your answer came too late, for example).
id(also inEVoShifts-Delivery) is the same on every attempt: store the ids you have handled and ignore repeats. - Deliveries are sent side by side and retried independently, so they can arrive out of order. Use the event's facts (a roster's
version, a shift's dates) or read the current state from the API instead of relying on the order.
Verifying the signature
EVoShifts-Signature is t=<unix seconds>,v1=<signature>, where the signature is the lowercase hex HMAC-SHA256 of "<t>.<raw body>" with the endpoint's signing secret as the key. t is the time of the attempt, so it changes on a retry while the body stays the same.
To verify: take the raw body exactly as received (before any JSON parsing), compute the HMAC, compare it with v1 in constant time, and refuse a t more than 5 minutes away from your clock. Answer 401 to a delivery that fails the check.
Node.js (Express):
const crypto = require("node:crypto");
const express = require("express");
const SECRET = process.env.EVOSHIFTS_WEBHOOK_SECRET; // whsec_...
const TOLERANCE_S = 300;
function verify(header, rawBody, nowS = Math.floor(Date.now() / 1000)) {
const parts = Object.fromEntries(String(header || "").split(",").map((p) => {
const i = p.indexOf("=");
return [p.slice(0, i).trim(), p.slice(i + 1).trim()];
}));
const t = Number(parts.t);
if (!Number.isInteger(t) || Math.abs(nowS - t) > TOLERANCE_S || !parts.v1) return false;
const expected = crypto.createHmac("sha256", SECRET).update(`${t}.${rawBody}`).digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(parts.v1);
return a.length === b.length && crypto.timingSafeEqual(a, b);
}
const app = express();
app.post("/hooks/evoshifts", express.raw({ type: "application/json" }), (req, res) => {
if (!verify(req.get("EVoShifts-Signature"), req.body.toString("utf8"))) return res.sendStatus(401);
const event = JSON.parse(req.body);
res.sendStatus(204); // answer first
// then handle event.id, event.type, event.data (skip ids you have seen)
});
app.listen(3000);
Python (Flask):
import hashlib, hmac, json, os, time
from flask import Flask, request
SECRET = os.environ["EVOSHIFTS_WEBHOOK_SECRET"].encode() # whsec_...
TOLERANCE_S = 300
def verify(header, raw_body, now=None):
parts = dict(p.strip().split("=", 1) for p in (header or "").split(",") if "=" in p)
try:
t = int(parts.get("t", ""))
except ValueError:
return False
if abs((now or time.time()) - t) > TOLERANCE_S or "v1" not in parts:
return False
expected = hmac.new(SECRET, f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, parts["v1"])
app = Flask(__name__)
@app.post("/hooks/evoshifts")
def hook():
raw = request.get_data() # the raw bytes, before parsing
if not verify(request.headers.get("EVoShifts-Signature"), raw):
return "", 401
event = json.loads(raw)
# queue event["id"], event["type"], event["data"]; skip ids you have seen
return "", 204
PHP:
<?php
$secret = getenv('EVOSHIFTS_WEBHOOK_SECRET'); // whsec_...
$tolerance = 300;
$raw = file_get_contents('php://input');
$header = $_SERVER['HTTP_EVOSHIFTS_SIGNATURE'] ?? '';
$parts = [];
foreach (explode(',', $header) as $pair) {
$kv = explode('=', $pair, 2);
if (count($kv) === 2) {
$parts[trim($kv[0])] = trim($kv[1]);
}
}
$t = isset($parts['t']) && ctype_digit($parts['t']) ? (int) $parts['t'] : 0;
$expected = hash_hmac('sha256', $t . '.' . $raw, $secret);
if ($t === 0 || abs(time() - $t) > $tolerance || !isset($parts['v1'])
|| !hash_equals($expected, $parts['v1'])) {
http_response_code(401);
exit;
}
$event = json_decode($raw, true);
http_response_code(204);
// handle $event['id'], $event['type'], $event['data']; skip ids you have seen
The secret is the whole whsec_... text. New signing secret in the app replaces it at once: deliveries signed with the old one stop, so update your receiver right after.
Retries and turning off
A delivery that fails (another status, a timeout, a redirect, an address that cannot be reached) is tried 7 times in all: at once, then about 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours after the previous attempt (retries run every few minutes, so each can come up to 5 minutes later). After the seventh failure the delivery is given up.
After 20 failed attempts in a row (of any deliveries) the endpoint is turned off and its waiting retries are given up. The owner turns it on again in the app once your receiver works; events from while it was off are not sent again, so read what you missed from the API. An endpoint whose workplaces were all deleted is turned off too.
Before every attempt, also a retry, EVoShifts checks again that the endpoint has not expired, still has the level for the event and that the workplace still belongs to its owner; if not, nothing is sent.
The app shows each endpoint's last 20 deliveries (time, event, result, your answer's status); they are kept 30 days.
Test send
Send test on the endpoint's card posts a signed ping at once and shows what your address answered. It is tried once, never retried, and does not count towards turning the endpoint off; it also works while the endpoint is off, so use it to check a fixed receiver before turning it on again.
Allowed addresses
To protect EVoShifts' own network, the address must be public:
https://only, port 443, no user name or password;- not an IP address in a private, loopback, link-local, carrier-grade NAT, multicast, documentation or reserved range (IPv4 and IPv6), nor
localhost, names ending in.local,.internal,.lan,.home,.corp,.intranet,.test,.invalidor.example, nor a name without a dot; - the name is resolved again at every attempt and the connection goes only to the addresses checked, so a name that later points to a private address is refused.
To test on your own computer, use a public HTTPS tunnel.