REST API v2
Scopes by endpoint
Which scopes each API v2 endpoint requires, and the scopes that depend on the request.
Every endpoint and the scopes it needs, generated from the OpenAPI spec. A request without them answers 403 INSUFFICIENT_SCOPE, with the missing scopes in details.requiredScopes.
A :write scope implies its :read scope, so a key that holds leaves:write does not need leaves:read as well. See Scopes for what each one covers, and the role ceiling for which of them a key owner can grant.
These are not endpoint scopes: they apply only when a request asks for the data behind them, on top of whatever the endpoint itself requires.
| Condition | Also requires |
|---|
expand=user or expand=approver on a leave | users:read |
expand=leaveType on a leave | leave-types:read |
expand=location on a user | locations:read |
expand=department on a user | departments:read |
expand=holidays on a user | holidays:read |
Reading reason or statusReason on a leave or TOIL request | leaves:read-reason |
| Reading the name of a hidden leave type | leave-types:read-hidden |
Sending X-On-Behalf-Of | users:act-on-behalf |
| Endpoint | What it does | Scopes |
|---|
GET /v2/departments | List departments | departments:read |
POST /v2/departments | Create a department | departments:write |
GET /v2/departments/{id} | Get a department | departments:read |
PATCH /v2/departments/{id} | Update a department | departments:write |
DELETE /v2/departments/{id} | Delete a department | departments:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/locations | List locations | locations:read |
POST /v2/locations | Create a location | locations:write |
GET /v2/locations/{id} | Get a location | locations:read |
PATCH /v2/locations/{id} | Update a location | locations:write |
DELETE /v2/locations/{id} | Delete a location | locations:write |
GET /v2/locations/{id}/work-week | Get a location's work week | locations:read |
PUT /v2/locations/{id}/work-week | Replace a location's work week | locations:write |
GET /v2/locations/{id}/holidays | List a location's holidays | holidays:read |
POST /v2/locations/{id}/holidays | Create a holiday | holidays:write |
GET /v2/locations/{id}/holidays/{holidayId} | Get a holiday | holidays:read |
PATCH /v2/locations/{id}/holidays/{holidayId} | Update a holiday | holidays:write |
DELETE /v2/locations/{id}/holidays/{holidayId} | Delete a holiday | holidays:write |
GET /v2/locations/{id}/leave-policies | List a location's leave policies | leave-policies:read |
GET /v2/locations/{id}/leave-policies/{leaveTypeId} | Get a location's leave policy for a leave type | leave-policies:read |
PUT /v2/locations/{id}/leave-policies/{leaveTypeId} | Enable or replace a location's leave policy for a leave type | leave-policies:write |
PATCH /v2/locations/{id}/leave-policies/{leaveTypeId} | Change a location's leave policy for a leave type | leave-policies:write |
DELETE /v2/locations/{id}/leave-policies/{leaveTypeId} | Disable a location's leave policy for a leave type | leave-policies:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/labels | List labels | labels:read |
POST /v2/labels | Create a label | labels:write |
GET /v2/labels/{id} | Get a label | labels:read |
PATCH /v2/labels/{id} | Update a label | labels:write |
DELETE /v2/labels/{id} | Delete a label | labels:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/leave-types | List leave types | leave-types:read |
POST /v2/leave-types | Create a leave type | leave-types:write |
GET /v2/leave-types/{id} | Get a leave type | leave-types:read |
PATCH /v2/leave-types/{id} | Update a leave type | leave-types:write |
DELETE /v2/leave-types/{id} | Delete a leave type | leave-types:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/leaves | List leaves between two dates | leaves:read |
POST /v2/leaves | Create a leave | leaves:write |
GET /v2/leaves/{id} | Get a leave | leaves:read |
PATCH /v2/leaves/{id} | Update a leave | leaves:write |
DELETE /v2/leaves/{id} | Delete a leave | leaves:write |
POST /v2/leaves/{id}/approve | Approve a leave | leaves:approve |
POST /v2/leaves/{id}/deny | Deny a leave | leaves:approve |
POST /v2/leaves/{id}/cancel | Cancel a leave | leaves:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/toil | List TOIL requests between two dates | toil:read |
POST /v2/toil | Create a TOIL request | toil:write |
GET /v2/toil/{id} | Get a TOIL request | toil:read |
PATCH /v2/toil/{id} | Update a TOIL request | toil:write |
DELETE /v2/toil/{id} | Delete a TOIL request | toil:write |
POST /v2/toil/{id}/approve | Approve a TOIL request | leaves:approve |
POST /v2/toil/{id}/deny | Deny a TOIL request | leaves:approve |
POST /v2/toil/{id}/cancel | Cancel a TOIL request | toil:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/users | List users | users:read |
GET /v2/users/{id} | Get a user | users:read |
PATCH /v2/users/{id} | Update a user's profile | users:write |
GET /v2/users/{id}/balances | Get a user's leave balances | balances:read |
GET /v2/users/{id}/labels | List a user's labels | labels:read |
POST /v2/users/{id}/labels | Assign a label to a user | labels:write |
DELETE /v2/users/{id}/labels/{labelId} | Remove a label from a user | labels:write |
PUT /v2/users/{id}/location | Move a user to another location | users:write |
PUT /v2/users/{id}/department | Move a user to another department | users:write |
POST /v2/users/{id}/activate | Activate a user | users:write |
POST /v2/users/{id}/deactivate | Deactivate a user | users:write |
PUT /v2/users/{id}/location-admin | Make a user a Location Admin | users:write |
DELETE /v2/users/{id}/location-admin | Remove a user's Location Admin role | users:write |
PUT /v2/users/{id}/work-week | Set a user's custom work week | users:write |
DELETE /v2/users/{id}/work-week | Reset a user's work week | users:write |
GET /v2/users/{id}/quotas | Get a user's leave quotas | users:read |
PUT /v2/users/{id}/quotas/{leaveTypeId} | Set a user's quota for a leave type | users:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/automations/{type} | List automations of a type | automations:read |
POST /v2/automations/{type} | Create an automation | automations:write |
GET /v2/automations/{type}/{id} | Get an automation | automations:read |
PATCH /v2/automations/{type}/{id} | Update an automation | automations:write |
DELETE /v2/automations/{type}/{id} | Delete an automation | automations:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/notifications | List notifications | notifications:read |
POST /v2/notifications | Create a notification | notifications:write |
GET /v2/notifications/{id} | Get a notification | notifications:read |
PATCH /v2/notifications/{id} | Update a notification | notifications:write |
DELETE /v2/notifications/{id} | Delete a notification | notifications:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/scheduled-reports | List scheduled reports | notifications:read |
POST /v2/scheduled-reports | Create a scheduled report | notifications:write |
GET /v2/scheduled-reports/{id} | Get a scheduled report | notifications:read |
PATCH /v2/scheduled-reports/{id} | Update a scheduled report | notifications:write |
DELETE /v2/scheduled-reports/{id} | Delete a scheduled report | notifications:write |
| Endpoint | What it does | Scopes |
|---|
GET /v2/operations/{id} | Get an operation | Any valid key |
| Endpoint | What it does | Scopes |
|---|
GET /v2/webhooks | List webhooks | webhooks:read |
POST /v2/webhooks | Create a webhook | webhooks:write |
GET /v2/webhooks/{id} | Get a webhook | webhooks:read |
PATCH /v2/webhooks/{id} | Update a webhook | webhooks:write |
DELETE /v2/webhooks/{id} | Delete a webhook | webhooks:write |
POST /v2/webhooks/{id}/test | Send a test event | webhooks:write |
POST /v2/webhooks/{id}/rotate-secret | Rotate the signing secret | webhooks:write |
POST /v2/webhooks/{id}/pause | Pause a webhook | webhooks:write |
POST /v2/webhooks/{id}/resume | Resume a webhook | webhooks:write |