Update an automation
This endpoint changes an existing automation. You send a PATCH to a typed path, include only the fields you want to change, and the service merges them with the current values before validating the result like a create. The call requires the automations:write scope. The acting user is either the key owner or the user named in X-On-Behalf-Of. A successful synchronous change returns the automation with 200; an asynchronous change returns 202 with an operation you poll.
Endpoint and authorization
The method is PATCH on /v2/automations/{type}/{id}. Both path parameters are required: type selects the automation family, and id identifies the specific automation. An unrecognized type returns 404 AUTOMATION_TYPE_NOT_FOUND. The request must carry a bearer token with automations:write. To act for another user, include X-On-Behalf-Of with that user's ID. The header is accepted only when the key also holds users:act-on-behalf and the key owner manages the target user; if either condition fails, the call returns 403 ON_BEHALF_OF_NOT_ALLOWED. The header is ignored on GET requests.
Partial updates and merge semantics
Send only the fields you want to change. At least one field is required. The body schema is UpdateAutomationRequest, which lists the fields per type; for example, a blackout-period update uses UpdateBlackoutPeriodAutomationRequest. Fields that belong to a different type fail validation. Your changes are merged with the automation's current values and the merged result is validated as if you were creating it, so any field you omit keeps its existing value. Arrays such as leaveTypeIds, locationIds, departmentIds, labelIds and periods replace the current list when sent. For leave-duration-limit, send null for minimumDuration or maximumDuration to remove that limit; at least one of the two must remain set, and maximumDuration cannot be less than minimumDuration.
Activation, add-on, and permission gates
isActive: false pauses the automation; isActive: true re-enables it. Pausing is always allowed. If the merged result would keep the automation active, including when you re-enable it, the call returns 403 AUTOMATION_ADDON_NOT_ACTIVE unless the company's add-on for that automation is active. Non-admin acting users are limited to automations they created (ownerId); seniority-entitlement and entitlement-by-role automations are admin-only.
Handling 200 and 202 responses
A completed change returns 200 with the updated automation in the data envelope. If the write is still running, or succeeded but its result could not be read back yet, the service returns 202 with an operation object containing id, status and url. The Location header carries the same URL as operation.url. Poll that URL until status is SUCCEEDED or FAILED. A status of 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 the status to SUCCEEDED or FAILED.
Error map and failure distinctions
The documented errors are: 400 VALIDATION_ERROR with details.fields; 400 INVALID_REQUEST_BODY; 403 ON_BEHALF_OF_NOT_ALLOWED; 403 FORBIDDEN and 403 AUTOMATION_ADMIN_REQUIRED when the acting user may not change this automation; 403 AUTOMATION_ADDON_NOT_ACTIVE; 404 AUTOMATION_TYPE_NOT_FOUND; 404 RESOURCE_NOT_FOUND when no automation of the type in the path has this ID; 409 DUPLICATE_NAME when another automation already uses the new name; and the Idempotency-Key codes. Use the distinction to route the fix: validation errors point at field values, permission errors point at the acting user or role, add-on errors point at the company's subscription state, and conflict errors point at a name collision.
Safe retries with Idempotency-Key
The optional Idempotency-Key header accepts 1 to 255 printable ASCII characters and lets you retry a write without duplicating it. Each API key keeps its keys for 24 hours. If you resend the same request with the same key inside that window, the original response is replayed and carries the Idempotent-Replayed header. Sending a different request under a key already in use returns 422 IDEMPOTENCY_KEY_REUSED; a retry that arrives while the first request is still running returns 409 IDEMPOTENCY_REQUEST_IN_PROGRESS; a malformed key returns 400 INVALID_IDEMPOTENCY_KEY.
Field map by automation type
The table below shows which body fields belong to which automation type. All types also accept name and isActive. Use this map to avoid sending a field from the wrong type, which fails validation.
Worked example: remove the minimum from a leave-duration-limit automation
Suppose a leave-duration-limit automation currently has both a minimum and a maximum. To remove the minimum while keeping a maximum of 15, send minimumDuration: null and maximumDuration: 15. The merge keeps every other field, and the result is validated like a create. If the resulting automation would have neither a minimum nor a maximum, the request fails validation. The supplied example request for this case is shown in the protected request module. The supplied 200 response example for a blackout-period automation shows the data envelope with id, type, name, isActive, ownerId, createdAt, locationIds, departmentIds, labelIds, leaveTypeIds, startDate, endDate, recurring and reason.
Pre-flight checklist
Before sending the request, confirm: the key has automations:write; if using X-On-Behalf-Of, the key also has users:act-on-behalf and the key owner manages the target user; the type in the path matches the fields in the body; at least one field is present; arrays are sent in full because they replace the current list; for leave-duration-limit, at least one of minimumDuration or maximumDuration remains set and maximumDuration is not less than minimumDuration; if the update leaves the automation active, the company's add-on for that automation is active; a non-admin acting user owns the automation or the type is not admin-only; and an Idempotency-Key is set if you may retry.
| Automation type | Body fields (plus name and isActive) |
|---|---|
| blackout-period | locationIds, departmentIds, labelIds, leaveTypeIds, startDate, endDate, recurring, reason |
| maximum-users-away | locationIds, departmentIds, labelIds, leaveTypeIds, startDate, endDate, recurring, autoRejectResponse, maxUsersAway |
| seniority-entitlement | locationIds, departmentIds, labelIds, leaveTypeId, prorate, periods, calculateFrom, awardSeniorityEntitlementDaysOn |
| entitlement-by-role | leaveTypeId, startDate, amount, units, labelId |
| probation-period | locationIds, departmentIds, labelIds, leaveTypeIds, lengthDays, reason |
| leave-duration-limit | locationIds, departmentIds, labelIds, period, minimumDuration, maximumDuration, units, recurring, autoRejectResponse, leaveTypeIds |
| leave-request-notice-period | locationIds, departmentIds, labelIds, minLeaveDurationForAdvanceNotice, requiredAdvanceNoticeDays, autoRejectResponse, leaveTypeIds |
Field lists are taken from the supplied request schema. Every type also accepts name and isActive. Sending a field from a different type fails validation.
Frequently asked questions
What is the difference between a 200 and a 202 response?
A 200 means the change completed and the updated automation is in the response. A 202 means the write is still running or succeeded but its result could not be read back yet; the response contains an operation with id, status and url, and you poll that URL until status is SUCCEEDED or FAILED. A status of UNKNOWN means no result arrived within 15 minutes, so read the resource to check.
Do array fields add to the existing list or replace it?
They replace it. Arrays such as leaveTypeIds, locationIds, departmentIds, labelIds and periods replace the current list when sent, so include every value you want to keep.
Can I pause an automation when the add-on is not active?
Yes. Setting isActive: false to pause is permitted regardless of add-on state. The add-on check only applies when the merged result keeps the automation active — re-enabling it counts — and in that case a company without an active add-on for that automation gets 403 AUTOMATION_ADDON_NOT_ACTIVE.
Can a non-admin user update an automation?
A non-admin acting user can change only automations they created, identified by ownerId. seniority-entitlement and entitlement-by-role automations can be changed only by admins.
How do I remove a minimum or maximum leave duration limit?
Send null for minimumDuration or maximumDuration to remove that limit. At least one of the two must stay set after the merge, and maximumDuration cannot be less than minimumDuration.
How does Idempotency-Key make retries safe?
Supply 1 to 255 printable ASCII characters, and the key stays valid for 24 hours per API key. Within that window, resending an identical request under the same key returns the stored original response, marked with the Idempotent-Replayed header. A different request under an already-used key is rejected with 422 IDEMPOTENCY_KEY_REUSED; a retry that lands while the first request is still executing gets 409 IDEMPOTENCY_REQUEST_IN_PROGRESS; a key that fails the character or length rules gets 400 INVALID_IDEMPOTENCY_KEY.
curl -X PATCH "$API_BASE_URL/v2/automations/blackout-period/string" \
-H "Authorization: Bearer " \
-H "Content-Type: application/json" \
-d '{
"isActive": false
}'{
"data": {
"id": "a1b2c3d4-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"type": "blackout-period",
"name": "End of year freeze",
"isActive": true,
"ownerId": "user-63b17e97-d38b-4586-8498-bb4f5d2e2c14",
"createdAt": "2026-09-23T10:00:00.000Z",
"locationIds": [
"location-79c77ac8-e5bf-479f-9488-648a58379ff1"
],
"departmentIds": [],
"labelIds": [],
"leaveTypeIds": [
"leaveType-fcc1e5c5-ba93-479d-bd58-8f860ba10615"
],
"startDate": "2026-12-20",
"endDate": "2026-12-31",
"recurring": true,
"reason": "Year-end closing"
}
}{
"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": "AUTOMATION_TYPE_NOT_FOUND",
"name": "Automation type not found",
"description": "Example post details.",
"resolution": "Use one of the automation types listed in the API reference.",
"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"
}
}type
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| type | string | Yes | automation type. Any other value returns 404 AUTOMATION_TYPE_NOT_FOUND . | Allowed values: "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
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 | blackout-period | maximum-users-away | seniority-entitlement | entitlement-by-role | probation-period | leave-duration-limit | leave-request-notice-period | Yes | the fields to change for the automation type in the path, one schema per type, plus name and isActive; at least one field is required. The change is merged with the current automation and validated like a create. anyOf rather than oneOf because a body such as { "isActive": false } fits every type. | |
| body[variant1] | object | the fields to change for the automation type in the path, one schema per type, plus name and isActive; at least one field is required. The change is merged with the current automation and validated like a create. anyOf rather than oneOf because a body such as { "isActive": false } fits every type. | 1 <= properties | |
| body[variant1].name | string | No | automation name, unique among the company's automations. Text that looks like HTML or script fails validation. | |
| body[variant1].isActive | boolean | No | false pauses the automation, true re-enables it. An update that leaves the automation active needs the automation's add-on to be active. | |
| body[variant1].locationIds | array<string> | No | IDs of the locations the automation applies to; empty means all locations | |
| body[variant1].locationIds[] | string | |||
| body[variant1].departmentIds | array<string> | No | IDs of the departments the automation applies to; empty means all departments | |
| body[variant1].departmentIds[] | string | |||
| body[variant1].labelIds | array<string> | No | IDs of the labels the automation applies to; empty means users with or without labels | |
| body[variant1].labelIds[] | string | |||
| body[variant1].leaveTypeIds | array<string> | No | IDs of the leave types the automation applies to | |
| body[variant1].leaveTypeIds[] | string | |||
| body[variant1].startDate | string | No | first day of the blackout period in YYYY-MM-DD format | Format: date |
| body[variant1].endDate | string | No | last day of the blackout period in YYYY-MM-DD format | Format: date |
| body[variant1].recurring | boolean | No | whether the blackout period repeats every year | |
| body[variant1].reason | string | No | the reason shown to users, may be empty. Text that looks like HTML or script fails validation. | |
| body[variant2] | object | the fields to change for the automation type in the path, one schema per type, plus name and isActive; at least one field is required. The change is merged with the current automation and validated like a create. anyOf rather than oneOf because a body such as { "isActive": false } fits every type. | 1 <= properties | |
| body[variant2].name | string | No | automation name, unique among the company's automations. Text that looks like HTML or script fails validation. | |
| body[variant2].isActive | boolean | No | false pauses the automation, true re-enables it. An update that leaves the automation active needs the automation's add-on to be active. | |
| body[variant2].locationIds | array<string> | No | IDs of the locations the automation applies to; empty means all locations | |
| body[variant2].locationIds[] | string | |||
| body[variant2].departmentIds | array<string> | No | IDs of the departments the automation applies to; empty means all departments | |
| body[variant2].departmentIds[] | string | |||
| body[variant2].labelIds | array<string> | No | IDs of the labels the automation applies to; empty means users with or without labels | |
| body[variant2].labelIds[] | string | |||
| body[variant2].leaveTypeIds | array<string> | No | IDs of the leave types counted; omitted or empty means all leave types | |
| body[variant2].leaveTypeIds[] | string | |||
| body[variant2].startDate | string | No | first day the limit applies, in YYYY-MM-DD format | date |
| body[variant2].endDate | string | No | last day the limit applies, in YYYY-MM-DD format | date |
| body[variant2].recurring | boolean | No | whether the period repeats every year | |
| body[variant2].autoRejectResponse | string | No | the message sent to the user when a leave request is automatically rejected by this automation, may be empty. Text that looks like HTML or script fails validation. | |
| body[variant2].maxUsersAway | object | No | ||
| body[variant2].maxUsersAway.type | string | Yes | whether value is a percentage of the matching users or a number of users | "percentage" | "absolute" |
| body[variant2].maxUsersAway.value | number | Yes | the maximum share or number of users who can be away at the same time. A percentage above the maximum the dashboard allows fails validation. | 0 <= value |
| body[variant3] | object | the fields to change for the automation type in the path, one schema per type, plus name and isActive; at least one field is required. The change is merged with the current automation and validated like a create. anyOf rather than oneOf because a body such as { "isActive": false } fits every type. | 1 <= properties | |
| body[variant3].name | string | No | automation name, unique among the company's automations. Text that looks like HTML or script fails validation. | |
| body[variant3].isActive | boolean | No | false pauses the automation, true re-enables it. An update that leaves the automation active needs the automation's add-on to be active. | |
| body[variant3].locationIds | array<string> | No | IDs of the locations the automation applies to; empty means all locations | |
| body[variant3].locationIds[] | string | |||
| body[variant3].departmentIds | array<string> | No | IDs of the departments the automation applies to; empty means all departments | |
| body[variant3].departmentIds[] | string | |||
| body[variant3].labelIds | array<string> | No | IDs of the labels the automation applies to; empty means users with or without labels | |
| body[variant3].labelIds[] | string | |||
| body[variant3].leaveTypeId | string | No | the ID of the leave type that receives the extra entitlement | |
| body[variant3].prorate | boolean | No | whether the extra entitlement is prorated | |
| body[variant3].periods | array<object> | No | the extra entitlement awarded after each number of years of service | 1 <= items <= 20 |
| body[variant3].periods[] | object | |||
| body[variant3].periods[].years | integer | Yes | years of service | 1 <= value |
| body[variant3].periods[].amount | number | Yes | the extra entitlement, in steps of 0.5 | 0.5 0.5 <= value |
| body[variant3].periods[].units | string | Yes | the unit of the amount, days or hours | "days" | "hours" |
| body[variant3].calculateFrom | string | No | whether years of service count from the user's employment start date or from today; TODAY when it was never set | "USER_EMPLOYMENT_DATE" | "TODAY" |
| body[variant3].awardSeniorityEntitlementDaysOn | string | No | when the extra entitlement is awarded; USER_WORK_ANNIVERSARY when it was never set | "USER_WORK_ANNIVERSARY" | "BEGINNING_OF_THE_FISCAL_YEAR" |
| body[variant4] | object | the fields to change for the automation type in the path, one schema per type, plus name and isActive; at least one field is required. The change is merged with the current automation and validated like a create. anyOf rather than oneOf because a body such as { "isActive": false } fits every type. | 1 <= properties | |
| body[variant4].name | string | No | automation name, unique among the company's automations. Text that looks like HTML or script fails validation. | |
| body[variant4].isActive | boolean | No | false pauses the automation, true re-enables it. An update that leaves the automation active needs the automation's add-on to be active. | |
| body[variant4].leaveTypeId | string | No | the ID of the leave type that receives the extra entitlement | |
| body[variant4].startDate | string | No | date in YYYY-MM-DD format from which the extra entitlement applies | date |
| body[variant4].amount | number | No | the extra entitlement | |
| body[variant4].units | string | No | the unit of the amount, days or hours | "days" | "hours" |
| body[variant4].labelId | string | No | the ID of the label (role) whose users receive the extra entitlement; an empty string after that label was deleted, and the automation then no longer applies | |
| body[variant5] | object | the fields to change for the automation type in the path, one schema per type, plus name and isActive; at least one field is required. The change is merged with the current automation and validated like a create. anyOf rather than oneOf because a body such as { "isActive": false } fits every type. | 1 <= properties | |
| body[variant5].name | string | No | automation name, unique among the company's automations. Text that looks like HTML or script fails validation. | |
| body[variant5].isActive | boolean | No | false pauses the automation, true re-enables it. An update that leaves the automation active needs the automation's add-on to be active. | |
| body[variant5].locationIds | array<string> | No | IDs of the locations the automation applies to; empty means all locations | |
| body[variant5].locationIds[] | string | |||
| body[variant5].departmentIds | array<string> | No | IDs of the departments the automation applies to; empty means all departments | |
| body[variant5].departmentIds[] | string | |||
| body[variant5].labelIds | array<string> | No | IDs of the labels the automation applies to; empty means users with or without labels | |
| body[variant5].labelIds[] | string | |||
| body[variant5].leaveTypeIds | array<string> | No | IDs of the leave types the automation applies to | |
| body[variant5].leaveTypeIds[] | string | |||
| body[variant5].lengthDays | number | No | length of the probation period in days, counted from the user's employment start date | |
| body[variant5].reason | string | No | the reason shown to users, may be empty. Text that looks like HTML or script fails validation. | |
| body[variant6] | object | send null for minimumDuration or maximumDuration to remove that limit; at least one of them must stay set after the merge. | 1 <= properties | |
| body[variant6].name | string | No | automation name, unique among the company's automations. Text that looks like HTML or script fails validation. | |
| body[variant6].isActive | boolean | No | false pauses the automation, true re-enables it. An update that leaves the automation active needs the automation's add-on to be active. | |
| body[variant6].locationIds | array<string> | No | IDs of the locations the automation applies to; empty means all locations | |
| body[variant6].locationIds[] | string | |||
| body[variant6].departmentIds | array<string> | No | IDs of the departments the automation applies to; empty means all departments | |
| body[variant6].departmentIds[] | string | |||
| body[variant6].labelIds | array<string> | No | IDs of the labels the automation applies to; empty means users with or without labels | |
| body[variant6].labelIds[] | string | |||
| body[variant6].period | array<string> | No | the start and end dates, in YYYY-MM-DD format, during which the limit applies | 2 <= items <= 2 |
| body[variant6].period[] | string | date | ||
| body[variant6].minimumDuration | number | null | No | the shortest allowed leave, in units; null when there is no minimum | 0 < value |
| body[variant6].minimumDuration[variant1] | number | the shortest allowed leave, in units; null when there is no minimum | 0 < value | |
| body[variant6].minimumDuration[variant2] | null | the shortest allowed leave, in units; null when there is no minimum | 0 < value | |
| body[variant6].maximumDuration | number | null | No | the longest allowed leave, in units; null when there is no maximum | 0 < value |
| body[variant6].maximumDuration[variant1] | number | the longest allowed leave, in units; null when there is no maximum | 0 < value | |
| body[variant6].maximumDuration[variant2] | null | the longest allowed leave, in units; null when there is no maximum | 0 < value | |
| body[variant6].units | string | No | the unit of the amount, days or hours | "days" | "hours" |
| body[variant6].recurring | boolean | No | whether the period repeats every year | |
| body[variant6].autoRejectResponse | string | No | the message sent to the user when a leave request is automatically rejected by this automation, may be empty. Text that looks like HTML or script fails validation. | |
| body[variant6].leaveTypeIds | array<string> | No | IDs of the leave types limited; omitted or empty means all leave types | |
| body[variant6].leaveTypeIds[] | string | |||
| body[variant7] | object | the fields to change for the automation type in the path, one schema per type, plus name and isActive; at least one field is required. The change is merged with the current automation and validated like a create. anyOf rather than oneOf because a body such as { "isActive": false } fits every type. | 1 <= properties | |
| body[variant7].name | string | No | automation name, unique among the company's automations. Text that looks like HTML or script fails validation. | |
| body[variant7].isActive | boolean | No | false pauses the automation, true re-enables it. An update that leaves the automation active needs the automation's add-on to be active. | |
| body[variant7].locationIds | array<string> | No | IDs of the locations the automation applies to; empty means all locations | |
| body[variant7].locationIds[] | string | |||
| body[variant7].departmentIds | array<string> | No | IDs of the departments the automation applies to; empty means all departments | |
| body[variant7].departmentIds[] | string | |||
| body[variant7].labelIds | array<string> | No | IDs of the labels the automation applies to; empty means users with or without labels | |
| body[variant7].labelIds[] | string | |||
| body[variant7].minLeaveDurationForAdvanceNotice | integer | No | leaves at least this long must be requested in advance | |
| body[variant7].requiredAdvanceNoticeDays | integer | No | how many days in advance those leaves must be requested | |
| body[variant7].autoRejectResponse | string | No | the message sent to the user when a leave request is automatically rejected by this automation, may be empty. Text that looks like HTML or script fails validation. | |
| body[variant7].leaveTypeIds | array<string> | No | IDs of the leave types the notice applies to; omitted or empty means all leave types | |
| body[variant7].leaveTypeIds[] | string |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | |||
| response.data | blackout-period | maximum-users-away | seniority-entitlement | entitlement-by-role | probation-period | leave-duration-limit | leave-request-notice-period | Yes | ||
| response.data[variant1] | object | |||
| response.data[variant1].id | string | Yes | automation ID | |
| response.data[variant1].type | string | Yes | automation type | Allowed values: "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
| response.data[variant1].name | string | Yes | automation name, unique among the company's automations | |
| response.data[variant1].isActive | boolean | Yes | whether the automation is currently applied | |
| response.data[variant1].ownerId | string | Yes | the ID of the user who created the automation | |
| response.data[variant1].createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data[variant1].locationIds | array<string> | Yes | IDs of the locations the automation applies to; empty means all locations | |
| response.data[variant1].locationIds[] | string | |||
| response.data[variant1].departmentIds | array<string> | Yes | IDs of the departments the automation applies to; empty means all departments | |
| response.data[variant1].departmentIds[] | string | |||
| response.data[variant1].labelIds | array<string> | Yes | IDs of the labels the automation applies to; empty means users with or without labels | |
| response.data[variant1].labelIds[] | string | |||
| response.data[variant1].leaveTypeIds | array<string> | Yes | IDs of the leave types the automation applies to | |
| response.data[variant1].leaveTypeIds[] | string | |||
| response.data[variant1].startDate | string | Yes | first day of the blackout period in YYYY-MM-DD format | date |
| response.data[variant1].endDate | string | Yes | last day of the blackout period in YYYY-MM-DD format | date |
| response.data[variant1].recurring | boolean | Yes | whether the blackout period repeats every year | |
| response.data[variant1].reason | string | Yes | the reason shown to users, may be empty. Text that looks like HTML or script fails validation. | |
| response.data[variant2] | object | |||
| response.data[variant2].id | string | Yes | automation ID | |
| response.data[variant2].type | string | Yes | automation type | "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
| response.data[variant2].name | string | Yes | automation name, unique among the company's automations | |
| response.data[variant2].isActive | boolean | Yes | whether the automation is currently applied | |
| response.data[variant2].ownerId | string | Yes | the ID of the user who created the automation | |
| response.data[variant2].createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data[variant2].locationIds | array<string> | Yes | IDs of the locations the automation applies to; empty means all locations | |
| response.data[variant2].locationIds[] | string | |||
| response.data[variant2].departmentIds | array<string> | Yes | IDs of the departments the automation applies to; empty means all departments | |
| response.data[variant2].departmentIds[] | string | |||
| response.data[variant2].labelIds | array<string> | Yes | IDs of the labels the automation applies to; empty means users with or without labels | |
| response.data[variant2].labelIds[] | string | |||
| response.data[variant2].leaveTypeIds | array<string> | Yes | IDs of the leave types counted; omitted or empty means all leave types | |
| response.data[variant2].leaveTypeIds[] | string | |||
| response.data[variant2].startDate | string | Yes | first day the limit applies, in YYYY-MM-DD format | date |
| response.data[variant2].endDate | string | Yes | last day the limit applies, in YYYY-MM-DD format | date |
| response.data[variant2].recurring | boolean | Yes | whether the period repeats every year | |
| response.data[variant2].autoRejectResponse | string | Yes | the message sent to the user when a leave request is automatically rejected by this automation, may be empty. Text that looks like HTML or script fails validation. | |
| response.data[variant2].maxUsersAway | object | Yes | ||
| response.data[variant2].maxUsersAway.type | string | Yes | whether value is a percentage of the matching users or a number of users | "percentage" | "absolute" |
| response.data[variant2].maxUsersAway.value | number | Yes | the maximum share or number of users who can be away at the same time. A percentage above the maximum the dashboard allows fails validation. | 0 <= value |
| response.data[variant3] | object | |||
| response.data[variant3].id | string | Yes | automation ID | |
| response.data[variant3].type | string | Yes | automation type | "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
| response.data[variant3].name | string | Yes | automation name, unique among the company's automations | |
| response.data[variant3].isActive | boolean | Yes | whether the automation is currently applied | |
| response.data[variant3].ownerId | string | Yes | the ID of the user who created the automation | |
| response.data[variant3].createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data[variant3].locationIds | array<string> | Yes | IDs of the locations the automation applies to; empty means all locations | |
| response.data[variant3].locationIds[] | string | |||
| response.data[variant3].departmentIds | array<string> | Yes | IDs of the departments the automation applies to; empty means all departments | |
| response.data[variant3].departmentIds[] | string | |||
| response.data[variant3].labelIds | array<string> | Yes | IDs of the labels the automation applies to; empty means users with or without labels | |
| response.data[variant3].labelIds[] | string | |||
| response.data[variant3].leaveTypeId | string | Yes | the ID of the leave type that receives the extra entitlement | |
| response.data[variant3].prorate | boolean | Yes | whether the extra entitlement is prorated | |
| response.data[variant3].periods | array<object> | Yes | the extra entitlement awarded after each number of years of service | 1 <= items <= 20 |
| response.data[variant3].periods[] | object | |||
| response.data[variant3].periods[].years | integer | Yes | years of service | 1 <= value |
| response.data[variant3].periods[].amount | number | Yes | the extra entitlement, in steps of 0.5 | 0.5 0.5 <= value |
| response.data[variant3].periods[].units | string | Yes | the unit of the amount, days or hours | "days" | "hours" |
| response.data[variant3].calculateFrom | string | Yes | whether years of service count from the user's employment start date or from today; TODAY when it was never set | "USER_EMPLOYMENT_DATE" | "TODAY" |
| response.data[variant3].awardSeniorityEntitlementDaysOn | string | No | when the extra entitlement is awarded; USER_WORK_ANNIVERSARY when it was never set | "USER_WORK_ANNIVERSARY" | "BEGINNING_OF_THE_FISCAL_YEAR" |
| response.data[variant4] | object | |||
| response.data[variant4].id | string | Yes | automation ID | |
| response.data[variant4].type | string | Yes | automation type | "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
| response.data[variant4].name | string | Yes | automation name, unique among the company's automations | |
| response.data[variant4].isActive | boolean | Yes | whether the automation is currently applied | |
| response.data[variant4].ownerId | string | Yes | the ID of the user who created the automation | |
| response.data[variant4].createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data[variant4].leaveTypeId | string | Yes | the ID of the leave type that receives the extra entitlement | |
| response.data[variant4].startDate | string | Yes | date in YYYY-MM-DD format from which the extra entitlement applies | date |
| response.data[variant4].amount | number | Yes | the extra entitlement | |
| response.data[variant4].units | string | Yes | the unit of the amount, days or hours | "days" | "hours" |
| response.data[variant4].labelId | string | Yes | the ID of the label (role) whose users receive the extra entitlement; an empty string after that label was deleted, and the automation then no longer applies | |
| response.data[variant5] | object | |||
| response.data[variant5].id | string | Yes | automation ID | |
| response.data[variant5].type | string | Yes | automation type | "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
| response.data[variant5].name | string | Yes | automation name, unique among the company's automations | |
| response.data[variant5].isActive | boolean | Yes | whether the automation is currently applied | |
| response.data[variant5].ownerId | string | Yes | the ID of the user who created the automation | |
| response.data[variant5].createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data[variant5].locationIds | array<string> | Yes | IDs of the locations the automation applies to; empty means all locations | |
| response.data[variant5].locationIds[] | string | |||
| response.data[variant5].departmentIds | array<string> | Yes | IDs of the departments the automation applies to; empty means all departments | |
| response.data[variant5].departmentIds[] | string | |||
| response.data[variant5].labelIds | array<string> | Yes | IDs of the labels the automation applies to; empty means users with or without labels | |
| response.data[variant5].labelIds[] | string | |||
| response.data[variant5].leaveTypeIds | array<string> | Yes | IDs of the leave types the automation applies to | |
| response.data[variant5].leaveTypeIds[] | string | |||
| response.data[variant5].lengthDays | number | Yes | length of the probation period in days, counted from the user's employment start date | |
| response.data[variant5].reason | string | Yes | the reason shown to users, may be empty. Text that looks like HTML or script fails validation. | |
| response.data[variant6] | object | |||
| response.data[variant6].id | string | Yes | automation ID | |
| response.data[variant6].type | string | Yes | automation type | "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
| response.data[variant6].name | string | Yes | automation name, unique among the company's automations | |
| response.data[variant6].isActive | boolean | Yes | whether the automation is currently applied | |
| response.data[variant6].ownerId | string | Yes | the ID of the user who created the automation | |
| response.data[variant6].createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data[variant6].locationIds | array<string> | Yes | IDs of the locations the automation applies to; empty means all locations | |
| response.data[variant6].locationIds[] | string | |||
| response.data[variant6].departmentIds | array<string> | Yes | IDs of the departments the automation applies to; empty means all departments | |
| response.data[variant6].departmentIds[] | string | |||
| response.data[variant6].labelIds | array<string> | Yes | IDs of the labels the automation applies to; empty means users with or without labels | |
| response.data[variant6].labelIds[] | string | |||
| response.data[variant6].period | array<string> | Yes | the start and end dates, in YYYY-MM-DD format, during which the limit applies | 2 <= items <= 2 |
| response.data[variant6].period[] | string | date | ||
| response.data[variant6].minimumDuration | number | null | Yes | the shortest allowed leave, in units; null when there is no minimum | 0 < value |
| response.data[variant6].minimumDuration[variant1] | number | the shortest allowed leave, in units; null when there is no minimum | 0 < value | |
| response.data[variant6].minimumDuration[variant2] | null | the shortest allowed leave, in units; null when there is no minimum | 0 < value | |
| response.data[variant6].maximumDuration | number | null | Yes | the longest allowed leave, in units; null when there is no maximum | 0 < value |
| response.data[variant6].maximumDuration[variant1] | number | the longest allowed leave, in units; null when there is no maximum | 0 < value | |
| response.data[variant6].maximumDuration[variant2] | null | the longest allowed leave, in units; null when there is no maximum | 0 < value | |
| response.data[variant6].units | string | Yes | the unit of the amount, days or hours | "days" | "hours" |
| response.data[variant6].recurring | boolean | Yes | whether the period repeats every year | |
| response.data[variant6].autoRejectResponse | string | Yes | the message sent to the user when a leave request is automatically rejected by this automation, may be empty. Text that looks like HTML or script fails validation. | |
| response.data[variant6].leaveTypeIds | array<string> | Yes | IDs of the leave types limited; omitted or empty means all leave types | |
| response.data[variant6].leaveTypeIds[] | string | |||
| response.data[variant7] | object | |||
| response.data[variant7].id | string | Yes | automation ID | |
| response.data[variant7].type | string | Yes | automation type | "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period" |
| response.data[variant7].name | string | Yes | automation name, unique among the company's automations | |
| response.data[variant7].isActive | boolean | Yes | whether the automation is currently applied | |
| response.data[variant7].ownerId | string | Yes | the ID of the user who created the automation | |
| response.data[variant7].createdAt | string | Yes | a timestamp in the ISO 8601 format | Format: date-time |
| response.data[variant7].locationIds | array<string> | Yes | IDs of the locations the automation applies to; empty means all locations | |
| response.data[variant7].locationIds[] | string | |||
| response.data[variant7].departmentIds | array<string> | Yes | IDs of the departments the automation applies to; empty means all departments | |
| response.data[variant7].departmentIds[] | string | |||
| response.data[variant7].labelIds | array<string> | Yes | IDs of the labels the automation applies to; empty means users with or without labels | |
| response.data[variant7].labelIds[] | string | |||
| response.data[variant7].minLeaveDurationForAdvanceNotice | integer | Yes | leaves at least this long must be requested in advance | |
| response.data[variant7].requiredAdvanceNoticeDays | integer | Yes | how many days in advance those leaves must be requested | |
| response.data[variant7].autoRejectResponse | string | Yes | the message sent to the user when a leave request is automatically rejected by this automation, may be empty. Text that looks like HTML or script fails validation. | |
| response.data[variant7].leaveTypeIds | array<string> | Yes | IDs of the leave types the notice applies to; omitted or empty means all leave types | |
| response.data[variant7].leaveTypeIds[] | string |
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 |