Skip to content

Create a leave

The create-leave call posts a new leave request to /v2/leaves. It needs the leaves:write scope and returns the created leave with 201, or a 202 Accepted operation when creation outlasts the wait window. This guide explains how the acting user, the target user and the leave policy change what the endpoint does, and how to read the responses without guessing.

What the endpoint does

Send POST /v2/leaves with a JSON body containing the leave type, start date and end date. The endpoint waits for the leave to be created and answers 201 with the leave. If creation takes longer than the wait window, it answers 202 Accepted with an operation object; poll that operation until its status is SUCCEEDED or FAILED. The operation status UNKNOWN means no result arrived within 15 minutes, so the change may or may not have been applied — read the resource to check. A result that arrives later still moves the status to SUCCEEDED or FAILED.

Who the leave is for

There are two distinct modes, and they behave differently:

  • Self-request. Omit userId or set it to the acting user's own ID. The leave starts as OPEN (pending approval) unless the policy needs no approval, in which case it comes back APPROVED. Every rule of that user's leave policy applies, exactly as it would in the dashboard.
  • Manager-added leave. Set userId to another user's ID to add an already approved leave for someone the acting user manages. This also requires the leaves:approve scope, and the target must sit within the key's data reach. Only overlapping leaves, dates with no working days, and part-day leaves longer than a working day block it; the other policy rules are skipped.

The acting user is the key owner, or the user named in the X-On-Behalf-Of header — useful for filing a pending request in an employee's name.

Decision checklist before you send

  1. Confirm the key carries leaves:write. If you are adding for another user, confirm leaves:approve too.
  2. Decide whether this is a self-request or a manager-added leave; that choice sets the expected status and which policy rules apply.
  3. If you use X-On-Behalf-Of, confirm the key has users:act-on-behalf and the key owner manages the target user; otherwise expect 403 ON_BEHALF_OF_NOT_ALLOWED.
  4. Pick the leave type ID and the date range in YYYY-MM-DD form.
  5. For a part-day leave, set isFullDayLeave to false and supply startHour, startMinute, endHour and endMinute; for a full day, omit those four fields.
  6. Attach an Idempotency-Key if the request may be retried.

Request fields at a glance

Required: leaveTypeId, startDate, endDate. Optional: userId, isFullDayLeave (defaults to true), startHour, startMinute, endHour, endMinute, reason, substituteApproverId and overrideAutomations. Dates must match the YYYY-MM-DD pattern. Hours are in the user's time zone on a 24-hour clock: startHour 0–23, startMinute 0–59, endHour 0–24, endMinute 0–59. To end a part-day leave at midnight, send endHour 24 together with endMinute 0. If the leave type is booked in half days, the part-day span must match exactly half of the user's working hours for that day; on a day with no working hours configured, that half-day span is 4 hours. A reason may be empty, but some policies require one, and text that looks like HTML or script fails validation. substituteApproverId names the person who approves in the requester's place while they are away.

Automations: override or rejection

If the leave breaks an automation — a blackout period, a maximum number of users away, a probation period, a duration limit or a notice period — the request fails with 409 AUTOMATION_OVERRIDE_REQUIRED, and details.warnings lists each violation. When adding a leave for another user, repeat the request with every listed code in overrideAutomations to add it anyway. Overrides are not applied to the acting user's own requests: those are rejected with the matching 422 code — LEAVE_BLACKOUT_PERIOD, LEAVE_MAXIMUM_USERS_AWAY, LEAVE_PROBATION_PERIOD, LEAVE_DURATION_LIMIT or LEAVE_NOTICE_PERIOD. The overrideAutomations array accepts BLACKOUT_PERIOD, MAXIMUM_USERS_AWAY, PROBATION_PERIOD, LEAVE_DURATION_LIMIT and LEAVE_REQUEST_NOTICE_PERIOD, and every listed warning must be overridden.

Retries and idempotency

Idempotency-Key is optional and accepts 1 to 255 printable ASCII characters. A key stays valid for 24 hours, scoped to the API key that sent it. During that window, resending the same key with an identical request creates nothing new: the stored original response comes back, tagged with the Idempotent-Replayed header. Three failure cases are worth separating. If the key is reused but the request payload differs, the call fails with 422 IDEMPOTENCY_KEY_REUSED. If the first attempt is still executing when the retry arrives, the retry fails with 409 IDEMPOTENCY_REQUEST_IN_PROGRESS. If the key itself is malformed, the call fails with 400 INVALID_IDEMPOTENCY_KEY. For rate-limited writes, wait a few seconds and retry with the same Idempotency-Key.

