Skip to content

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.

Body fields by automation type
Automation typeBody fields (plus name and isActive)
blackout-periodlocationIds, departmentIds, labelIds, leaveTypeIds, startDate, endDate, recurring, reason
maximum-users-awaylocationIds, departmentIds, labelIds, leaveTypeIds, startDate, endDate, recurring, autoRejectResponse, maxUsersAway
seniority-entitlementlocationIds, departmentIds, labelIds, leaveTypeId, prorate, periods, calculateFrom, awardSeniorityEntitlementDaysOn
entitlement-by-roleleaveTypeId, startDate, amount, units, labelId
probation-periodlocationIds, departmentIds, labelIds, leaveTypeIds, lengthDays, reason
leave-duration-limitlocationIds, departmentIds, labelIds, period, minimumDuration, maximumDuration, units, recurring, autoRejectResponse, leaveTypeIds
leave-request-notice-periodlocationIds, 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

FieldTypeRequiredDescriptionConstraints
typestringYesautomation 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

FieldTypeRequiredDescriptionConstraints
idstringYesresource ID.

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
bodyblackout-period | maximum-users-away | seniority-entitlement | entitlement-by-role | probation-period | leave-duration-limit | leave-request-notice-periodYesthe 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]objectthe 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].namestringNoautomation name, unique among the company's automations. Text that looks like HTML or script fails validation.
body[variant1].isActivebooleanNofalse 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].locationIdsarray<string>NoIDs of the locations the automation applies to; empty means all locations
body[variant1].locationIds[]string
body[variant1].departmentIdsarray<string>NoIDs of the departments the automation applies to; empty means all departments
body[variant1].departmentIds[]string
body[variant1].labelIdsarray<string>NoIDs of the labels the automation applies to; empty means users with or without labels
body[variant1].labelIds[]string
body[variant1].leaveTypeIdsarray<string>NoIDs of the leave types the automation applies to
body[variant1].leaveTypeIds[]string
body[variant1].startDatestringNofirst day of the blackout period in YYYY-MM-DD formatFormat: date
body[variant1].endDatestringNolast day of the blackout period in YYYY-MM-DD formatFormat: date
body[variant1].recurringbooleanNowhether the blackout period repeats every year
body[variant1].reasonstringNothe reason shown to users, may be empty. Text that looks like HTML or script fails validation.
body[variant2]objectthe 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].namestringNoautomation name, unique among the company's automations. Text that looks like HTML or script fails validation.
body[variant2].isActivebooleanNofalse 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].locationIdsarray<string>NoIDs of the locations the automation applies to; empty means all locations
body[variant2].locationIds[]string
body[variant2].departmentIdsarray<string>NoIDs of the departments the automation applies to; empty means all departments
body[variant2].departmentIds[]string
body[variant2].labelIdsarray<string>NoIDs of the labels the automation applies to; empty means users with or without labels
body[variant2].labelIds[]string
body[variant2].leaveTypeIdsarray<string>NoIDs of the leave types counted; omitted or empty means all leave types
body[variant2].leaveTypeIds[]string
body[variant2].startDatestringNofirst day the limit applies, in YYYY-MM-DD formatdate
body[variant2].endDatestringNolast day the limit applies, in YYYY-MM-DD formatdate
body[variant2].recurringbooleanNowhether the period repeats every year
body[variant2].autoRejectResponsestringNothe 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].maxUsersAwayobjectNo
body[variant2].maxUsersAway.typestringYeswhether value is a percentage of the matching users or a number of users"percentage" | "absolute"
body[variant2].maxUsersAway.valuenumberYesthe 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]objectthe 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].namestringNoautomation name, unique among the company's automations. Text that looks like HTML or script fails validation.
body[variant3].isActivebooleanNofalse 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].locationIdsarray<string>NoIDs of the locations the automation applies to; empty means all locations
body[variant3].locationIds[]string
body[variant3].departmentIdsarray<string>NoIDs of the departments the automation applies to; empty means all departments
body[variant3].departmentIds[]string
body[variant3].labelIdsarray<string>NoIDs of the labels the automation applies to; empty means users with or without labels
body[variant3].labelIds[]string
body[variant3].leaveTypeIdstringNothe ID of the leave type that receives the extra entitlement
body[variant3].proratebooleanNowhether the extra entitlement is prorated
body[variant3].periodsarray<object>Nothe extra entitlement awarded after each number of years of service1 <= items <= 20
body[variant3].periods[]object
body[variant3].periods[].yearsintegerYesyears of service1 <= value
body[variant3].periods[].amountnumberYesthe extra entitlement, in steps of 0.50.5
0.5 <= value
body[variant3].periods[].unitsstringYesthe unit of the amount, days or hours"days" | "hours"
body[variant3].calculateFromstringNowhether 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].awardSeniorityEntitlementDaysOnstringNowhen the extra entitlement is awarded; USER_WORK_ANNIVERSARY when it was never set"USER_WORK_ANNIVERSARY" | "BEGINNING_OF_THE_FISCAL_YEAR"
body[variant4]objectthe 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].namestringNoautomation name, unique among the company's automations. Text that looks like HTML or script fails validation.
body[variant4].isActivebooleanNofalse 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].leaveTypeIdstringNothe ID of the leave type that receives the extra entitlement
body[variant4].startDatestringNodate in YYYY-MM-DD format from which the extra entitlement appliesdate
body[variant4].amountnumberNothe extra entitlement
body[variant4].unitsstringNothe unit of the amount, days or hours"days" | "hours"
body[variant4].labelIdstringNothe 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]objectthe 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].namestringNoautomation name, unique among the company's automations. Text that looks like HTML or script fails validation.
body[variant5].isActivebooleanNofalse 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].locationIdsarray<string>NoIDs of the locations the automation applies to; empty means all locations
body[variant5].locationIds[]string
body[variant5].departmentIdsarray<string>NoIDs of the departments the automation applies to; empty means all departments
body[variant5].departmentIds[]string
body[variant5].labelIdsarray<string>NoIDs of the labels the automation applies to; empty means users with or without labels
body[variant5].labelIds[]string
body[variant5].leaveTypeIdsarray<string>NoIDs of the leave types the automation applies to
body[variant5].leaveTypeIds[]string
body[variant5].lengthDaysnumberNolength of the probation period in days, counted from the user's employment start date
body[variant5].reasonstringNothe reason shown to users, may be empty. Text that looks like HTML or script fails validation.
body[variant6]objectsend null for minimumDuration or maximumDuration to remove that limit; at least one of them must stay set after the merge.1 <= properties
body[variant6].namestringNoautomation name, unique among the company's automations. Text that looks like HTML or script fails validation.
body[variant6].isActivebooleanNofalse 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].locationIdsarray<string>NoIDs of the locations the automation applies to; empty means all locations
body[variant6].locationIds[]string
body[variant6].departmentIdsarray<string>NoIDs of the departments the automation applies to; empty means all departments
body[variant6].departmentIds[]string
body[variant6].labelIdsarray<string>NoIDs of the labels the automation applies to; empty means users with or without labels
body[variant6].labelIds[]string
body[variant6].periodarray<string>Nothe start and end dates, in YYYY-MM-DD format, during which the limit applies2 <= items <= 2
body[variant6].period[]stringdate
body[variant6].minimumDurationnumber | nullNothe shortest allowed leave, in units; null when there is no minimum0 < value
body[variant6].minimumDuration[variant1]numberthe shortest allowed leave, in units; null when there is no minimum0 < value
body[variant6].minimumDuration[variant2]nullthe shortest allowed leave, in units; null when there is no minimum0 < value
body[variant6].maximumDurationnumber | nullNothe longest allowed leave, in units; null when there is no maximum0 < value
body[variant6].maximumDuration[variant1]numberthe longest allowed leave, in units; null when there is no maximum0 < value
body[variant6].maximumDuration[variant2]nullthe longest allowed leave, in units; null when there is no maximum0 < value
body[variant6].unitsstringNothe unit of the amount, days or hours"days" | "hours"
body[variant6].recurringbooleanNowhether the period repeats every year
body[variant6].autoRejectResponsestringNothe 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].leaveTypeIdsarray<string>NoIDs of the leave types limited; omitted or empty means all leave types
body[variant6].leaveTypeIds[]string
body[variant7]objectthe 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].namestringNoautomation name, unique among the company's automations. Text that looks like HTML or script fails validation.
body[variant7].isActivebooleanNofalse 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].locationIdsarray<string>NoIDs of the locations the automation applies to; empty means all locations
body[variant7].locationIds[]string
body[variant7].departmentIdsarray<string>NoIDs of the departments the automation applies to; empty means all departments
body[variant7].departmentIds[]string
body[variant7].labelIdsarray<string>NoIDs of the labels the automation applies to; empty means users with or without labels
body[variant7].labelIds[]string
body[variant7].minLeaveDurationForAdvanceNoticeintegerNoleaves at least this long must be requested in advance
body[variant7].requiredAdvanceNoticeDaysintegerNohow many days in advance those leaves must be requested
body[variant7].autoRejectResponsestringNothe 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].leaveTypeIdsarray<string>NoIDs of the leave types the notice applies to; omitted or empty means all leave types
body[variant7].leaveTypeIds[]string

