Skip to content

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

  1. 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

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"

response

FieldTypeRequiredDescriptionConstraints
responseobject
response.dataarray<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].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
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