Skip to content

List scheduled reports

The scheduled reports list endpoint returns every scheduled report the calling API key is allowed to see. It is a single GET request to /v2/scheduled-reports, requires the notifications:read scope, and returns the full result set in one response rather than paging through records. The response shape and access rules below are the contract you should build against.

Request and authorization

Send a GET request to /v2/scheduled-reports with a bearer API key. The key must carry the notifications:read scope. Authentication details, key creation, and scope management live in the surrounding REST API v2 documentation; this page focuses on the list operation itself.

The endpoint has no pagination parameters. Whatever the key can see comes back in a single data array, so plan your client around one response rather than a cursor loop.

Who sees which reports

Visibility depends on the role of the key owner. An admin sees every scheduled report. A location admin sees a narrower set: only reports whose locationIds is not empty, and within those reports only the locations that location admin manages. A key owner who is neither an admin nor a location admin cannot use the endpoint and receives 403 FORBIDDEN.

Use this decision table before you debug a surprising result set:

Plan requirement

Scheduled reports require the Complete plan. On any other plan, every scheduled-report operation fails with 403 SCHEDULED_REPORTS_NOT_AVAILABLE. That is a different failure from a role problem: the plan gate applies before role-based visibility matters, so check the plan first if a key that should work returns 403.

Reading the response

A successful call returns a data array of scheduled report objects. Each object carries an id, name, reportType, period, locationIds, departmentIds, labelIds, receivers, timezone, sendDayOfMonth, sendHourUtc, sendMinuteUtc, and creatorId. Two fields are conditional: period is omitted when it is not stored, and leaveStatus appears only for leaveHistoryReport and is omitted when none are stored. An optional error field can also appear on a report object.

A few field semantics are easy to misread. Empty locationIds means all locations; empty departmentIds means all departments; empty labelIds means users with or without labels. The timezone field governs the report's dates but does not apply to sendHourUtc and sendMinuteUtc, which are always UTC. sendDayOfMonth runs from 1 to 31, sendHourUtc from 0 to 23, and sendMinuteUtc from 0 to 59. reportType is one of leaveHistoryReport, leaveBalanceReport, or monthlyLeaveBalanceReport; period, when present, is LAST_MONTH; leaveStatus values are APPROVED, DENIED, EXPIRED, or CANCELLED.

Error responses and how to tell them apart

Every error uses the same envelope: an error object with code, name, description, resolution, requestId, and optional details. The status code narrows the cause, but the code field is what your client should branch on.

401 means the key is missing, malformed, or unrecognized; the resolution is to send a valid vt_live_ key as a Bearer token. 403 covers several distinct situations: a missing scope (INSUFFICIENT_SCOPE, with requiredScopes in details), a role that cannot perform the action, or the plan gate SCHEDULED_REPORTS_NOT_AVAILABLE. 429 means too many requests were sent in a short time; wait briefly and retry. 500 means something failed on the server side; retry later and quote the requestId if it persists.

A practical triage order: confirm the key is present and well formed, confirm notifications:read is attached, confirm the plan includes scheduled reports, then confirm the key owner's role. That sequence avoids chasing a role problem when the real cause is a missing scope or plan.

Worked example

Suppose a key with notifications:read belongs to an admin on the Complete plan. The call returns two reports. The first, named "Monthly balances", is a leaveBalanceReport with empty locationIds, departmentIds, and labelIds, so it covers all locations, departments, and labels. Its timezone is Europe/Belgrade, it sends on day 1 at 07:30 UTC, and it has no leaveStatus because it is not a leave history report. The second, "Los Angeles leave history", is a leaveHistoryReport scoped to one location, with leaveStatus APPROVED and DENIED, sending on day 2 at 16:00 UTC in America/Los_Angeles.

Now change the key owner to a location admin who manages only the Los Angeles location. The first report drops out because its locationIds is empty, and the second remains but is limited to the managed location. If the key owner is neither an admin nor a location admin, the call fails with 403 FORBIDDEN instead of returning an empty list.

Role-based visibility for the scheduled reports list
Key owner roleReports returnedLocation scopeFailure mode
AdminEvery scheduled reportAll locationsNone from role
Location adminOnly reports whose locationIds is not emptyOnly locations they manageNone from role
Neither admin nor location adminNoneNot applicable403 FORBIDDEN

Role rules apply on the Complete plan; other plans fail earlier with 403 SCHEDULED_REPORTS_NOT_AVAILABLE.

Scheduled report response field map
FieldPresenceMeaning
idAlwaysscheduled report ID
nameAlwaysreport name
reportTypeAlwaysthe kind of report
periodOptionalthe period the report covers; left out when it is not stored
locationIdsAlwaysIDs of the locations included; empty means all locations
departmentIdsAlwaysIDs of the departments included; empty means all departments
labelIdsAlwaysIDs of the labels included; empty means users with or without labels
receiversAlwaysemail addresses the report is sent to
timezoneAlwaysthe time zone used for the report's dates; does not apply to sendHourUtc and sendMinuteUtc
sendDayOfMonthAlwaysthe day of the month the report is sent (1-31)
sendHourUtcAlwaysthe hour the report is sent, in UTC (0-23)
sendMinuteUtcAlwaysthe minute the report is sent, in UTC (0-59)
leaveStatusConditionalthe leave statuses included, only for leaveHistoryReport; left out when none are stored
creatorIdAlwaysthe ID of the user who created the report
errorOptionalthe last error that stopped the report from being sent; left out when there is none

