Skip to content

REST API v1

The REST API v1 provides read-only programmatic access to a company's departments, locations, labels, leave types, leaves, and users. This page covers the base URL, the x-api-key authentication header, the success and error response shapes, nextToken pagination on leaves and users, and the six available GET endpoints. A newer v2 API with read and write access, scoped API keys, and webhooks also exists. Before committing a new integration to v1, check the current v1 lifecycle and support status with the API provider, and weigh whether v2's write and event capabilities fit your roadmap.

What v1 gives you

Version 1 is a read-only surface. It exposes six resources: departments, locations, labels, leave types, leaves, and users. There are no write operations, no scoped keys, and no webhooks in v1. If your integration needs to create or modify records, or to receive event notifications, the v2 API is the relevant surface. Because v1's long-term lifecycle is a provider decision rather than a fixed contract, existing read-only consumers should confirm the current support status before planning a migration timeline.

Base URL

Every request targets the v1 base path. Use the base URL in the first request example.

Authentication

All requests require an API key supplied in the x-api-key request header. The cURL example shows how to send the header. Key issuance is handled by the API provider: ask your account administrator or the provider's developer contact how to request a key, and confirm any scope or expiry rules that apply to your account before you build against it.

Response format

A successful call returns HTTP 200 with a JSON envelope containing a status field set to "ok" and a data array. See the JSON response example. The /v1/leaves and /v1/users endpoints may additionally include a top-level nextToken field, described under Pagination.

Errors

Treat the HTTP status code as the source of truth; the body explains what went wrong. Two error envelopes exist. Requests rejected before reaching the endpoint (missing or unrecognized API key, unknown path) return a simpler { "message": "..." } shape. Requests that reach the endpoint return { "status": "error", "message": "..." }. Because the HTTP status is always non-2xx on error, branch on the status code rather than on status === "error".

Pagination

The /v1/leaves and /v1/users endpoints support pagination via nextToken and limit query parameters. If a response includes a nextToken field, pass it as a query parameter on the next request to fetch the following page. The pagination example shows how to request the next page.

Available endpoints

The six v1 endpoints are listed in the endpoint reference table below. All are GET requests. The leaves endpoint requires a date range; the users endpoint accepts optional filters. The departments endpoint returns all active departments with their IDs and names.

Choosing between v1 and v2

Use this checklist before starting a new integration. Choose v1 if you only need to read the six listed resources and your existing tooling already works against the v1 contract. Choose v2 if you need write operations, scoped API keys, or webhook event delivery. If you are migrating, the v2 migration guide is the authoritative reference for the transition. Confirm the current v1 support status with the API provider before you set a cutover date.

Error status reference
StatusWhenBody
400 Bad RequestA query parameter is missing or invalid (for example, startDate is required but absent).{ "status": "error", "message": "..." }
403 ForbiddenThe x-api-key header is missing, the key is not recognized, or the key is not authorized to access this resource.{ "message": "Forbidden" } for missing/unrecognized keys; { "status": "error", "message": "..." } for authorization failures.
404 Not FoundThe requested path does not exist.{ "message": "..." }
500 Internal Server ErrorAn unexpected server-side error. Safe to retry with exponential backoff.{ "status": "error", "message": "..." }

Status codes and body shapes are the exact contract from the source reference.

Endpoint reference
EndpointDescription
GET /v1/departmentsList all active departments
GET /v1/locationsList all active locations
GET /v1/labelsList all active labels
GET /v1/leave-typesList all leave types
GET /v1/leavesList leaves between two dates
GET /v1/usersList users with optional filters

All six endpoints are GET-only in v1.

Frequently asked questions

Is the v1 API still supported?

Support status for v1 is set by the API provider and can change, so confirm the current lifecycle position before you depend on it. A v2 API with read and write access, scoped keys, and webhooks is also available for teams that need those capabilities.

How do I get an API key?

Key issuance is handled by the API provider. Ask your account administrator or the provider's developer contact how to request one, and confirm any scope or expiry rules that apply to your account. The key is passed in the x-api-key header on every request.

Which endpoints support pagination?

Only /v1/leaves and /v1/users. If the response includes a nextToken field, pass it as a query parameter on the next request to fetch the following page.

How should I detect errors?

Branch on the HTTP status code, not on status === "error". Two envelopes exist: a simpler { "message": "..." } shape for requests rejected before reaching the endpoint, and { "status": "error", "message": "..." } for requests that reach the endpoint. In both cases the HTTP status is non-2xx.

$API_BASE_URL/v1
curl $API_BASE_URL/v1/departments \
  -H "x-api-key: your-api-key"
{
  "status": "ok",
  "data": [...]
}
curl "$API_BASE_URL/v1/users?limit=100&nextToken=abc123" \
  -H "x-api-key: your-api-key"