Skip to content
ShiftlyDevelopers
Documentation menu

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

LeaveType fields
FieldTypeAccessMeaning
leave_typestringRead-onlyThe key to send when submitting leave.
labelstring, may be nullRead-onlyThe name staff see.
paidbooleanRead-onlyTrue when the leave is paid.
enabledbooleanRead-onlyFalse when the business has switched the leave type off.
accrual_rate_typestring, may be nullRead-onlyHow the leave builds up: fixed_per_year, per_hour_worked or unlimited.
accrual_rate_hoursnumber, may be nullRead-onlyHours a year, or hours per hour worked, depending on the rate type.
gating_modestring, may be nullRead-onlystrict_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

200 response
{
  "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"
}
Refusals
StatusWhen
400The error's code is invalid_request or range_too_long. The Errors page describes each code.
401The error's code is invalid_token or token_expired. The Errors page describes each code.
403The error's code is origin_not_allowed, permission_denied, not_available, connection_disconnected, connection_suspended or app_suspended. The Errors page describes each code.
404There is nothing at this address, or no such record in this business.
429Too many requests. Retry-After says when to try again.
500Something went wrong at Shiftly. Quote the request id.
503This environment is not set up for partner apps yet.