Leave types
The kinds of leave this business offers and how each builds up.
Needs the leave:read permission, depending on the operation. The business sees it as "Leave and balances".
Fields
| Field | Type | Access | Meaning |
|---|---|---|---|
| leave_type | string | Read-only | The key to send when submitting leave. |
| label | string, may be null | Read-only | The name staff see. |
| paid | boolean | Read-only | True when the leave is paid. |
| enabled | boolean | Read-only | False when the business has switched the leave type off. |
| accrual_rate_type | string, may be null | Read-only | How the leave builds up: fixed_per_year, per_hour_worked or unlimited. |
| accrual_rate_hours | number, may be null | Read-only | Hours a year, or hours per hour worked, depending on the rate type. |
| gating_mode | string, may be null | Read-only | strict_block when a request over the balance is refused, warn_only when it is allowed. |
Operations
List the leave types the business offers
GET/v1/leave-types
Permission: leave:read
{
"data": [
{
"leave_type": "text",
"label": "text",
"paid": true,
"enabled": true,
"accrual_rate_type": "text",
"accrual_rate_hours": 1.5,
"gating_mode": "text"
}
],
"has_more": true,
"next_cursor": "text"
}| Status | When |
|---|---|
| 400 | The error's code is invalid_request or range_too_long. The Errors page describes each code. |
| 401 | The error's code is invalid_token or token_expired. The Errors page describes each code. |
| 403 | The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code. |
| 404 | There is nothing at this address, or no such record in this business. |
| 429 | Too many requests. Retry-After says when to try again. |
| 500 | Something went wrong at Shiftly. Quote the request id. |
| 503 | This environment is not set up for partner apps yet. |