Reading the responses

A 201 body wraps the created leave in data, with fields such as id, userId, status, durationCalendarDays, durationWorkingDays, startDate, endDate, isFullDayLeave, leaveTypeId, locationId, departmentId, reason, statusReason, approvedLevel and createdAt. The reason and statusReason values are null unless the key carries leaves:read-reason. An OPEN leave with approvedLevel FIRST is waiting for a second-level approver. A 202 body carries an operation with id, status and url; the Location header repeats that URL. Error responses share one envelope: error.code, error.name, error.description, error.resolution, error.requestId and optional error.details. Quote the requestId when contacting support.

Error codes to expect

400 VALIDATION_ERROR (details.fields lists the failing fields); 401 UNAUTHORIZED for a missing, malformed or unrecognized key; 403 INSUFFICIENT_SCOPE when leaves:approve is missing for another user's leave; 403 ON_BEHALF_OF_NOT_ALLOWED; 403 FORBIDDEN; 404 RESOURCE_NOT_FOUND when the user is outside the key's data reach or does not exist; 409 AUTOMATION_OVERRIDE_REQUIRED; and the 422 family: LEAVE_OVERLAP, LEAVE_NO_WORKING_DAYS, LEAVE_INVALID_DATE_RANGE, LEAVE_INVALID_DURATION, LEAVE_INVALID_HALF_DAY_DURATION, LEAVE_START_DATE_IN_PAST, LEAVE_NEGATIVE_BALANCE, LEAVE_REASON_REQUIRED, LEAVE_TYPE_INACTIVE, LEAVE_POLICY_MISSING, USER_NOT_EMPLOYED_ON_DATES, the automation codes above, and the Idempotency-Key codes. A 429 RATE_LIMITED response means too many requests were sent in a short time.

Self-request vs manager-added leave
AspectSelf-requestManager-added leave
userIdOmitted or the acting user's IDAnother user's ID
Extra scopeNone beyond leaves:writeleaves:approve
Initial statusOPEN unless the policy needs no approval, then APPROVEDAlready approved
Policy rulesEvery rule of the user's leave policy appliesOnly overlap, no-working-days and over-long part-day checks apply
Automation overrideNot applied; rejected with a matching 422 codeRepeat the request with every listed code in overrideAutomations

Behaviour depends on the acting user's management relationship and the key's data reach.

Full-day vs part-day payload
FieldFull-day leavePart-day leave
isFullDayLeavetrue (default)false
startHourOmitRequired, 0–23
startMinuteOmitRequired, 0–59
endHourOmitRequired, 0–24; use 24 with endMinute 0 to end at midnight
endMinuteOmitRequired, 0–59

Hours are interpreted in the user's time zone. Half-day leave types require exactly half the user's working hours that day.

Frequently asked questions

What happens if the leave is created but the response is delayed?

You get 202 Accepted with an operation object containing id, status and url. Poll that URL until the status is SUCCEEDED or FAILED. If the status shows UNKNOWN, no result arrived within 15 minutes; the change may or may not have been applied, so read the resource to check.

Why does adding a leave for another user fail with 409?

The leave breaks an automation such as a blackout period, maximum users away, probation period, duration limit or notice period. details.warnings lists each violation. Repeat the request with every listed code in overrideAutomations to add the leave anyway.

Can I override an automation on my own leave request?

No. Overrides are not applied to the acting user's own requests. Such a leave is rejected with the matching 422 code: LEAVE_BLACKOUT_PERIOD, LEAVE_MAXIMUM_USERS_AWAY, LEAVE_PROBATION_PERIOD, LEAVE_DURATION_LIMIT or LEAVE_NOTICE_PERIOD.

How do I make a retry safe?

Send an Idempotency-Key of 1 to 255 printable ASCII characters. Repeating the same key with the same request within 24 hours replays the original response with the Idempotent-Replayed header. A different request with the same key returns 422 IDEMPOTENCY_KEY_REUSED.