Field presence and value constraints follow the response schema; optional fields are omitted rather than null when absent.

Error triage for the scheduled reports list
StatusCodeLikely causeFirst check
401UNAUTHORIZEDKey missing, malformed, or unrecognizedSend a valid vt_live_ key as a Bearer token
403INSUFFICIENT_SCOPEKey lacks notifications:readAdd the scope in the dashboard
403FORBIDDENKey owner is neither admin nor location adminConfirm the key owner's role
403SCHEDULED_REPORTS_NOT_AVAILABLEPlan does not include scheduled reportsConfirm the Complete plan
429RATE_LIMITEDToo many requests in a short timeWait briefly and retry
500INTERNAL_ERRORServer-side failureRetry later and quote the requestId

The 403 status covers three distinct codes; branch on the code field rather than the status alone.

Frequently asked questions

Does the scheduled reports list endpoint paginate?

No. The endpoint returns the reports the key can see in one response, with no pagination parameters or cursor.

What does an empty locationIds array mean on a report?

It means all locations are included. A location admin, however, only sees reports whose locationIds is not empty, so reports with an empty array are not returned to that role.

Does the timezone field change the send time?

No. timezone applies to the report's dates, but sendHourUtc and sendMinuteUtc are always expressed in UTC.

Why does a valid key get 403 on this endpoint?

Three causes are possible: the key lacks notifications:read (INSUFFICIENT_SCOPE), the plan does not include scheduled reports (SCHEDULED_REPORTS_NOT_AVAILABLE), or the key owner is neither an admin nor a location admin (FORBIDDEN). Check the error code to tell them apart.

When is leaveStatus present in the response?

Only for a leaveHistoryReport, and only when statuses are stored. It is omitted otherwise.

curl -X GET "$API_BASE_URL/v2/scheduled-reports" \
  -H "Authorization: Bearer "
{
  "data": [
    {
      "id": "scheduledReport-8a47c61e-2b7f-4d5e-9c61-3f1c2b9e1d93",
      "name": "Monthly balances",
      "reportType": "leaveBalanceReport",
      "period": "LAST_MONTH",
      "locationIds": [],
      "departmentIds": [],
      "labelIds": [],
      "receivers": [
        "[email protected]"
      ],
      "timezone": "Europe/Belgrade",
      "sendDayOfMonth": 1,
      "sendHourUtc": 7,
      "sendMinuteUtc": 30,
      "creatorId": "user-63b17e97-d38b-4586-8498-bb4f5d2e2c14"
    },
    {
      "id": "scheduledReport-1d93c61e-8a47-4b7f-9d5e-2b7f3f1c2b9e",
      "name": "Los Angeles leave history",
      "reportType": "leaveHistoryReport",
      "period": "LAST_MONTH",
      "locationIds": [
        "location-79c77ac8-e5bf-479f-9488-648a58379ff1"
      ],
      "departmentIds": [],
      "labelIds": [],
      "receivers": [
        "[email protected]"
      ],
      "timezone": "America/Los_Angeles",
      "sendDayOfMonth": 2,
      "sendHourUtc": 16,
      "sendMinuteUtc": 0,
      "leaveStatus": [
        "APPROVED",
        "DENIED"
      ],
      "creatorId": "user-63b17e97-d38b-4586-8498-bb4f5d2e2c14"
    }
  ]
}
{
  "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": "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"
  }
}

response

FieldTypeRequiredDescriptionConstraints
responseobject
response.dataarray<ScheduledReport>Yes
response.data[]object
response.data[].idstringYesscheduled report ID
response.data[].namestringYesreport name
response.data[].reportTypestringYesthe kind of report"leaveHistoryReport" | "leaveBalanceReport" | "monthlyLeaveBalanceReport"
response.data[].periodstringNothe period the report covers; left out when it is not stored"LAST_MONTH"
response.data[].locationIdsarray<string>YesIDs of the locations included; empty means all locations
response.data[].locationIds[]string
response.data[].departmentIdsarray<string>YesIDs of the departments included; empty means all departments
response.data[].departmentIds[]string
response.data[].labelIdsarray<string>YesIDs of the labels included; empty means users with or without labels
response.data[].labelIds[]string
response.data[].receiversarray<string>Yesemail addresses the report is sent to
response.data[].receivers[]stringemail
response.data[].timezonestringYesthe time zone used for the report's dates. It does not apply to sendHourUtc and sendMinuteUtc.
response.data[].sendDayOfMonthintegerYesthe day of the month the report is sent1 <= value <= 31
response.data[].sendHourUtcintegerYesthe hour the report is sent, in UTC0 <= value <= 23
response.data[].sendMinuteUtcintegerYesthe minute the report is sent, in UTC0 <= value <= 59
response.data[].leaveStatusarray<ScheduledReportLeaveStatus>Nothe leave statuses included, only for leaveHistoryReport; left out when none are stored
response.data[].leaveStatus[]stringa leave status a leaveHistoryReport includes"APPROVED" | "DENIED" | "EXPIRED" | "CANCELLED"
response.data[].creatorIdstringYesthe ID of the user who created the report
response.data[].errorstringNothe last error that stopped the report from being sent; left out when there is none

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