Webhooks
A webhook is Punchly calling you: when something happens, we send an HTTPS POST with a JSON event to the address you choose. No polling, and you hear about changes within seconds.
Setting one up
- In Punchly, open Profile → Advanced → Webhooks and choose Add a webhook.
- Give it a Name and the Endpoint: a public
https://address on your server. - Choose Whose activity:
- Only my own activity — events caused by you.
- Everybody's activity — every event in the workspace. Owners and admins only.
- Tick the events you want, and save.
- Copy the signing secret. You can show it again, or replace it, from the same screen.
Each person can have 10 webhooks per workspace, and a workspace 100.
You can also manage webhooks through the API — create, change, rotate the secret, read the delivery log, send a delivery again — with a personal key, or a workspace key with the webhooks:manage scope. See the API reference.
A webhook follows its owner's standing, checked at every event: if they're deactivated it goes quiet, and an Everybody's activity webhook goes quiet if its owner stops being an owner or admin.
Events
| Event | When |
|---|---|
time_entry.created |
A finished entry is added (typed in, from a timesheet, from a calendar…) |
time_entry.updated |
An entry is changed |
time_entry.deleted |
An entry is deleted |
time_entry.restored |
A deleted entry is restored (time_entry.updated is sent too, as before) |
time_entry.split |
An entry is split in two |
timer.started, timer.stopped |
A timer starts or stops — in the app, the desktop app, the phone or a kiosk |
attendance.clocked_in, attendance.clocked_out |
Somebody starts tracking with nothing running, or stops with nothing following |
attendance.break_started, attendance.break_ended |
Work stops and a break starts, or the other way round |
project.*, client.*, task.*, tag.* |
created, updated or deleted |
member.invited, member.joined, member.limited_added |
Somebody is invited, accepts, or is added as a kiosk-only member |
member.updated, member.deactivated, member.activated, member.removed |
A member's details or role change, or they're deactivated, activated or removed |
group.created, group.updated, group.deleted |
A group, or who is in it, changes |
rate.billable_updated, rate.cost_updated |
A billable or cost rate is set at any level |
approval.submitted, approval.status_changed |
A timesheet is submitted, or approved, rejected, withdrawn or reopened |
time_off.requested, time_off.approved, time_off.rejected, time_off.withdrawn, time_off.cancelled |
A time-off request and what happens to it |
time_off.balance_updated |
A balance is adjusted |
holiday.created, holiday.updated, holiday.deleted |
A holiday, or who it applies to, changes |
expense.created, expense.updated, expense.deleted, expense.restored |
An expense |
invoice.created, invoice.updated, invoice.sent, invoice.paid |
An invoice; paid when a payment settles it |
assignment.created, assignment.updated, assignment.deleted, assignment.published |
The schedule |
Bulk actions (editing or deleting many entries or expenses at once) don't send an event per item; a periodic sync picks them up.
Attendance
Attendance events read the timer the same way from every door — web, phone, desktop and kiosk — so an HR system doesn't have to rebuild shifts from starts and stops. Switching from one task to another is not a change of attendance and sends nothing.
{
"id": "0192b7c1-…",
"type": "attendance.clocked_in",
"workspaceId": "01928f3e-7a1c-…",
"createdAt": "2026-09-30T03:30:01.000Z",
"data": {
"memberId": "01928f3e-8b2d-…",
"at": "2026-09-30T03:30:00.000Z",
"localTime": "2026-09-30T09:00:00",
"timeZone": "Asia/Kolkata",
"source": "kiosk",
"kioskId": "01929b10-…",
"proof": "code",
"entry": { "id": "01929a4b-…", "type": "regular", "startAt": "2026-09-30T03:30:00.000Z", "endAt": null },
"actorMemberId": "01928f3e-8b2d-…"
}
}| Field | What it is |
|---|---|
at, localTime, timeZone |
The moment in UTC, and the wall-clock time where the person is |
source |
Where it happened: kiosk, timer (web), desktop or mobile |
kioskId |
The kiosk, when it happened at one; otherwise null |
proof |
At a kiosk, how the person proved who they were: pin, code (QR), manager_pin, or none when the kiosk doesn't ask. null elsewhere |
entry |
The entry that started or stopped |
What we send
POST /punchly HTTP/1.1
Host: example.com
Content-Type: application/json
User-Agent: Punchly-Webhooks/1
Punchly-Signature: t=1759213800,v1=5f0c2e…a91d
Punchly-Event-Id: 0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b
Punchly-Event-Type: time_entry.created
{
"id": "0192a1b2-c3d4-7e5f-8a9b-0c1d2e3f4a5b",
"type": "time_entry.created",
"workspaceId": "01928f3e-7a1c-7d2e-9b1a-3c4d5e6f7a8b",
"createdAt": "2026-09-30T06:30:00.000Z",
"data": {
"id": "01929a4b-…",
"version": 1,
"actorMemberId": "01928f3e-8b2d-…",
"entry": {
"id": "01929a4b-…",
"memberId": "01928f3e-8b2d-…",
"description": "Design review",
"projectId": "01929000-…",
"startAt": "2026-09-30T03:30:00.000Z",
"endAt": "2026-09-30T06:00:00.000Z",
"durationS": 9000,
"localStartDate": "2026-09-30",
"type": "regular",
"source": "manual"
}
}
}| Field | What it is |
|---|---|
id |
The event's id. The same on every retry of it — see Duplicates |
type |
The event name |
workspaceId |
Where it happened |
createdAt |
When it happened (UTC) |
data |
The event's facts, with actorMemberId: who made the change. For time events, entry is the entry as the API returns it; time_entry.deleted carries id, version, memberId and startAt. Catalogue events carry the record's id and main fields. Every other event carries what the API answered for the change — for example { "member": … } or { "invoice": … } — or, for a deletion, the ids it deleted. |
Rates and amounts. On time and attendance events, entry includes its rates and amounts (billableRateMinor, billableAmountMinor, rateSource, and the cost ones when cost rates are on) only on webhooks made by an owner or admin. Everybody else's webhooks receive the entry without them, as those people see it in the app.
Checking the signature
Anyone can send a POST to your endpoint, so check that it came from Punchly before acting on it. Punchly-Signature holds a timestamp t and a signature v1:
v1is the HMAC-SHA256, in hex, of{t}.{raw body}, keyed with your webhook's signing secret.- Refuse the request if the signature doesn't match, or if
tis more than 5 minutes from your clock. The timestamp is inside the signed text, so an old request captured and sent again can't pass. - Sign the raw bytes you received. Parsing the JSON and serialising it again changes the bytes and breaks the match.
- Compare in constant time.
Node.js
import crypto from 'node:crypto';
import express from 'express';
const app = express();
app.post('/punchly', express.raw({ type: 'application/json' }), (req, res) => {
const header = req.get('Punchly-Signature') ?? '';
const parts = Object.fromEntries(header.split(',').map((kv) => kv.split('=', 2)));
const t = Number(parts.t);
const expected = crypto
.createHmac('sha256', process.env.PUNCHLY_WEBHOOK_SECRET)
.update(`${t}.${req.body.toString('utf8')}`)
.digest('hex');
const given = Buffer.from(parts.v1 ?? '', 'utf8');
const fresh = Math.abs(Date.now() / 1000 - t) <= 300;
const valid =
given.length === expected.length && crypto.timingSafeEqual(given, Buffer.from(expected, 'utf8'));
if (!fresh || !valid) return res.sendStatus(400);
const event = JSON.parse(req.body.toString('utf8'));
queue.add(event); // do the work later: answer first
res.sendStatus(204);
});Python
import hashlib, hmac, json, os, time
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ["PUNCHLY_WEBHOOK_SECRET"].encode()
@app.post("/punchly")
def punchly():
parts = dict(p.split("=", 1) for p in request.headers.get("Punchly-Signature", "").split(",") if "=" in p)
t = int(parts.get("t", "0"))
body = request.get_data() # the raw bytes
expected = hmac.new(SECRET, f"{t}.".encode() + body, hashlib.sha256).hexdigest()
if abs(time.time() - t) > 300 or not hmac.compare_digest(expected, parts.get("v1", "")):
abort(400)
event = json.loads(body)
queue.put(event) # do the work later: answer first
return "", 204PHP
<?php
$secret = getenv('PUNCHLY_WEBHOOK_SECRET');
$body = file_get_contents('php://input'); // the raw bytes
$parts = [];
foreach (explode(',', $_SERVER['HTTP_PUNCHLY_SIGNATURE'] ?? '') as $pair) {
[$k, $v] = array_pad(explode('=', $pair, 2), 2, '');
$parts[trim($k)] = trim($v);
}
$t = (int) ($parts['t'] ?? 0);
$expected = hash_hmac('sha256', $t . '.' . $body, $secret);
if (abs(time() - $t) > 300 || !hash_equals($expected, $parts['v1'] ?? '')) {
http_response_code(400);
exit;
}
$event = json_decode($body, true);
enqueue($event); // do the work later: answer first
http_response_code(204);Answering
- Answer with any
2xxwithin 10 seconds. Anything else — another status, a timeout, a refused connection — counts as a failure. - Redirects aren't followed. A
3xxis a failure; give us the final address. - Answer first and do the work afterwards (a queue, a background job). A slow endpoint gets retries it didn't need.
Retries
A failed delivery is tried again, five attempts in all:
| Attempt | When |
|---|---|
| 1 | At once |
| 2 | 12 seconds later |
| 3 | 10 minutes later |
| 4 | 30 minutes later |
| 5 | 72 hours later |
That covers a deploy, a bad afternoon and a long weekend. After 20 failures in a row the webhook is switched off, marked Switched off after repeated failures, and its owner is told in their notifications; choose Turn on once the endpoint is fixed.
Sending one again. The delivery log keeps the body of each event's final attempt for 30 days. Send again (or POST /webhooks/{id}/deliveries/{deliveryId}/resend) delivers those same bytes, with the same event id, and a fresh set of attempts — useful after fixing an endpoint that missed a few. Every attempt, with our request and your answer, is listed under the webhook in Punchly.
Duplicates and order
- The same event can arrive twice — for example when your server did the work but its answer was lost. Every attempt of one event has the same
Punchly-Event-Id(and bodyid). Keep the ids you've handled for a few days and skip repeats. - Order isn't guaranteed. A retry can arrive after a newer event. For records, use
data.version: a higher version is newer, so ignore one lower than what you already hold. When in doubt, read the record through the API.
Security
- Your endpoint must be public HTTPS. We won't deliver to private or internal addresses.
- Treat the signing secret like a password. If it leaks, replace it in Punchly; the old one stops working at once.
- A webhook sends only what its owner may see. Only my own activity carries your events; Everybody's activity is limited to owners and admins.