REST API
Vacation Tracker REST API reference for programmatic access to company data.
The Vacation Tracker REST API gives you read-only access to your company's data: departments, locations, labels, leave types, leaves, and users.
Base URL
https://api.vacationtracker.io/v1Authentication
All API requests require an API key passed in the x-api-key header:
curl https://api.vacationtracker.io/v1/departments \
-H "x-api-key: your-api-key"To obtain an API key, contact your Vacation Tracker administrator or reach out to dev@vacationtracker.io.
Response format
A successful call returns HTTP 200 with:
{
"status": "ok",
"data": [...]
}The /v1/leaves and /v1/users endpoints may also include a top-level nextToken field. See Pagination below.
Errors
Use the HTTP status code as the source of truth. The body explains what went wrong.
| Status | When | Body |
|---|---|---|
400 Bad Request | A query parameter is missing or invalid (for example, startDate is required but absent). | { "status": "error", "message": "..." } |
403 Forbidden | The 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 Found | The requested path does not exist. | { "message": "..." } |
500 Internal Server Error | An unexpected server-side error. Safe to retry with exponential backoff. | { "status": "error", "message": "..." } |
Two error envelopes exist. Requests rejected before reaching the endpoint (missing/unknown API key, unknown path) return the simpler { "message": "..." } shape. Requests that reach the endpoint return { "status": "error", "message": "..." }. Either way, the HTTP status is non-2xx, so always branch on the status code rather than on status === "error".
Pagination
The /v1/leaves and /v1/users endpoints support pagination via nextToken and limit parameters. If the response includes a nextToken field, pass it as a query parameter in the next request to fetch the next page.
curl "https://api.vacationtracker.io/v1/users?limit=100&nextToken=abc123" \
-H "x-api-key: your-api-key"Available endpoints
| Endpoint | Description |
|---|---|
GET /v1/departments | List all active departments |
GET /v1/locations | List all active locations |
GET /v1/labels | List all active labels |
GET /v1/leave-types | List all leave types |
GET /v1/leaves | List leaves between two dates |
GET /v1/users | List users with optional filters |
Legacy flow (deprecated)
The original Vacation Tracker OAuth2 hostname at api.app.vacationtracker.io. Kept as a permanent compatibility mapping for existing integrations. New integrations should use auth.vacationtracker.io.
Get departments
This API method returns a list of all active departments with their IDs and names.