Preview a Report Schedule
print_mail.reports.preview_schedule(ReportPreviewScheduleParams**kwargs) -> SchedulePreview
POST/print-mail/v1/reports/schedule_previews
Work out when a schedule would actually run, without saving anything. Takes the same
fields as the schedule on a report, plus an optional sqlQuery so you can check
whether that query is schedulable at all (a parameterized query is not).
Parameters
day_of_month: Optional[int]
Monthly and yearly schedules only. Monthly schedules are capped at 28
so a run never skips a short month.
formatint32
minimum1
maximum31
day_of_week: Optional[int]
Weekly schedules only. 0 is Sunday through 6 for Saturday.
formatint32
minimum0
maximum6
month: Optional[int]
Yearly schedules only. 0 is January through 11 for December.
formatint32
minimum0
maximum11
Preview a Report Schedule
import os
from postgrid import PostGrid
client = PostGrid(
print_mail_api_key=os.environ.get("POSTGRID_PRINT_MAIL_API_KEY"), # This is the default and can be omitted
)
schedule_preview = client.print_mail.reports.preview_schedule(
interval=1,
time="09:00",
unit="w",
day_of_week=1,
notification_emails=["[email protected]"],
)
print(schedule_preview.day_of_month){
"frequency": "1w",
"nextRun": "2026-06-15T13:00:00Z",
"description": "Every week on Monday at 9:00 AM (America/Toronto)",
"firstRunLabel": "Monday, June 15, 2026 at 9:00 AM",
"dayOfMonth": 1,
"dayOfMonthOptions": [
{
"value": 1,
"label": "1st"
},
{
"value": 2,
"label": "2nd"
}
],
"queryHasParameters": false
}Returns Examples
{
"frequency": "1w",
"nextRun": "2026-06-15T13:00:00Z",
"description": "Every week on Monday at 9:00 AM (America/Toronto)",
"firstRunLabel": "Monday, June 15, 2026 at 9:00 AM",
"dayOfMonth": 1,
"dayOfMonthOptions": [
{
"value": 1,
"label": "1st"
},
{
"value": 2,
"label": "2nd"
}
],
"queryHasParameters": false
}