Schedules
Set up
Section titled “Set up”npm install @reminix/sdkimport { createClient } from "@reminix/sdk";
const reminix = createClient(); // reads REMINIX_API_KEYpip install reminixfrom reminix import Reminix
reminix = Reminix() # reads REMINIX_API_KEYnpm install -g @reminix/clireminix loginexport REMINIX_API_KEY="<your API key>"List a script’s schedules
Section titled “List a script’s schedules”GET /v1/scripts/{slug}/schedules
Its schedules, with when each runs next.
await reminix.schedules.list("monthly-report");reminix.schedules.list("monthly-report")reminix schedules list monthly-reportcurl -X GET "https://api.reminix.com/v1/scripts/monthly-report/schedules" \ -H "Authorization: Bearer $REMINIX_API_KEY"| Field | Description |
|---|---|
slug |
Schedule a script
Section titled “Schedule a script”POST /v1/scripts/{slug}/schedules
Runs the published version on a 5-field cron in a timezone, with these inputs, as you — at least 5 minutes apart.
await reminix.schedules.create("monthly-report", { name: "First of the month", cron: "0 8 1 * *",});reminix.schedules.create( "monthly-report", name="First of the month", cron="0 8 1 * *",)reminix schedules create \ monthly-report \ --name 'First of the month' \ --cron '0 8 1 * *'curl -X POST "https://api.reminix.com/v1/scripts/monthly-report/schedules" \ -H "Authorization: Bearer $REMINIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"First of the month","cron":"0 8 1 * *"}'| Field | Description |
|---|---|
slug | |
name | A name for the schedule, shown in the app. |
cron | When it runs, as a cron expression (minute hour day month weekday). |
timezone | The timezone the cron is read in. Default: UTC. |
inputs | The script's inputs for each run, by name. |
environment | The environment its runs use. Default: the request's (X-Environment), else the workspace's default. |
More about this endpoint
Switched off (with why) if you can no longer run it.
Change a schedule
Section titled “Change a schedule”PATCH /v1/scripts/{slug}/schedules/{scheduleId}
Its name, cron, timezone, inputs, or switch it on or off.
await reminix.schedules.update("monthly-report", "<schedule-id>");reminix.schedules.update("monthly-report", "<schedule-id>")reminix schedules update monthly-report '<schedule-id>'curl -X PATCH "https://api.reminix.com/v1/scripts/monthly-report/schedules/<schedule-id>" \ -H "Authorization: Bearer $REMINIX_API_KEY" \ -H "Content-Type: application/json" \ -d '{}'| Field | Description |
|---|---|
slug | |
scheduleId | |
name | A name for the schedule, shown in the app. |
cron | When it runs, as a cron expression (minute hour day month weekday). |
timezone | The timezone the cron is read in. Default: UTC. |
inputs | The script's inputs for each run, by name. |
enabled | Whether it runs. Default: true. |
environment | Move its runs to another environment. |
More about this endpoint
Its creator, or an owner or admin.
Delete a schedule
Section titled “Delete a schedule”DELETE /v1/scripts/{slug}/schedules/{scheduleId}
Its creator, or an owner or admin.
await reminix.schedules.delete("monthly-report", "<schedule-id>");reminix.schedules.delete("monthly-report", "<schedule-id>")reminix schedules delete monthly-report '<schedule-id>' --yescurl -X DELETE "https://api.reminix.com/v1/scripts/monthly-report/schedules/<schedule-id>" \ -H "Authorization: Bearer $REMINIX_API_KEY"| Field | Description |
|---|---|
slug | |
scheduleId |