Update a leave
Use this method to change an existing leave that is still OPEN or APPROVED. The call is a partial update: you send only the properties you want to change, and the server merges them into the leave's current state. The request needs the leaves:write scope. When the change finishes in time, the response is 200 with the updated leave; when it is still running, the response is 202 with an operation you can poll.
Method, route and authorization
The method is PATCH and the path is /v2/leaves/{id}. The id path parameter is required and identifies the leave. Authentication uses a bearer token in the Authorization header, and the key must carry leaves:write. The key owner's role still limits what the key can do, so a valid key with the right scope can still be refused if the acting user may not touch that leave. An optional X-On-Behalf-Of header names the user the write is performed for. That header only works when the key also holds users:act-on-behalf and the key owner manages the named user; if either condition fails, the call returns 403 ON_BEHALF_OF_NOT_ALLOWED. The header has no effect on GET requests.
Partial update and merge behavior
At least one body field is required. Anything you leave out keeps its stored value, including the substitute approver. This matters when you change only the end date of a leave that already has a substitute approver set: the approver stays in place unless you send substituteApproverId explicitly. The acting user can edit their own leaves or the leaves of users they manage. Editing your own leave applies every rule of the leave policy, just as the dashboard does. Editing someone else's leave is narrower: only overlapping leaves, dates with no working days, and part-day leaves longer than a working day block the change.
Full-day and part-day conversion
isFullDayLeave controls the shape of the leave. Setting it to true makes the leave a full-day leave, and the four time fields must then be omitted. Setting it to false, or sending any time field for a leave that is currently full-day, converts it to a part-day leave; in that case all four time fields are required, whether you send them or they are already stored. The four fields are startHour, startMinute, endHour and endMinute, all expressed in the user's time zone. startHour accepts 0 through 23, startMinute and endMinute accept 0 through 59, and endHour accepts 0 through 24. A leave that runs to midnight is expressed as endHour 24 with endMinute 0. When the leave type is booked in half days, the part-day leave must equal exactly half of the user's working hours for that day; on a day with no working hours, that half-day figure is 4 hours.
Request body fields
All ten body properties are optional individually, but the body must contain at least one of them. leaveTypeId is a string naming the leave type. startDate and endDate are strings in YYYY-MM-DD format. isFullDayLeave is a boolean. startHour, startMinute, endHour and endMinute are integers in the user's time zone. reason is a string that may be empty; text that looks like HTML or script fails validation. substituteApproverId is a string naming the user who approves leaves in your place while you are away. The request body is application/json, and the supplied TypeScript definition is available for the body type.
Retrying safely with Idempotency-Key
The optional Idempotency-Key header takes 1 to 255 printable ASCII characters. Each key is remembered for 24 hours under the API key that sent it. If you resend the identical request with the same key inside that window, you get the original response back, marked with the Idempotent-Replayed header, instead of a second change. Three failure cases are worth separating. Sending the same key with a different request body or parameters returns 422 IDEMPOTENCY_KEY_REUSED. Sending it again while the first request is still running returns 409 IDEMPOTENCY_REQUEST_IN_PROGRESS, so wait rather than switching keys. A key that is empty, too long or contains non-printable characters returns 400 INVALID_IDEMPOTENCY_KEY.
Responses: 200, 202 and the operation envelope
A 200 response returns the updated leave in a data object. The leave carries id, userId, approverId, autoApproved, durationCalendarDays, durationWorkingDays, startDate, endDate, isFullDayLeave, leaveTypeId, locationId, departmentId, status, reason, statusReason, approvedLevel and createdAt. The time fields appear only when isFullDayLeave is false. reason requires the leaves:read-reason scope; without it the value is null. A 202 response returns an operation object with id, status and url. The Location header carries the same URL. Poll that URL until status is SUCCEEDED or FAILED. UNKNOWN means no result arrived within 15 minutes; the change may or may not have been applied, so read the leave to check. A result that arrives later still changes status to SUCCEEDED or FAILED.
Error codes and how to tell them apart
400 VALIDATION_ERROR lists offending fields in details.fields. 403 ON_BEHALF_OF_NOT_ALLOWED means the on-behalf-of header was rejected. 403 FORBIDDEN means the acting user may not perform the action. 404 RESOURCE_NOT_FOUND means the leave does not exist or is outside the key's data reach. 409 AUTOMATION_OVERRIDE_REQUIRED means the change breaks an automation; details.warnings explains why, and overrides are not accepted when updating a leave. The 422 family covers status and policy problems: LEAVE_REQUEST_NOT_EDITABLE, 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 and USER_NOT_EMPLOYED_ON_DATES. The Idempotency-Key codes are also possible. A 429 RATE_LIMITED response should be retried after a short wait, reusing the same Idempotency-Key. A 500 INTERNAL_ERROR should be retried later; quote the requestId when contacting support. The error envelope always carries code, name, description, resolution and requestId, with optional details.
| Field | Type | Requirement | Notes |
|---|---|---|---|
| leaveTypeId | string | optional | the ID of the leave type |
| startDate | string | optional | date in YYYY-MM-DD format |
| endDate | string | optional | date in YYYY-MM-DD format |
| isFullDayLeave | boolean | optional | true for full-day; false for part-day |
| startHour | integer | optional | 0-23, part-day only |
| startMinute | integer | optional | 0-59, part-day only |
| endHour | integer | optional | 0-24, part-day only; 24 with endMinute 0 means midnight |
| endMinute | integer | optional | 0-59, part-day only |
| reason | string | optional | may be empty; HTML or script text fails validation |
| substituteApproverId | string | optional | the user who approves leaves in your place while you are away |
All ten fields are optional individually; at least one must be sent. Time fields are required when the leave is part-day, whether sent or already stored.
| Status | Code | What it means | First action |
|---|---|---|---|
| 400 | VALIDATION_ERROR | A field or header failed validation | Fix the paths in details.fields and resend |
| 400 | INVALID_IDEMPOTENCY_KEY | The Idempotency-Key is invalid | Use 1-255 printable ASCII characters |
| 403 | ON_BEHALF_OF_NOT_ALLOWED | The on-behalf-of header was rejected | Check the users:act-on-behalf scope and that the key owner manages the target user |
| 403 | FORBIDDEN | The acting user may not perform the action | Confirm the acting user can edit this leave |
| 404 | RESOURCE_NOT_FOUND | The leave does not exist or is outside the key's data reach | Check the id and the key's data reach |
| 409 | AUTOMATION_OVERRIDE_REQUIRED | The change breaks an automation | Review details.warnings; overrides are not accepted here |
| 409 | IDEMPOTENCY_REQUEST_IN_PROGRESS | The first request with this key is still running | Wait and retry with the same key |
| 422 | LEAVE_REQUEST_NOT_EDITABLE | The leave is not in an editable state | Only OPEN or APPROVED leaves can be changed |
| 422 | IDEMPOTENCY_KEY_REUSED | The key was used with a different request | Use a fresh key for a different request |
| 429 | RATE_LIMITED | Too many requests were sent in a short time | Wait a few seconds and retry with the same Idempotency-Key |
| 500 | INTERNAL_ERROR | Something went wrong on the server side | Retry later; quote the requestId if it persists |
The 422 family also includes 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 and USER_NOT_EMPLOYED_ON_DATES.
Frequently asked questions
Which leave statuses can this method change?
Only leaves that are OPEN or APPROVED. A leave that has already been approved, denied or cancelled in a way that makes it non-editable returns 422 LEAVE_REQUEST_NOT_EDITABLE.
What happens to fields I do not send?
They keep their current stored value. The update is merged into the leave's existing state, including the substitute approver. You must send at least one field.
How do I turn a full-day leave into a part-day leave?
Send isFullDayLeave: false, or send any time field. The leave becomes part-day and all four time fields must be present, either in your request or already stored. If you send isFullDayLeave: true instead, the time fields must be omitted.
What should I do with a 202 response?
Poll the operation URL until status is SUCCEEDED or FAILED. If status is UNKNOWN, no result arrived within 15 minutes and the change may or may not have been applied, so read the leave to check. A later result still updates the status.
Can I override an automation when updating a leave?
No. A change that breaks an automation fails with 409 AUTOMATION_OVERRIDE_REQUIRED, and details.warnings explains what was triggered. Overrides are not accepted on this method.
Where can I get help?
Contact the developer support channel listed on the documentation site and quote the requestId from the error envelope.
curl -X PATCH "$API_BASE_URL/v2/leaves/string" \
-H "Authorization: Bearer " \
-H "Content-Type: application/json" \
-d '{
"endDate": "2026-11-16",
"reason": "Family trip, one extra day"
}'{
"data": {
"id": "leaveRequest-cfe5d39b-f1f0-45aa-85cd-ce93e637a262",
"userId": "user-63b17e97-d38b-4586-8498-bb4f5d2e2c14",
"approverId": "user-0f3a9c1e-6c2b-4a5d-9e7f-1b2c3d4e5f60",
"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": "APPROVED",
"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"
}
}id
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| id | string | Yes | resource ID. |
Idempotency-Key
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| Idempotency-Key | string | No | optional 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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| X-On-Behalf-Of | string | No | ID 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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| body | object | Yes | 1 <= properties | |
| body.leaveTypeId | string | No | the ID of the leave type | |
| body.startDate | string | No | date in YYYY-MM-DD format | ^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$ Format: date |
| body.endDate | string | No | date in YYYY-MM-DD format | ^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$ Format: date |
| body.isFullDayLeave | boolean | No | true for a full day leave, false for a part day leave. When false, startHour, startMinute, endHour and endMinute are required; when true they must be omitted. | |
| body.startHour | integer | No | start hour in the user's time zone (24h format), only for a part day leave | 0 <= value <= 23 |
| body.startMinute | integer | No | start minutes in the user's time zone, only for a part day leave | 0 <= value <= 59 |
| body.endHour | integer | No | end 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.endMinute | integer | No | end minutes in the user's time zone, only for a part day leave | 0 <= value <= 59 |
| body.reason | string | No | the reason for the leave, may be empty. Text that looks like HTML or script fails validation. | |
| body.substituteApproverId | string | No | the ID of the user who approves leaves in your place while you are away |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | |||
| response.data | object | No | ||
| response.data.id | string | Yes | leave ID | |
| response.data.userId | string | Yes | an ID of the user on leave | |
| response.data.approverId | string | No | an ID of the approver, only when the leave request is approved; absent otherwise | |
| response.data.autoApproved | boolean | No | is the leave request automatically approved or not | |
| response.data.durationCalendarDays | number | Yes | the duration of a leave in calendar days | |
| response.data.durationWorkingDays | number | Yes | the duration of a leave in working/business days | |
| response.data.startDate | string | Yes | date in YYYY-MM-DD format | Format: date |
| response.data.endDate | string | Yes | date in YYYY-MM-DD format | Format: date |
| response.data.isFullDayLeave | boolean | Yes | true 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.startHour | number | No | start hour in the user's time zone (in 24h format) for the part day leave, returned only when isFullDayLeave is false | |
| response.data.endHour | number | No | end hour in the user's time zone (in 24h format) for the part day leave, returned only when isFullDayLeave is false | |
| response.data.startMinute | number | No | start minutes in the user's time zone for the part day leave, returned only when isFullDayLeave is false | |
| response.data.endMinute | number | No | end minutes in the user's time zone for the part day leave, returned only when isFullDayLeave is false | |
| response.data.leaveTypeId | string | Yes | the ID of the leave type of the leave | |
| response.data.locationId | string | Yes | the ID of the user's location when the leave request was sent | |
| response.data.departmentId | string | Yes | the ID of the user's department when the leave request was sent | |
| response.data.status | string | Yes | leave request status | Allowed values: "APPROVED" | "OPEN" | "DENIED" | "CANCELLED" | "EXPIRED" | "DELETED" |
| response.data.reason | string | null | Yes | the 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] | string | the 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] | null | the 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.statusReason | string | null | Yes | the 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] | string | the 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] | null | the 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.approvedLevel | string | null | Yes | the 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] | string | the 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] | null | the 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.createdAt | string | Yes | a timestamp in the ISO 8601 format | date-time |
| response.data.user | object | No | the user on leave (only when expand includes user) | |
| response.data.user.id | string | Yes | user ID | |
| response.data.user.name | string | Yes | user name | |
| response.data.user.email | string | Yes | user email | |
| response.data.user.isAdmin | boolean | Yes | a boolean that tells you if the selected user is an admin | |
| response.data.user.locationId | string | null | Yes | the ID of the user's location, null when the user has none yet | |
| response.data.user.locationId[variant1] | string | the ID of the user's location, null when the user has none yet | ||
| response.data.user.locationId[variant2] | null | the ID of the user's location, null when the user has none yet | ||
| response.data.user.departmentId | string | null | Yes | the ID of the user's department, null when the user has none yet | |
| response.data.user.departmentId[variant1] | string | the ID of the user's department, null when the user has none yet | ||
| response.data.user.departmentId[variant2] | null | the ID of the user's department, null when the user has none yet | ||
| response.data.user.status | string | Yes | user status | "ACTIVE" | "INACTIVE" | "DELETED" |
| response.data.user.employeeId | string | null | Yes | the employee ID set on the user profile page, null when it is not set | |
| response.data.user.employeeId[variant1] | string | the employee ID set on the user profile page, null when it is not set | ||
| response.data.user.employeeId[variant2] | null | the employee ID set on the user profile page, null when it is not set | ||
| response.data.user.startDate | string | null | Yes | employment 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] | string | employment 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] | null | employment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set | ||
| response.data.user.endDate | string | null | Yes | employment 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] | string | employment 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] | null | employment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set | ||
| response.data.user.labels | array<object> | Yes | labels assigned to the user | |
| response.data.user.labels[] | object | |||
| response.data.user.labels[].id | string | Yes | ||
| response.data.user.labels[].name | string | Yes | ||
| response.data.user.labels[].color | string | Yes | ||
| response.data.user.location | object | No | the user's location (only when expand includes location) | |
| response.data.user.location.id | string | Yes | location ID | |
| response.data.user.location.name | string | Yes | location name | |
| response.data.user.location.timezone | string | No | the location's IANA time zone, left out when none is stored | |
| response.data.user.location.isDefault | boolean | Yes | whether this is the company's default location | |
| response.data.user.location.createdAt | string | Yes | a timestamp in the ISO 8601 format | date-time |
| response.data.user.department | object | No | the user's department (only when expand includes department) | |
| response.data.user.department.id | string | Yes | department ID | |
| response.data.user.department.name | string | Yes | department name | |
| response.data.user.department.isDefault | boolean | Yes | whether this is the company's default department | |
| response.data.user.department.createdAt | string | Yes | a timestamp in the ISO 8601 format | date-time |
| response.data.user.holidays | array<HolidayYear> | No | public holidays for the user's location, grouped by year (only when expand includes holidays) | |
| response.data.user.holidays[] | object | |||
| response.data.user.holidays[].year | integer | No | the year for the holidays | |
| response.data.user.holidays[].holidays | array<object> | No | ||
| response.data.user.holidays[].holidays[] | object | |||
| response.data.user.holidays[].holidays[].id | string | No | holiday ID | |
| response.data.user.holidays[].holidays[].name | string | No | holiday name | |
| response.data.user.holidays[].holidays[].date | string | No | date in YYYY-MM-DD format | date |
| response.data.user.holidays[].holidays[].isHalfDay | boolean | No | whether it is a half-day holiday | |
| response.data.approver | object | No | the approver, including location and department (only when expand includes approver) | |
| response.data.approver.id | string | Yes | user ID | |
| response.data.approver.name | string | Yes | user name | |
| response.data.approver.email | string | Yes | user email | |
| response.data.approver.isAdmin | boolean | Yes | a boolean that tells you if the selected user is an admin | |
| response.data.approver.locationId | string | null | Yes | the ID of the user's location, null when the user has none yet | |
| response.data.approver.locationId[variant1] | string | the ID of the user's location, null when the user has none yet | ||
| response.data.approver.locationId[variant2] | null | the ID of the user's location, null when the user has none yet | ||
| response.data.approver.departmentId | string | null | Yes | the ID of the user's department, null when the user has none yet | |
| response.data.approver.departmentId[variant1] | string | the ID of the user's department, null when the user has none yet | ||
| response.data.approver.departmentId[variant2] | null | the ID of the user's department, null when the user has none yet | ||
| response.data.approver.status | string | Yes | user status | "ACTIVE" | "INACTIVE" | "DELETED" |
| response.data.approver.employeeId | string | null | Yes | the employee ID set on the user profile page, null when it is not set | |
| response.data.approver.employeeId[variant1] | string | the employee ID set on the user profile page, null when it is not set | ||
| response.data.approver.employeeId[variant2] | null | the employee ID set on the user profile page, null when it is not set | ||
| response.data.approver.startDate | string | null | Yes | employment 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] | string | employment 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] | null | employment start date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set | ||
| response.data.approver.endDate | string | null | Yes | employment 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] | string | employment 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] | null | employment end date as stored, an ISO 8601 date or timestamp (the same value v1 returns), null when it is not set | ||
| response.data.approver.labels | array<object> | Yes | labels assigned to the user | |
| response.data.approver.labels[] | object | |||
| response.data.approver.labels[].id | string | Yes | ||
| response.data.approver.labels[].name | string | Yes | ||
| response.data.approver.labels[].color | string | Yes | ||
| response.data.approver.location | object | No | the user's location (only when expand includes location) | |
| response.data.approver.location.id | string | Yes | location ID | |
| response.data.approver.location.name | string | Yes | location name | |
| response.data.approver.location.timezone | string | No | the location's IANA time zone, left out when none is stored | |
| response.data.approver.location.isDefault | boolean | Yes | whether this is the company's default location | |
| response.data.approver.location.createdAt | string | Yes | a timestamp in the ISO 8601 format | date-time |
| response.data.approver.department | object | No | the user's department (only when expand includes department) | |
| response.data.approver.department.id | string | Yes | department ID | |
| response.data.approver.department.name | string | Yes | department name | |
| response.data.approver.department.isDefault | boolean | Yes | whether this is the company's default department | |
| response.data.approver.department.createdAt | string | Yes | a timestamp in the ISO 8601 format | date-time |
| response.data.approver.holidays | array<HolidayYear> | No | public holidays for the user's location, grouped by year (only when expand includes holidays) | |
| response.data.approver.holidays[] | object | |||
| response.data.approver.holidays[].year | integer | No | the year for the holidays | |
| response.data.approver.holidays[].holidays | array<object> | No | ||
| response.data.approver.holidays[].holidays[] | object | |||
| response.data.approver.holidays[].holidays[].id | string | No | holiday ID | |
| response.data.approver.holidays[].holidays[].name | string | No | holiday name | |
| response.data.approver.holidays[].holidays[].date | string | No | date in YYYY-MM-DD format | date |
| response.data.approver.holidays[].holidays[].isHalfDay | boolean | No | whether it is a half-day holiday | |
| response.data.leaveType | object | No | the leave type (only when expand includes leaveType) | |
| response.data.leaveType.id | string | Yes | ||
| response.data.leaveType.name | string | Yes | ||
| response.data.leaveType.isDefault | boolean | Yes |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Returned 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.operation | object | Yes | ||
| response.operation.id | string | Yes | ||
| response.operation.status | string | Yes | operation 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.url | string | Yes |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | Error envelope returned by every endpoint, including authentication and rate limit errors. error.code is one of the codes in x-error-catalog . | ||
| response.error | object | Yes | ||
| response.error.code | string | Yes | stable machine-readable error code | |
| response.error.name | string | Yes | short human-readable error name | |
| response.error.description | string | Yes | what went wrong | |
| response.error.resolution | string | Yes | how to fix the problem | |
| response.error.requestId | string | Yes | request ID, include it when contacting support | |
| response.error.details | object | No | optional additional information specific to the error code | |
| response.error.details.[key: string] | any | No |