Public API v1
Download OpenAPI contractOverview
Read-only, versioned access to an organisation's visits, appointments and employees, authenticated by API key. The machine-readable contract is OpenAPI v1.
| Setting | Value |
|---|---|
| Base URL | https://api.rejist.app/api/public/v1 |
| Methods | GET only. There are no write endpoints. |
| Authentication | X-API-Key: <key> |
| Endpoints | GET /visits, GET /appointments, GET /employees |
| Response | { "data": [...], "paging": { "page", "pageSize", "totalCount", "totalPages" } } |
| Errors | application/problem+json |
Everything else under /api (the portal and device API) takes a session JWT, not a key. A key is refused there, and a session JWT is refused on /api/public/v1.
API keys
An organisation Admin manages keys with the ordinary session JWT:
| Action | Request |
|---|---|
| Create | POST /api/v1/api-keys with { "name": "Payroll sync" } |
| List | GET /api/v1/api-keys |
| Revoke | DELETE /api/v1/api-keys/{id} (permanent, safe to repeat) |
- The secret is shown once. The create response carries the full key in
apiKey. Rejist stores only a SHA-256 hash of the secret and cannot show it again. If a key is lost, revoke it and create another. - Anatomy.
rjk_{region}_{keyId}_{secret}.keyIdis not secret: it is how a key is recognised in the list and in the audit log. Therjk_prefix lets secret scanners spot a leaked key. - Limits. Up to 25 active keys per organisation. A revoked key no longer counts.
- List fields.
id,name,keyId,createdAt,lastUsedAt(refreshed at most once a minute) andrevokedAt. Never the secret or its hash. - Who can manage keys. Admins only. A key cannot create, list or revoke keys.
Data region
Rejist keeps each organisation's data in one region (uk, eu or us) and never moves it between them. A key is created in the region of the admin session that created it, and that region is written into the key. A request is served only from that region, and the server fails closed:
- The key is looked up only in its own region's database, so a key presented to another region finds nothing.
- The key's recorded region must also match the region in the key as presented.
- A
?region=query parameter has no effect on a key's request.
The same API host serves every region; the key itself selects it, so a caller never chooses a region per request.
Reading data
Paging
page (default 1) and pageSize (default 50, maximum 200). paging.totalCount is the number of matching items across all pages. Page past the end and data is an empty array.
Date filters
from (inclusive) and to (exclusive), ISO 8601 with an offset. from must not be after to.
| Endpoint | Filters on | Order |
|---|---|---|
/visits | Check-in time | Newest first |
/appointments | Scheduled time | Latest first |
/employees | Date created | By id |
/employees also takes isActive=true|false. Kiosk devices are not employees and are never listed.
What is and is not returned
The public payloads are deliberately narrower than the internal API. They include names, status, times, purpose and host. They never include guest email or phone, photos, badge or approval tokens, or any employee credential. See the schemas in the OpenAPI contract for the exact fields.
Rate limiting
Each key has its own budget, 120 requests per minute by default (Security:RateLimiting:PublicApi), counted in a fixed window. Past it the API answers 429 with a Retry-After header (seconds). One organisation's traffic never spends another's budget. Page through large exports at a steady pace rather than in a burst.
Audit
Every authenticated use of a key writes an audit-log row before the data is read:
| Field | Value |
|---|---|
| Action | api_key.used |
| Actor | api-key:{keyId} |
| Entity | The key (ApiKey, row id) |
| Details | Method and path, plus the names of the query parameters (never their values) |
Creating and revoking a key are audited as api_key.created and api_key.revoked, against the admin who did it. The full key never appears in the audit log.
If the audit row cannot be written, the request is answered 503 and no data is returned.
Errors
| Status | Meaning |
|---|---|
| 400 | Bad page, pageSize, from or to |
| 401 | Missing, malformed, unknown, revoked or wrong-region key. The body does not say which. |
| 429 | Rate limit used up. Wait Retry-After seconds. |
| 503 | The request could not be recorded. Retry shortly. |
Operating notes
- A refused key costs one indexed lookup. Failed attempts are logged (key id and region only, never the presented secret) and do not count against any key's budget.
- Rotate a key by creating its replacement, switching the integration, then revoking the old one.
- Out of scope for v1: write endpoints. Outbound webhooks are separate.