API and webhooks
Read employees, work sites, entries and expenses into your own system – ERP, invoicing or reporting. Webhooks notify you of clock-ins and clock-outs instantly.
- REST + JSON
- Signed webhooks
- Included in paid plans
1. Create an API key
The admin creates the key in the app: Settings → API and webhooks → Create key. The key is shown only once. Send it with every request in the header Authorization: Bearer <key>.
curl -H "Authorization: Bearer llk_..." \
"https://leimauslaite.fi/app/api/v1/entries?from=2026-11-01&to=2026-11-30"
2. Resources
| Request | Content | Fields |
|---|---|---|
GET /api/v1/employees | Employees | id, name, email, employee number, role, active, work sites |
GET /api/v1/sites | Work sites | id, name, address, active |
GET /api/v1/entries | Entries | start and end (UTC), break, minutes, work site, project, entry method; parameters from, to (max. 93 days) and employeeId |
GET /api/v1/expenses | Travel and expenses | date, type, quantity, amount, route, purpose, status, has receipt; parameters from and to |
Times are in UTC (ISO 8601), dates in Finnish time. Without parameters, entries and expenses return the last 30 days. Up to 600 requests per minute per key.
{
"from": "2026-11-01",
"to": "2026-11-30",
"data": [
{
"id": "kA1b2C3d4E5f6",
"employeeId": "uX9y8Z7w6V5u4",
"siteId": "sQ1w2E3r4T5y6",
"projectId": null,
"start": "2026-11-03T05:30:00.000Z",
"end": "2026-11-03T14:00:00.000Z",
"breakMin": 30,
"minutes": 480,
"source": "device",
"note": ""
}
]
}
3. Webhooks
Add the URL under Settings → API and webhooks → Add webhook and choose the events. The URL must use https. Respond with a 2xx code within five seconds.
| Event | When |
|---|---|
entry.started | Work started (device, phone, NFC tag or kiosk) |
entry.ended | Work stopped |
entry.created | Entry added manually or as text |
entry.updated | Supervisor corrected an entry |
POST https://esimerkki.fi/leimauslaite-webhook
Content-Type: application/json
Leimauslaite-Event: entry.started
Leimauslaite-Signature: t=1794500000,v1=5f2c…
{"id":"evt…","type":"entry.started","created":"2026-11-03T05:30:01.120Z","data":{ …kirjaus kuten yllä… }}
Signature verification
Compute HMAC-SHA256 with the webhook secret over the string <t>.<request body> and compare it with the value v1. Reject requests older than five minutes.
// Node.js
const crypto = require("crypto");
function verify(rawBody, header, secret) {
const [, t, v1] = /^t=(\d+),v1=([0-9a-f]{64})$/.exec(header) || [];
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // enintään 5 min vanha
const mac = crypto.createHmac("sha256", secret).update(t + "." + rawBody).digest("hex");
return crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(v1));
}
Error codes
401 key missing or deleted · 402 plan does not include the API · 404 unknown resource · 422 invalid parameter · 429 too many requests. The error description is in the error field.
Questions about the API
What does the API cost?
The API and webhooks are included in the paid plans (Small, Growth and Business) at no extra charge.
Can data be changed through the API?
No. The API is read-only, so a key cannot change or delete entries. Changes are made in the app, so the correction history is preserved.
How is the key protected?
The key is shown only once when it is created, and only a hash of it is stored in the service. Delete the key in Settings immediately if you suspect it has fallen into the wrong hands – connections stop working at once.
What if our webhook server is down?
A failed delivery is retried after 1 min, 5 min, 30 min, 2 h and 12 h. The status of the latest delivery is shown in Settings.
Transfer to payroll software?
There is a ready-made payroll integration for Procountor and Netvisor (€10/mo). The API suits other systems: ERP, invoicing, reporting and BI.
Connect working hours to your own systems
The API is included in the paid plans. Try it free first with 1–3 employees.