Getting Started

Getting Started with the API

Connect your ATS, CRM, payroll or reporting system to TempClock through the REST API: switch access on, create a key yourself and make your first request.

Talk to us Browse all guides

Before You Start

What you need to get going.

Before you start

  • An admin login to your TempClock client dashboard
  • API access switched on for your account (step 1)
  • A way to make HTTP requests: curl, Postman or your programming language
  • Basic knowledge of REST APIs and JSON
Note

The API lets your other systems read workers, approved timesheets, payroll by pay week, bookings and who is on site, and send clocks, bookings and worker changes back. Each key only sees your account, and only what you allow it to.

Step 1: Switch API Access On

Done once per account by a TempClock administrator.

API access is off for a new account. Ask your TempClock administrator to switch it on. They do it in the agency console under Setup > API > Client API Access by selecting Enable next to your account. Until then, Setup > API keys shows API Access Not Available.

Important

Switching API access off again deactivates every key on the account at once. Use it if you need to stop all integrations in one go.

Step 2: Create a Key

Your own admins make keys. Nobody needs to ask TempClock.

Open Setup > API keys

In the client dashboard, open Setup > API keys. You need an admin login.

Name the key and choose its access

Name it after the system that will use it, for example Payroll export. Under What this key can do, pick No access, Read only or Read and write for each area. Give it only what that system needs: a payroll import needs Payroll read only; an on-site screen needs On site now only.

Create it and copy the key

Select Create key. The full key is shown once, in a green box. Copy it straight into your system's secret store: TempClock cannot show it again.

tc_live_4f0c9a2e7b1d58c3a6e9f07b3d2c1a54e8f6b9d0
Tip

The API keys and logs guide covers every option on the key screen: pay access, expiry, rate limit, sites, browser origins, rotation and revoking.

Step 3: Test the Key

One request shows what the key can do.

Every request sends the key in the Authorization header. The base URL is your TempClock address followed by /api/v1 (Setup > API keys shows it). /me.php needs no access level and answers which account and sites the key sees, what it may do, its rate limit and its expiry:

export TC_BASE="https://tempclock.com/api/v1" export TC_KEY="tc_live_..." curl -s "$TC_BASE/me.php" -H "Authorization: Bearer $TC_KEY"
Reply (shortened)
{ "data": { "key_name": "Payroll export", "client_name": "Apex Staffing Solutions", "site_limited": false, "effective_scopes": ["pay:read", "payroll:read"], "rate_limit_per_minute": 60, "expires_at": null, "api_version": "1.3" } }

Step 4: Your First Request

Read some data.

With a key that has Workers read access, list your active workers, two at a time:

curl -s "$TC_BASE/workers.php?active=true&limit=2" -H "Authorization: Bearer $TC_KEY"

Lists come back as data with pagination (total, limit, offset, has_more). Times are given in UK local time. Clock and booking times and most other record times come again in UTC (the _utc fields); the few that do not are listed under Dates and times in the developer conventions. If something is wrong, the reply has an error_code such as insufficient_scope (the key lacks that access) or invalid_api_key.

Note

Pay rates only appear for keys with Pay access, and charge rates only with Charges access. A worker list without them simply leaves the rate fields out.

Step 5: Explore the API

The developer documentation covers every endpoint.

Step 6: Monitor Usage

See every request your keys make.

Setup > API logs lists every request, including refused ones, with the key, status, error code and request id. Set Status Code to Any failure to see only problems. On the key list, Last Used shows when each key was last used: revoke any key nothing uses any more.

Rate limit

60 requests a minute per key by default; raise it on the key (up to 120)

Request id

Every reply has an X-Request-Id header: quote it when asking for help

Key format

tc_live_ followed by 40 characters, shown once

Audit

Creating, changing, rotating and revoking keys is in the audit log

What's Next

Get told when things happen, instead of asking.

Set up webhooks so TempClock tells your systems when a pay week is locked, a shift is approved or a booking changes.

Know who turned up, and pay every hour right.

Face-verified clock-ins, live geofencing and payroll-ready timesheets in one system. Tell us how your shifts run and we will show you how it fits.

Hosted in the EU · Your largest site live first, with us alongside · No app needed to clock in