List automations of a type
This endpoint returns every automation of a single type in one response. Both active and paused automations are included, and there is no pagination. The call needs the automations:read scope. Automations belong to the whole company, so the key's data reach does not narrow the result.
Request shape and authorization
Send a GET request to /v2/automations/{type} against the API base URL. The Authorization header carries a bearer token in the form Authorization: Bearer <token>, and the key must include automations:read. The exact request contract, including the path parameter schema and the AutomationTypeSlug reference, is delivered in the protected modules code0001, schema0001 and schema0002.
Choosing the type slug
The type path parameter must be one of the supported automation type slugs. Any other value returns 404 AUTOMATION_TYPE_NOT_FOUND. The accepted values are listed in the protected schema modules schema0001 and schema0002; use those exact strings rather than a display name.
What each automation returns
Every automation carries the fields of its own type. The response is an AutomationListResponse whose data array holds Automation objects, one schema per type. locationIds, departmentIds and labelIds are always arrays; an empty array means the automation applies to everyone in that dimension. entitlement-by-role automations have no filters. The complete field list and per-type schemas are delivered in the protected module schema0003.
Reading empty arrays correctly
An empty locationIds, departmentIds or labelIds array is not a missing value. It signals that the automation is unrestricted on that dimension. For example, a blackout-period automation with an empty departmentIds array applies across all departments, while a populated array limits it to the listed departments. Check each array independently before assuming the automation is global.
Worked example: active versus paused
The captured blackout-period response shows two entries. The first, named "End of year freeze", has isActive true and a single locationId, so it is currently applied and scoped to that location. The second, "Product launch", has isActive false and a populated departmentIds array, so it is paused but still returned. Both appear in the same unpaginated data array. The exact JSON is delivered in the protected module code0002.
Error handling
A 404 with code AUTOMATION_TYPE_NOT_FOUND means the type in the path is not one of the supported automation types. A 401 means the key is missing, malformed or not recognized. A 403 with INSUFFICIENT_SCOPE means the key lacks automations:read; the response details list the required scopes. A 429 means too many requests were sent in a short time; wait and retry. A 500 means an internal error; retry later and quote the requestId if it persists. The exact error envelopes are delivered in the protected modules code0003, code0005, code0006 and schema0004 through schema0008.
Pre-call checklist
- Confirm the key has automations:read. 2. Confirm the type slug matches one of the supported values exactly. 3. Send Authorization: Bearer <token>. 4. Expect a single unpaginated data array containing both active and paused automations. 5. Treat empty locationIds, departmentIds and labelIds arrays as 'applies to everyone' rather than missing data. 6. On 404, re-check the slug against the supported list before retrying.
Frequently asked questions
Which scope does this endpoint require?
It requires automations:read. If the key lacks it, the API returns 403 with INSUFFICIENT_SCOPE and lists the required scopes in details.requiredScopes.
Does the response paginate?
No. Every automation of the requested type is returned in one response, including both active and paused entries.
Does the key's data reach limit which automations are returned?
No. Automations are company-wide, so the key's data reach does not narrow the result.
What does an empty locationIds, departmentIds or labelIds array mean?
It means the automation applies to everyone in that dimension. The arrays are always present, and an empty array is a deliberate 'all' value, not a missing field.
Why do I get 404 AUTOMATION_TYPE_NOT_FOUND?
The type in the path is not one of the supported automation types. Use one of the exact slugs listed in the API reference.
curl -X GET "$API_BASE_URL/v2/automations/blackout-period" \
-H "Authorization: Bearer "{
"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"
},
{
"id": "5d6e7f80-a1b2-4c3d-9e4f-0a1b2c3d4e5f",
"type": "blackout-period",
"name": "Product launch",
"isActive": false,
"ownerId": "user-0f3a9c1e-6c2b-4a5d-9e7f-1b2c3d4e5f60",
"createdAt": "2026-03-02T08:15:00.000Z",
"locationIds": [],
"departmentIds": [
"team-0a21c25e-6925-4a5b-90ee-ecf82096c4f6"
],
"labelIds": [],
"leaveTypeIds": [
"leaveType-fcc1e5c5-ba93-479d-bd58-8f860ba10615",
"leaveType-88681ca1-4a47-4e4d-bc35-ffff86c0f54e"
],
"startDate": "2026-05-11",
"endDate": "2026-05-15",
"recurring": false,
"reason": ""
}
]
}{
"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": "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" |
response
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | |||
| response.data | array<Automation> | Yes | ||
| response.data[] | blackout-period | maximum-users-away | seniority-entitlement | entitlement-by-role | probation-period | leave-duration-limit | leave-request-notice-period | |||
| 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 | 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 |