response

FieldTypeRequiredDescriptionConstraints
responseobject
response.datablackout-period | maximum-users-away | seniority-entitlement | entitlement-by-role | probation-period | leave-duration-limit | leave-request-notice-periodYes
response.data[variant1]object
response.data[variant1].idstringYesautomation ID
response.data[variant1].typestringYesautomation typeAllowed values: "blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period"
response.data[variant1].namestringYesautomation name, unique among the company's automations
response.data[variant1].isActivebooleanYeswhether the automation is currently applied
response.data[variant1].ownerIdstringYesthe ID of the user who created the automation
response.data[variant1].createdAtstringYesa timestamp in the ISO 8601 formatFormat: date-time
response.data[variant1].locationIdsarray<string>YesIDs of the locations the automation applies to; empty means all locations
response.data[variant1].locationIds[]string
response.data[variant1].departmentIdsarray<string>YesIDs of the departments the automation applies to; empty means all departments
response.data[variant1].departmentIds[]string
response.data[variant1].labelIdsarray<string>YesIDs of the labels the automation applies to; empty means users with or without labels
response.data[variant1].labelIds[]string
response.data[variant1].leaveTypeIdsarray<string>YesIDs of the leave types the automation applies to
response.data[variant1].leaveTypeIds[]string
response.data[variant1].startDatestringYesfirst day of the blackout period in YYYY-MM-DD formatdate
response.data[variant1].endDatestringYeslast day of the blackout period in YYYY-MM-DD formatdate
response.data[variant1].recurringbooleanYeswhether the blackout period repeats every year
response.data[variant1].reasonstringYesthe reason shown to users, may be empty. Text that looks like HTML or script fails validation.
response.data[variant2]object
response.data[variant2].idstringYesautomation ID
response.data[variant2].typestringYesautomation type"blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period"
response.data[variant2].namestringYesautomation name, unique among the company's automations
response.data[variant2].isActivebooleanYeswhether the automation is currently applied
response.data[variant2].ownerIdstringYesthe ID of the user who created the automation
response.data[variant2].createdAtstringYesa timestamp in the ISO 8601 formatFormat: date-time
response.data[variant2].locationIdsarray<string>YesIDs of the locations the automation applies to; empty means all locations
response.data[variant2].locationIds[]string
response.data[variant2].departmentIdsarray<string>YesIDs of the departments the automation applies to; empty means all departments
response.data[variant2].departmentIds[]string
response.data[variant2].labelIdsarray<string>YesIDs of the labels the automation applies to; empty means users with or without labels
response.data[variant2].labelIds[]string
response.data[variant2].leaveTypeIdsarray<string>YesIDs of the leave types counted; omitted or empty means all leave types
response.data[variant2].leaveTypeIds[]string
response.data[variant2].startDatestringYesfirst day the limit applies, in YYYY-MM-DD formatdate
response.data[variant2].endDatestringYeslast day the limit applies, in YYYY-MM-DD formatdate
response.data[variant2].recurringbooleanYeswhether the period repeats every year
response.data[variant2].autoRejectResponsestringYesthe 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].maxUsersAwayobjectYes
response.data[variant2].maxUsersAway.typestringYeswhether value is a percentage of the matching users or a number of users"percentage" | "absolute"
response.data[variant2].maxUsersAway.valuenumberYesthe 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].idstringYesautomation ID
response.data[variant3].typestringYesautomation type"blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period"
response.data[variant3].namestringYesautomation name, unique among the company's automations
response.data[variant3].isActivebooleanYeswhether the automation is currently applied
response.data[variant3].ownerIdstringYesthe ID of the user who created the automation
response.data[variant3].createdAtstringYesa timestamp in the ISO 8601 formatFormat: date-time
response.data[variant3].locationIdsarray<string>YesIDs of the locations the automation applies to; empty means all locations
response.data[variant3].locationIds[]string
response.data[variant3].departmentIdsarray<string>YesIDs of the departments the automation applies to; empty means all departments
response.data[variant3].departmentIds[]string
response.data[variant3].labelIdsarray<string>YesIDs of the labels the automation applies to; empty means users with or without labels
response.data[variant3].labelIds[]string
response.data[variant3].leaveTypeIdstringYesthe ID of the leave type that receives the extra entitlement
response.data[variant3].proratebooleanYeswhether the extra entitlement is prorated
response.data[variant3].periodsarray<object>Yesthe extra entitlement awarded after each number of years of service1 <= items <= 20
response.data[variant3].periods[]object
response.data[variant3].periods[].yearsintegerYesyears of service1 <= value
response.data[variant3].periods[].amountnumberYesthe extra entitlement, in steps of 0.50.5
0.5 <= value
response.data[variant3].periods[].unitsstringYesthe unit of the amount, days or hours"days" | "hours"
response.data[variant3].calculateFromstringYeswhether 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].awardSeniorityEntitlementDaysOnstringNowhen 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].idstringYesautomation ID
response.data[variant4].typestringYesautomation type"blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period"
response.data[variant4].namestringYesautomation name, unique among the company's automations
response.data[variant4].isActivebooleanYeswhether the automation is currently applied
response.data[variant4].ownerIdstringYesthe ID of the user who created the automation
response.data[variant4].createdAtstringYesa timestamp in the ISO 8601 formatFormat: date-time
response.data[variant4].leaveTypeIdstringYesthe ID of the leave type that receives the extra entitlement
response.data[variant4].startDatestringYesdate in YYYY-MM-DD format from which the extra entitlement appliesdate
response.data[variant4].amountnumberYesthe extra entitlement
response.data[variant4].unitsstringYesthe unit of the amount, days or hours"days" | "hours"
response.data[variant4].labelIdstringYesthe 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].idstringYesautomation ID
response.data[variant5].typestringYesautomation type"blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period"
response.data[variant5].namestringYesautomation name, unique among the company's automations
response.data[variant5].isActivebooleanYeswhether the automation is currently applied
response.data[variant5].ownerIdstringYesthe ID of the user who created the automation
response.data[variant5].createdAtstringYesa timestamp in the ISO 8601 formatFormat: date-time
response.data[variant5].locationIdsarray<string>YesIDs of the locations the automation applies to; empty means all locations
response.data[variant5].locationIds[]string
response.data[variant5].departmentIdsarray<string>YesIDs of the departments the automation applies to; empty means all departments
response.data[variant5].departmentIds[]string
response.data[variant5].labelIdsarray<string>YesIDs of the labels the automation applies to; empty means users with or without labels
response.data[variant5].labelIds[]string
response.data[variant5].leaveTypeIdsarray<string>YesIDs of the leave types the automation applies to
response.data[variant5].leaveTypeIds[]string
response.data[variant5].lengthDaysnumberYeslength of the probation period in days, counted from the user's employment start date
response.data[variant5].reasonstringYesthe reason shown to users, may be empty. Text that looks like HTML or script fails validation.
response.data[variant6]object
response.data[variant6].idstringYesautomation ID
response.data[variant6].typestringYesautomation type"blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period"
response.data[variant6].namestringYesautomation name, unique among the company's automations
response.data[variant6].isActivebooleanYeswhether the automation is currently applied
response.data[variant6].ownerIdstringYesthe ID of the user who created the automation
response.data[variant6].createdAtstringYesa timestamp in the ISO 8601 formatFormat: date-time
response.data[variant6].locationIdsarray<string>YesIDs of the locations the automation applies to; empty means all locations
response.data[variant6].locationIds[]string
response.data[variant6].departmentIdsarray<string>YesIDs of the departments the automation applies to; empty means all departments
response.data[variant6].departmentIds[]string
response.data[variant6].labelIdsarray<string>YesIDs of the labels the automation applies to; empty means users with or without labels
response.data[variant6].labelIds[]string
response.data[variant6].periodarray<string>Yesthe start and end dates, in YYYY-MM-DD format, during which the limit applies2 <= items <= 2
response.data[variant6].period[]stringdate
response.data[variant6].minimumDurationnumber | nullYesthe shortest allowed leave, in units; null when there is no minimum0 < value
response.data[variant6].minimumDuration[variant1]numberthe shortest allowed leave, in units; null when there is no minimum0 < value
response.data[variant6].minimumDuration[variant2]nullthe shortest allowed leave, in units; null when there is no minimum0 < value
response.data[variant6].maximumDurationnumber | nullYesthe longest allowed leave, in units; null when there is no maximum0 < value
response.data[variant6].maximumDuration[variant1]numberthe longest allowed leave, in units; null when there is no maximum0 < value
response.data[variant6].maximumDuration[variant2]nullthe longest allowed leave, in units; null when there is no maximum0 < value
response.data[variant6].unitsstringYesthe unit of the amount, days or hours"days" | "hours"
response.data[variant6].recurringbooleanYeswhether the period repeats every year
response.data[variant6].autoRejectResponsestringYesthe 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].leaveTypeIdsarray<string>YesIDs of the leave types limited; omitted or empty means all leave types
response.data[variant6].leaveTypeIds[]string
response.data[variant7]object
response.data[variant7].idstringYesautomation ID
response.data[variant7].typestringYesautomation type"blackout-period" | "seniority-entitlement" | "entitlement-by-role" | "maximum-users-away" | "probation-period" | "leave-duration-limit" | "leave-request-notice-period"
response.data[variant7].namestringYesautomation name, unique among the company's automations
response.data[variant7].isActivebooleanYeswhether the automation is currently applied
response.data[variant7].ownerIdstringYesthe ID of the user who created the automation
response.data[variant7].createdAtstringYesa timestamp in the ISO 8601 formatFormat: date-time
response.data[variant7].locationIdsarray<string>YesIDs of the locations the automation applies to; empty means all locations
response.data[variant7].locationIds[]string
response.data[variant7].departmentIdsarray<string>YesIDs of the departments the automation applies to; empty means all departments
response.data[variant7].departmentIds[]string
response.data[variant7].labelIdsarray<string>YesIDs of the labels the automation applies to; empty means users with or without labels
response.data[variant7].labelIds[]string
response.data[variant7].minLeaveDurationForAdvanceNoticeintegerYesleaves at least this long must be requested in advance
response.data[variant7].requiredAdvanceNoticeDaysintegerYeshow many days in advance those leaves must be requested
response.data[variant7].autoRejectResponsestringYesthe 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].leaveTypeIdsarray<string>YesIDs of the leave types the notice applies to; omitted or empty means all leave types
response.data[variant7].leaveTypeIds[]string

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