Getting started
Five minutes from nothing to reading and writing time. Every example uses curl; anything that speaks HTTPS and JSON works the same way.
1. Make an API key
- Sign in to Punchly.
- Open Profile → Advanced → API keys.
- Give the key a name that says where it will live (for example, Payroll sync) and choose Create key.
- Copy the key. It starts with
pk_, and it is shown once: Punchly keeps only a fingerprint of it, so nobody can read it back later, us included. Lose it, and you make a new one.
Keep it somewhere safe, such as an environment variable:
export PUNCHLY_API_KEY="pk_…"A key acts as you: it sees what you see and can do what you can do, in every workspace you belong to. See Authentication.
Connecting a company system, such as an HR or payroll tool? Use a workspace key instead: an owner or admin makes one under Workspace settings → Integrations → API keys, read-only unless it has to write, and it keeps working when people come and go. Every step below works the same with it.
2. Find your workspace
Almost every path starts with a workspace. Ask which ones your key reaches:
curl https://api.punchly.work/v1/me/workspaces \
-H "X-Api-Key: $PUNCHLY_API_KEY"{
"items": [
{
"workspaceId": "01928f3e-7a1c-7d2e-9b1a-3c4d5e6f7a8b",
"name": "Acme Ltd",
"memberId": "01928f3e-8b2d-7e3f-8c2b-4d5e6f7a8b9c",
"role": "admin",
"status": "active",
"isProjectManager": false,
"isTeamManager": false,
"logoUrl": null,
"invitationId": null,
"subscription": { "planName": "Standard", "status": "active", "trialPlanName": null, "trialEndsAt": null }
}
]
}Keep workspaceId; the examples below call it $WID. memberId is you, inside that workspace.
3. Read time entries
Everything tracked in September, grouped by day:
curl "https://api.punchly.work/v1/workspaces/$WID/time-entries?from=2026-09-01&to=2026-09-30" \
-H "X-Api-Key: $PUNCHLY_API_KEY"{
"days": [
{
"date": "2026-09-30",
"totalSeconds": 27000,
"entries": [
{
"id": "01929a4b-…",
"memberId": "01928f3e-8b2d-…",
"description": "Quarterly payroll run",
"projectId": "01929000-…",
"taskId": null,
"tagIds": [],
"billable": true,
"type": "regular",
"source": "timer",
"startAt": "2026-09-30T03:30:00.000Z",
"endAt": "2026-09-30T08:00:00.000Z",
"durationS": 16200,
"localStartDate": "2026-09-30",
"version": 3
}
]
}
],
"weekTotals": [{ "weekStart": "2026-09-28", "totalSeconds": 27000 }],
"nextCursor": null
}- By default you get your own entries. An owner, admin or manager adds
memberId=to read someone else's. - A long range comes in pages: when
nextCursorisn'tnull, ask again withcursor=set to it. See Paging. - Instants are UTC;
localStartDateis the day the entry counts towards. See Dates and time zones.
4. Start and stop the timer
Most workspaces require a project on every entry; new workspaces do by default. List the projects and keep one's id (called $PID below):
curl https://api.punchly.work/v1/workspaces/$WID/projects -H "X-Api-Key: $PUNCHLY_API_KEY"No project yet? Make one, as its manager:
curl -X POST https://api.punchly.work/v1/workspaces/$WID/projects -H "X-Api-Key: $PUNCHLY_API_KEY" -H "Content-Type: application/json" -d '{ "name": "Acme website", "makeMeManager": true }'Then start the timer on it:
curl -X POST https://api.punchly.work/v1/workspaces/$WID/timer/start -H "X-Api-Key: $PUNCHLY_API_KEY" -H "Content-Type: application/json" -d '{ "description": "Client call", "projectId": "'"$PID"'", "billable": true }'The answer (201) holds the new running entry (its endAt is null). If another timer was running, it is stopped first and returned as stopped. To stop:
curl -X POST https://api.punchly.work/v1/workspaces/$WID/timer/stop -H "X-Api-Key: $PUNCHLY_API_KEY" -H "Content-Type: application/json" -d '{}'GET /workspaces/$WID/timer tells you what is running right now, if anything.
Required fields. A workspace can require a project, task, tag or description on every entry. A timer may start without them — the answer lists what's still missing in
missingRequiredFields— but it can't stop, and a finished entry can't be saved, until they're filled in: the answer is422 REQUIRED_FIELD_MISSING, with the missing ones indetails.fields.
5. Write a finished entry
curl -X POST https://api.punchly.work/v1/workspaces/$WID/time-entries \
-H "X-Api-Key: $PUNCHLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"startAt": "2026-09-29T09:00:00+05:30",
"endAt": "2026-09-29T11:30:00+05:30",
"description": "Design review",
"projectId": "01929000-…"
}'The answer (201) holds the saved entry, plus any warnings — for example OVERLAP when it overlaps another entry. Warnings never block the write; errors do. See Errors.
To change an entry later, PATCH /workspaces/$WID/time-entries/{id} with the fields to change and the version you last read. If someone changed it in between, you get 409 VERSION_CONFLICT rather than silently overwriting their change.
6. Pull an attendance report
First in, last out, breaks and overtime, per person and per day:
curl -X POST https://api.punchly.work/v1/workspaces/$WID/reports/attendance \
-H "X-Api-Key: $PUNCHLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "range": { "from": "2026-09-01", "to": "2026-09-30" }, "tz": "Asia/Kolkata" }'Each row in days has the member, the date, startAt (first in), endAt (last out), and workS, breakS, overtimeS, undertimeS and balanceS in seconds. stillClockedIn is true for a day that hasn't ended yet. The Summary, Detailed and Weekly reports work the same way.
Next
- Authentication: the second way to send a key, and why a request might be refused.
- Webhooks: stop polling, and hear about changes as they happen.
- API reference: every endpoint, with a Test request button.