Coding agent documentation index Fetch the complete documentation index at: https://docs.worklittle.com/docs-agent-manifest.json Use this file to discover all available pages before exploring further.
Live updates
Hear about changes to jobs, candidates, employees and more the moment they happen, over a WebSocket or by checking a cursor.
Overview
Live updates keep your copy of your organization's data in step with Worklittle Business without re-reading everything. They send the ids of records that changed. Read the records you care about through their normal routes, which apply your key's permissions as usual.
const ws = new WebSocket("wss://api.worklittle.com/business/updates/live?since=" + lastCursor, {
headers: { Authorization: `Bearer ${process.env.WORKLITTLE_API_KEY}` },
});
ws.onmessage = async (e) => {
const msg = JSON.parse(e.data);
lastCursor = msg.cursor;
if (msg.type === "reset") return refreshEverything();
for (const { topic, ids } of msg.changes ?? []) await refresh(topic, ids);
};
setInterval(() => ws.readyState === 1 && ws.send("ping"), 30_000);
Prefer webhooks when you want a signed event with the record's details pushed to your server. Use live updates when you keep your own copy of the data, or show it on a screen that should update on its own.
Routes
| Method | Path | What it does | | --- | --- | --- | | GET | `/business/updates/live` | Open a live connection | | GET | `/business/updates` | List changes since a cursor |
Open a live connection
GET /business/updates/live
A WebSocket that tells you which records changed in your organization a moment after they change, by anyone: teammates in the app, other keys, imports and automations. Messages carry ids, not records. Needs View jobs, View candidates, View employees or permission to read documents.
Query parameters:
| Name | Type | Description | | --- | --- | --- | | `since` | integer | The last `cursor` you saw. The first message then lists everything that changed after it. |
Request:
curl -s "https://api.worklittle.com/business/updates/live?since=48190" \
-H "Authorization: Bearer $WORKLITTLE_API_KEY"
Response:
{
"type": "changes",
"cursor": 48213,
"changes": [
{
"topic": "candidates",
"ids": [
"cand_2e7",
"cand_9a1"
]
},
{
"topic": "jobs",
"ids": [
"pj_8c21"
]
}
]
}
Open it as a WebSocket (wss://api.worklittle.com/business/updates/live). A plain HTTP request gets 426. The Messages and Staying connected sections below cover the format and reconnecting.
List changes since a cursor
GET /business/updates
The same changes as one JSON response, for clients that check on a timer instead of holding a connection. Needs the same permissions as the live connection.
Query parameters:
| Name | Type | Description | | --- | --- | --- | | `since` | integer | The `cursor` from your last call. Leave it out on the first call to get the current cursor. |
Request:
curl -s "https://api.worklittle.com/business/updates?since=48190" \
-H "Authorization: Bearer $WORKLITTLE_API_KEY"
Response:
{
"cursor": 48213,
"reset": false,
"changes": [
{
"topic": "candidates",
"ids": [
"cand_2e7",
"cand_9a1"
]
},
{
"topic": "jobs",
"ids": [
"pj_8c21"
]
}
]
}
Save cursor and send it as since next time. When reset is true, re-read what you keep a copy of (see the Messages section below).
Messages
Every message (and every /business/updates response) has a cursor, a number that grows with each change in your organization. Keep the latest one.
| `type` | Meaning |
| --- | --- |
| `ready` | Connected and nothing new since your `since`. |
| `changes` | `changes` lists `{ topic, ids }`. Re-read those ids. `ids` is `null` when many records changed at once: re-read that topic's list. |
| `reset` | Too much changed since your `since` to list. Re-read the topics you keep a copy of, then carry on from the new `cursor`. |
/business/updates returns { cursor, reset, changes } with the same meaning. A record that was deleted is listed too: reading it returns 404.
| `topic` | Read it with | Heard by keys with | | --- | --- | --- | | `jobs` | [Jobs](/business/api/jobs) | View jobs or View candidates | | `candidates` | [Candidates](/business/api/candidates), [Applications](/business/api/applications) | View candidates | | `stages` | [Stages](/business/api/stages) | View candidates | | `employees` | [Employees](/business/api/employees) | View employees | | `surveys` | [Surveys](/business/api/surveys) | View employees | | `attendance` | [Calendar](/business/api/calendar) | View employees or a calendar permission | | `documents` | [Documents](/business/api/documents) | Permission to read documents | | `org`, `members` | [Organization](/business/api/organization) | View candidates, View employees or Organization Full access | | `webhooks` | [Webhooks](/business/webhooks/overview) | View webhooks |
A key hears about the topics its permissions cover. An id in a message may still be a record the key's person can't open; reading it then returns 404, and you can skip it.
Staying connected
Send the text ping every 30 to 60 seconds; the answer is pong. Send nothing else. Reconnect with ?since= set to your last cursor and you miss nothing. Connections end after about 12 hours, or when the key's permissions change (close code 4001); reconnect the same way. Wait a second or two before reconnecting, and double the wait after each failed try, up to a minute. Each key holds up to 5 connections at once and may open up to 10 a minute. Past that the request gets 429 RATE_LIMITED: wait for Retry-After seconds.
| Close code | Meaning | | --- | --- | | `4001` | The connection reached its time limit, or the key's permissions changed. Reconnect. | | `4401` | The key was revoked, expired or lost access. Don't reconnect with it. | | `4404` | Live updates are paused. Reconnect later, or check [`/business/updates`](#list-changes-since-a-cursor) meanwhile. | | `4400` | The client sent something other than `ping`. |
Checking /business/updates every few seconds is fine too. It is one small read per call, and you can call it as often as your rate limit allows.
Install the agent skill
Paste this into your coding agent (Claude Code, Cursor, Codex, and others):
set up worklittle.com/SKILL.md