Skip to Content

List Schedules

Required accessSchedules: readread:schedulesAny key with this access, from API keys
GET
/api/v1/schedules

List all schedules. You can also paginate the results.

Authorization

secretKey
headerAuthorizationBearer <token>

Use a named environment API key. It starts with tr_dev_sk_, tr_prod_sk_, tr_stg_sk_, etc.

Create a named API key in the API Keys section of your Trigger.dev project dashboard. Choose the narrowest access preset that supports your integration.

Our TypeScript SDK will default to using the value of the TRIGGER_SECRET_KEY environment variable if it is set. If you are using the SDK in a different environment, you can set the key using the configure function.

import { configure } from "@trigger.dev/sdk";configure({ accessToken: "tr_dev_sk_1234" });

Query Parameters

page?integer

Page number of the schedule listing

perPage?integer

Number of schedules per page

Response Body

Successful request

application/json
  1. response
data?array<>
pagination?
Example Request
import { schedules } from "@trigger.dev/sdk";const allSchedules = await schedules.list();
Example Response
{  "data": [    {      "id": "sched_1234",      "task": "my-scheduled-task",      "type": "IMPERATIVE",      "active": true,      "deduplicationKey": "dedup_key_1234",      "externalId": "user_1234",      "generator": {        "type": "CRON",        "expression": "0 0 * * *",        "description": "Every day at midnight"      },      "timezone": "America/New_York",      "nextRun": "2024-04-01T00:00:00Z",      "appliedSchedulePolicy": {        "minimumWindowSeconds": 3600,        "reason": "free_schedule"      },      "environments": [        {          "id": "string",          "type": "string",          "userName": "string"        }      ]    }  ],  "pagination": {    "currentPage": 0,    "totalPages": 0,    "count": 0  }}

Was this page helpful?

Last updated

Edit on GitHub