curl -X POST "$API_BASE_URL/v2/leaves" \
  -H "Authorization: Bearer " \
  -H "Content-Type: application/json" \
  -d '{
    "leaveTypeId": "leaveType-fcc1e5c5-ba93-479d-bd58-8f860ba10615",
    "startDate": "2026-11-09",
    "endDate": "2026-11-13",
    "reason": "Family trip"
  }'
{
  "data": {
    "id": "leaveRequest-cfe5d39b-f1f0-45aa-85cd-ce93e637a262",
    "userId": "user-63b17e97-d38b-4586-8498-bb4f5d2e2c14",
    "autoApproved": false,
    "durationCalendarDays": 5,
    "durationWorkingDays": 5,
    "startDate": "2026-11-09",
    "endDate": "2026-11-13",
    "isFullDayLeave": true,
    "leaveTypeId": "leaveType-fcc1e5c5-ba93-479d-bd58-8f860ba10615",
    "locationId": "location-79c77ac8-e5bf-479f-9488-648a58379ff1",
    "departmentId": "team-0a21c25e-6925-4a5b-90ee-ecf82096c4f6",
    "status": "OPEN",
    "reason": "Family trip",
    "statusReason": null,
    "approvedLevel": null,
    "createdAt": "2026-10-01T09:12:40.062Z"
  }
}
{
  "operation": {
    "id": "pa_3f1c2b9e-8a47-4d5e-9c61-2b7f0e4a1d93",
    "status": "PENDING",
    "url": "/v2/operations/pa_3f1c2b9e-8a47-4d5e-9c61-2b7f0e4a1d93"
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "name": "ValidationError",
    "description": "Example post details.",
    "resolution": "Fix the fields listed in details.fields and send the request again.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
    "details": {
      "fields": [
        {
          "path": "startDate",
          "message": "\"startDate\" is required"
        }
      ]
    }
  }
}
{
  "error": {
    "code": "UNAUTHORIZED",
    "name": "Unauthorized",
    "description": "Example post details.",
    "resolution": "Send a valid API key in the Authorization header as Bearer followed by the full vt_live_ key.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "INSUFFICIENT_SCOPE",
    "name": "InsufficientScope",
    "description": "Example post details.",
    "resolution": "Add the scopes listed in details.requiredScopes to the key in the OnlyLeave dashboard.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
    "details": {
      "requiredScopes": [
        "leaves:write"
      ]
    }
  }
}
{
  "error": {
    "code": "RESOURCE_NOT_FOUND",
    "name": "ResourceNotFound",
    "description": "Example post details.",
    "resolution": "Check the ID of the resource named in details.resource and that the key owner can see it.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "CONFLICT",
    "name": "Conflict",
    "description": "Example post details.",
    "resolution": "Read the resource again and retry with up-to-date values.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "LEAVE_NEGATIVE_BALANCE",
    "name": "LeaveNegativeBalance",
    "description": "Example post details.",
    "resolution": "Shorten the leave, use a different leave type, or ask an admin to adjust the quota.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "name": "RateLimited",
    "description": "Example post details.",
    "resolution": "Wait a few seconds and retry, using the same Idempotency-Key for writes.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}
{
  "error": {
    "code": "INTERNAL_ERROR",
    "name": "InternalError",
    "description": "Example post details.",
    "resolution": "Retry later, and if it keeps happening, contact OnlyLeave support and quote the requestId.",
    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef"
  }
}

Idempotency-Key

FieldTypeRequiredDescriptionConstraints
Idempotency-KeystringNooptional key (1 to 255 printable ASCII characters) that makes a write request safe to retry. Keys are retained for 24 hours per API key. Retrying with the same key and the same request within those 24 hours replays the original response (with the Idempotent-Replayed header). Reusing the key with a different request returns 422 IDEMPOTENCY_KEY_REUSED ; retrying while the first request is still running returns 409 IDEMPOTENCY_REQUEST_IN_PROGRESS ; an invalid key returns 400 INVALID_IDEMPOTENCY_KEY .1 <= length <= 255

X-On-Behalf-Of

FieldTypeRequiredDescriptionConstraints
X-On-Behalf-OfstringNoID of the user the write is performed for. Requires the users:act-on-behalf scope, and the key owner must manage the target user; otherwise the request fails with 403 ON_BEHALF_OF_NOT_ALLOWED . Ignored on GET requests.

body

FieldTypeRequiredDescriptionConstraints
bodyobjectYes
body.userIdstringNoomit (or send your own ID) to request a leave for yourself; set to another user's ID to add an approved leave for a user you manage (requires the leaves:approve scope)
body.leaveTypeIdstringYesthe ID of the leave type
body.startDatestringYesdate in YYYY-MM-DD format^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$
date
body.endDatestringYesdate in YYYY-MM-DD format^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$
date
body.isFullDayLeavebooleanNotrue for a full day leave (1 or multiple days), false for a part day leave. When false, startHour, startMinute, endHour and endMinute are required; when true they must be omitted.true
body.startHourintegerNostart hour in the user's time zone (24h format), only for a part day leave0 <= value <= 23
body.startMinuteintegerNostart minutes in the user's time zone, only for a part day leave0 <= value <= 59
body.endHourintegerNoend hour in the user's time zone (24h format), only for a part day leave. Use 24 with endMinute 0 for a leave that ends at midnight. On a leave type booked in half days, the leave must last exactly half of the user's working hours on that day (4 hours on a day without working hours).0 <= value <= 24
body.endMinuteintegerNoend minutes in the user's time zone, only for a part day leave0 <= value <= 59
body.reasonstringNothe reason for the leave, may be empty; some leave policies require it. Text that looks like HTML or script fails validation.
body.substituteApproverIdstringNothe ID of the user who approves leaves in your place while you are away
body.overrideAutomationsarray<string>Noautomation warning codes to override when adding a leave for another user, as listed in details.warnings of a 409 AUTOMATION_OVERRIDE_REQUIRED error. Every listed warning must be overridden. Not applied to the acting user's own leave requests.
body.overrideAutomations[]string"BLACKOUT_PERIOD" | "MAXIMUM_USERS_AWAY" | "PROBATION_PERIOD" | "LEAVE_DURATION_LIMIT" | "LEAVE_REQUEST_NOTICE_PERIOD"

response

FieldTypeRequiredDescriptionConstraints
responseobject
response.dataobjectNo
response.data.idstringYesleave ID
response.data.userIdstringYesan ID of the user on leave
response.data.approverIdstringNoan ID of the approver, only when the leave request is approved; absent otherwise
response.data.autoApprovedbooleanNois the leave request automatically approved or not
response.data.durationCalendarDaysnumberYesthe duration of a leave in calendar days
response.data.durationWorkingDaysnumberYesthe duration of a leave in working/business days
response.data.startDatestringYesdate in YYYY-MM-DD formatFormat: date
response.data.endDatestringYesdate in YYYY-MM-DD formatFormat: date
response.data.isFullDayLeavebooleanYestrue if the leave is a full day leave (1 or multiple days), or false if it is a part day leave (half day or hourly)
response.data.startHournumberNostart hour in the user's time zone (in 24h format) for the part day leave, returned only when isFullDayLeave is false
response.data.endHournumberNoend hour in the user's time zone (in 24h format) for the part day leave, returned only when isFullDayLeave is false
response.data.startMinutenumberNostart minutes in the user's time zone for the part day leave, returned only when isFullDayLeave is false
response.data.endMinutenumberNoend minutes in the user's time zone for the part day leave, returned only when isFullDayLeave is false
response.data.leaveTypeIdstringYesthe ID of the leave type of the leave
response.data.locationIdstringYesthe ID of the user's location when the leave request was sent
response.data.departmentIdstringYesthe ID of the user's department when the leave request was sent
response.data.statusstringYesleave request statusAllowed values: "APPROVED" | "OPEN" | "DENIED" | "CANCELLED" | "EXPIRED" | "DELETED"
response.data.reasonstring | nullYesthe reason the user gave for the leave, an empty string when none was given. Requires the leaves:read-reason scope; without it the value is null .
response.data.reason[variant1]stringthe reason the user gave for the leave, an empty string when none was given. Requires the leaves:read-reason scope; without it the value is null .
response.data.reason[variant2]nullthe reason the user gave for the leave, an empty string when none was given. Requires the leaves:read-reason scope; without it the value is null .
response.data.statusReasonstring | nullYesthe reason given when the leave was denied or cancelled, null when none was given. Requires the leaves:read-reason scope; without it the value is null .
response.data.statusReason[variant1]stringthe reason given when the leave was denied or cancelled, null when none was given. Requires the leaves:read-reason scope; without it the value is null .
response.data.statusReason[variant2]nullthe reason given when the leave was denied or cancelled, null when none was given. Requires the leaves:read-reason scope; without it the value is null .
response.data.approvedLevelstring | nullYesthe approval level reached in a department with multi-level approval, null otherwise. An OPEN leave with approvedLevel FIRST is waiting for the second-level approver."FIRST" | "SECOND" | "THIRD" | null
response.data.approvedLevel[variant1]stringthe approval level reached in a department with multi-level approval, null otherwise. An OPEN leave with approvedLevel FIRST is waiting for the second-level approver."FIRST" | "SECOND" | "THIRD" | null
response.data.approvedLevel[variant2]nullthe approval level reached in a department with multi-level approval, null otherwise. An OPEN leave with approvedLevel FIRST is waiting for the second-level approver."FIRST" | "SECOND" | "THIRD" | null
response.data.createdAtstringYesa timestamp in the ISO 8601 formatdate-time
response.data.userobjectNothe user on leave (only when expand includes user)
response.data.user.idstringYesuser ID
response.data.user.namestringYesuser name
response.data.user.emailstringYesuser email
response.data.user.isAdminbooleanYesa boolean that tells you if the selected user is an admin
response.data.user.locationIdstring | nullYesthe ID of the user's location, null when the user has none yet
response.data.user.locationId[variant1]stringthe ID of the user's location, null when the user has none yet
response.data.user.locationId[variant2]nullthe ID of the user's location, null when the user has none yet
response.data.user.departmentIdstring | nullYesthe ID of the user's department, null when the user has none yet
response.data.user.departmentId[variant1]stringthe ID of the user's department, null when the user has none yet
response.data.user.departmentId[variant2]nullthe ID of the user's department, null when the user has none yet
response.data.user.statusstringYesuser status"ACTIVE" | "INACTIVE" | "DELETED"
response.data.user.employeeIdstring | nullYesthe employee ID set on the user profile page, null when it is not set
response.data.user.employeeId[variant1]stringthe employee ID set on the user profile page, null when it is not set
response.data.user.employeeId[variant2]nullthe employee ID set on the user profile page, null when it is not set
response.data.user.startDatestring | nullYesemployment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.user.startDate[variant1]stringemployment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.user.startDate[variant2]nullemployment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.user.endDatestring | nullYesemployment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.user.endDate[variant1]stringemployment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.user.endDate[variant2]nullemployment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.user.labelsarray<object>Yeslabels assigned to the user
response.data.user.labels[]object
response.data.user.labels[].idstringYes
response.data.user.labels[].namestringYes
response.data.user.labels[].colorstringYes
response.data.user.locationobjectNothe user's location (only when expand includes location)
response.data.user.location.idstringYeslocation ID
response.data.user.location.namestringYeslocation name
response.data.user.location.timezonestringNothe location's IANA time zone, left out when none is stored
response.data.user.location.isDefaultbooleanYeswhether this is the company's default location
response.data.user.location.createdAtstringYesa timestamp in the ISO 8601 formatdate-time
response.data.user.departmentobjectNothe user's department (only when expand includes department)
response.data.user.department.idstringYesdepartment ID
response.data.user.department.namestringYesdepartment name
response.data.user.department.isDefaultbooleanYeswhether this is the company's default department
response.data.user.department.createdAtstringYesa timestamp in the ISO 8601 formatdate-time
response.data.user.holidaysarray<HolidayYear>Nopublic holidays for the user's location, grouped by year (only when expand includes holidays)
response.data.user.holidays[]object
response.data.user.holidays[].yearintegerNothe year for the holidays
response.data.user.holidays[].holidaysarray<object>No
response.data.user.holidays[].holidays[]object
response.data.user.holidays[].holidays[].idstringNoholiday ID
response.data.user.holidays[].holidays[].namestringNoholiday name
response.data.user.holidays[].holidays[].datestringNodate in YYYY-MM-DD formatdate
response.data.user.holidays[].holidays[].isHalfDaybooleanNowhether it is a half-day holiday
response.data.approverobjectNothe approver, including location and department (only when expand includes approver)
response.data.approver.idstringYesuser ID
response.data.approver.namestringYesuser name
response.data.approver.emailstringYesuser email
response.data.approver.isAdminbooleanYesa boolean that tells you if the selected user is an admin
response.data.approver.locationIdstring | nullYesthe ID of the user's location, null when the user has none yet
response.data.approver.locationId[variant1]stringthe ID of the user's location, null when the user has none yet
response.data.approver.locationId[variant2]nullthe ID of the user's location, null when the user has none yet
response.data.approver.departmentIdstring | nullYesthe ID of the user's department, null when the user has none yet
response.data.approver.departmentId[variant1]stringthe ID of the user's department, null when the user has none yet
response.data.approver.departmentId[variant2]nullthe ID of the user's department, null when the user has none yet
response.data.approver.statusstringYesuser status"ACTIVE" | "INACTIVE" | "DELETED"
response.data.approver.employeeIdstring | nullYesthe employee ID set on the user profile page, null when it is not set
response.data.approver.employeeId[variant1]stringthe employee ID set on the user profile page, null when it is not set
response.data.approver.employeeId[variant2]nullthe employee ID set on the user profile page, null when it is not set
response.data.approver.startDatestring | nullYesemployment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.approver.startDate[variant1]stringemployment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.approver.startDate[variant2]nullemployment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.approver.endDatestring | nullYesemployment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.approver.endDate[variant1]stringemployment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.approver.endDate[variant2]nullemployment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set
response.data.approver.labelsarray<object>Yeslabels assigned to the user
response.data.approver.labels[]object
response.data.approver.labels[].idstringYes
response.data.approver.labels[].namestringYes
response.data.approver.labels[].colorstringYes
response.data.approver.locationobjectNothe user's location (only when expand includes location)
response.data.approver.location.idstringYeslocation ID
response.data.approver.location.namestringYeslocation name
response.data.approver.location.timezonestringNothe location's IANA time zone, left out when none is stored
response.data.approver.location.isDefaultbooleanYeswhether this is the company's default location
response.data.approver.location.createdAtstringYesa timestamp in the ISO 8601 formatdate-time
response.data.approver.departmentobjectNothe user's department (only when expand includes department)
response.data.approver.department.idstringYesdepartment ID
response.data.approver.department.namestringYesdepartment name
response.data.approver.department.isDefaultbooleanYeswhether this is the company's default department
response.data.approver.department.createdAtstringYesa timestamp in the ISO 8601 formatdate-time
response.data.approver.holidaysarray<HolidayYear>Nopublic holidays for the user's location, grouped by year (only when expand includes holidays)
response.data.approver.holidays[]object
response.data.approver.holidays[].yearintegerNothe year for the holidays
response.data.approver.holidays[].holidaysarray<object>No
response.data.approver.holidays[].holidays[]object
response.data.approver.holidays[].holidays[].idstringNoholiday ID
response.data.approver.holidays[].holidays[].namestringNoholiday name
response.data.approver.holidays[].holidays[].datestringNodate in YYYY-MM-DD formatdate
response.data.approver.holidays[].holidays[].isHalfDaybooleanNowhether it is a half-day holiday
response.data.leaveTypeobjectNothe leave type (only when expand includes leaveType)
response.data.leaveType.idstringYes
response.data.leaveType.namestringYes
response.data.leaveType.isDefaultbooleanYes

response

FieldTypeRequiredDescriptionConstraints
responseobjectReturned with HTTP 202 when a write operation is still running, or succeeded but its result could not be read back yet. The Location header carries the same URL as operation.url . Poll it until the status is SUCCEEDED or FAILED .
response.operationobjectYes
response.operation.idstringYes
response.operation.statusstringYesoperation status. UNKNOWN means no result arrived within 15 minutes; the change may or may not have been applied, so read the resource to check. A result that arrives later still changes it to SUCCEEDED or FAILED.Allowed values: "PENDING" | "SUCCEEDED" | "FAILED" | "UNKNOWN"
response.operation.urlstringYes

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo

response

FieldTypeRequiredDescriptionConstraints
responseobjectError envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog .
response.errorobjectYes
response.error.codestringYesstable machine-readable error code
response.error.namestringYesshort human-readable error name
response.error.descriptionstringYeswhat went wrong
response.error.resolutionstringYeshow to fix the problem
response.error.requestIdstringYesrequest ID, include it when contacting support
response.error.detailsobjectNooptional additional information specific to the error code
response.error.details.[key: string]anyNo