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.
| Key owner role | Reports returned | Location scope | Failure mode |
|---|---|---|---|
| Admin | Every scheduled report | All locations | None from role |
| Location admin | Only reports whose locationIds is not empty | Only locations they manage | None from role |
| Neither admin nor location admin | None | Not applicable | 403 FORBIDDEN |
Role rules apply on the Complete plan; other plans fail earlier with 403 SCHEDULED_REPORTS_NOT_AVAILABLE.
| Field | Presence | Meaning |
|---|---|---|
| id | Always | scheduled report ID |
| name | Always | report name |
| reportType | Always | the kind of report |
| period | Optional | the period the report covers; left out when it is not stored |
| locationIds | Always | IDs of the locations included; empty means all locations |
| departmentIds | Always | IDs of the departments included; empty means all departments |
| labelIds | Always | IDs of the labels included; empty means users with or without labels |
| receivers | Always | email addresses the report is sent to |
| timezone | Always | the time zone used for the report's dates; does not apply to sendHourUtc and sendMinuteUtc |
| sendDayOfMonth | Always | the day of the month the report is sent (1-31) |
| sendHourUtc | Always | the hour the report is sent, in UTC (0-23) |
| sendMinuteUtc | Always | the minute the report is sent, in UTC (0-59) |
| leaveStatus | Conditional | the leave statuses included, only for leaveHistoryReport; left out when none are stored |
| creatorId | Always | the ID of the user who created the report |
| error | Optional | the 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.
| Status | Code | Likely cause | First check |
|---|---|---|---|
| 401 | UNAUTHORIZED | Key missing, malformed, or unrecognized | Send a valid vt_live_ key as a Bearer token |
| 403 | INSUFFICIENT_SCOPE | Key lacks notifications:read | Add the scope in the dashboard |
| 403 | FORBIDDEN | Key owner is neither admin nor location admin | Confirm the key owner's role |
| 403 | SCHEDULED_REPORTS_NOT_AVAILABLE | Plan does not include scheduled reports | Confirm the Complete plan |
| 429 | RATE_LIMITED | Too many requests in a short time | Wait briefly and retry |
| 500 | INTERNAL_ERROR | Server-side failure | Retry 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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| response | object | |||
| response.data | array<ScheduledReport> | Yes | ||
| response.data[] | object | |||
| response.data[].id | string | Yes | scheduled report ID | |
| response.data[].name | string | Yes | report name | |
| response.data[].reportType | string | Yes | the kind of report | "leaveHistoryReport" | "leaveBalanceReport" | "monthlyLeaveBalanceReport" |
| response.data[].period | string | No | the period the report covers; left out when it is not stored | "LAST_MONTH" |
| response.data[].locationIds | array<string> | Yes | IDs of the locations included; empty means all locations | |
| response.data[].locationIds[] | string | |||
| response.data[].departmentIds | array<string> | Yes | IDs of the departments included; empty means all departments | |
| response.data[].departmentIds[] | string | |||
| response.data[].labelIds | array<string> | Yes | IDs of the labels included; empty means users with or without labels | |
| response.data[].labelIds[] | string | |||
| response.data[].receivers | array<string> | Yes | email addresses the report is sent to | |
| response.data[].receivers[] | string | |||
| response.data[].timezone | string | Yes | the time zone used for the report's dates. It does not apply to sendHourUtc and sendMinuteUtc. | |
| response.data[].sendDayOfMonth | integer | Yes | the day of the month the report is sent | 1 <= value <= 31 |
| response.data[].sendHourUtc | integer | Yes | the hour the report is sent, in UTC | 0 <= value <= 23 |
| response.data[].sendMinuteUtc | integer | Yes | the minute the report is sent, in UTC | 0 <= value <= 59 |
| response.data[].leaveStatus | array<ScheduledReportLeaveStatus> | No | the leave statuses included, only for leaveHistoryReport; left out when none are stored | |
| response.data[].leaveStatus[] | string | a leave status a leaveHistoryReport includes | "APPROVED" | "DENIED" | "EXPIRED" | "CANCELLED" | |
| response.data[].creatorId | string | Yes | the ID of the user who created the report | |
| response.data[].error | string | No | the last error that stopped the report from being sent; left out when there is none |
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 |