Skip to main content

Create Schedule

  POST https://api.letpay.io/myreports/schedule

Create a new Schedule

This endpoint is used to schedule the execution of a report at a specified time.

Schedules can be created for daily, weekly, or monthly execution by specifying:

  • The day of the month (for monthly schedules).
  • The day of the week (for weekly schedules).
  • The time of execution.

Request description

  • report: (required/object) - The report associated with the schedule.
    • id: (optional/int) - The unique identifier of the report.
  • run_every: (required/string) - Specifies the frequency of execution. Accepted values are:
    • DAILY
    • WEEKLY
    • MONTHLY
  • day_of_week: (optional/string) - Specifies the day of the week when the report will be executed. Required when the frequency is WEEKLY.
  • day_of_month: (optional/int) - Specifies the day of the month when the report will be executed. Required when the frequency is MONTHLY.
  • run_at: (required/time (HH:mm)) - Specifies the exact time at which the report will run. Example: 14:30 (2:30 PM).
  • recipient: (required/string) - Specifies the email addresses to which the report will be sent. Multiple emails can be separated by commas.
  • enable: (required/boolean) - Determines whether the schedule is enabled or disabled.

Authorization

AUTHORIZATIONAPI Key
KeyX-Auth-Token
ValueMY_ACCESS_TOKEN

Body Raw(json)

json
{
"report": {
"id": {{reportId}}
},
"run_every": "MONTHLY",
"day_of_week": null,
"day_of_month": 5,
"run_at": "08:07:00",
"recipient":"[email protected]",
"enable": true
}

Example Request

Example Request

201 - WEEKLY
    curl --location -g 'https://api.letpay.io/myreports/schedule' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data-raw '{
"report": {
"id": 183
},
"run_every": "WEEKLY",
"day_of_week": "WEDNESDAY",
"run_at": "08:07:00",
"recipient":"[email protected]",
"enable": true
}'

Example Response

Header
  Content-Type: application/json
Body
    {
"id": 20,
"report": {
"id": 183
},
"run_every": "WEEKLY",
"day_of_week": "WEDNESDAY",
"day_of_month": null,
"run_at": "08:00:00",
"recipient": "[email protected]",
"enable": true
}