Skip to content

Schedules

Terminal window
npm install @reminix/sdk
import { createClient } from "@reminix/sdk";
const reminix = createClient(); // reads REMINIX_API_KEY

GET /v1/scripts/{slug}/schedules

Its schedules, with when each runs next.

await reminix.schedules.list("monthly-report");
FieldDescription
slugstring, path, required

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 * *",
});
FieldDescription
slugstring, path, required
namestring, requiredA name for the schedule, shown in the app.
cronstring, requiredWhen it runs, as a cron expression (minute hour day month weekday).
timezonestringThe timezone the cron is read in. Default: UTC.
inputsobjectThe script's inputs for each run, by name.
environmentstringThe 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.

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>");
FieldDescription
slugstring, path, required
scheduleIdstring, path, required
namestringA name for the schedule, shown in the app.
cronstringWhen it runs, as a cron expression (minute hour day month weekday).
timezonestringThe timezone the cron is read in. Default: UTC.
inputsobjectThe script's inputs for each run, by name.
enabledbooleanWhether it runs. Default: true.
environmentstringMove its runs to another environment.
More about this endpoint

Its creator, or an owner or admin.

DELETE /v1/scripts/{slug}/schedules/{scheduleId}

Its creator, or an owner or admin.

await reminix.schedules.delete("monthly-report", "<schedule-id>");
FieldDescription
slugstring, path, required
scheduleIdstring, path, required