GET
/
api
/
v1
/
projects
/
{projectRef}
/
runs
import { runs, configure } from "@trigger.dev/sdk/v3";

configure({
  secretKey: "tr_pat_1234" // always use an environment variable for this
});

// Get the first page of runs
let page = await runs.list("proj_1234", { limit: 20 });

for (const run of page.data) {
  console.log(`Run ID: ${run.id}, Status: ${run.status}`);
}

// Convenience methods are provided for manually paginating:
while (page.hasNextPage()) {
  page = await page.getNextPage();
  // Do something with the next page of runs
}

// Auto-paginate through all runs
const allRuns = [];

for await (const run of runs.list("proj_1234", { limit: 20 })) {
  allRuns.push(run);
}

Authorizations

Authorization
string
headerrequired

Use your user-specific Personal Access Token, which you can generate from the Trigger.dev dashboard in your account settings. (It will start with tr_pat_.)

Our TypeScript SDK will default to using the value of the TRIGGER_ACCESS_TOKEN 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/v3";

configure({ secretKey: "tr_pat_1234" });

Path Parameters

projectRef
string
required

The external ref of the project. You can find this in the project settings. Starts with proj_.

Query Parameters

page
object

Use this parameter to paginate the results. You can specify the number of runs per page, and the ID of the run to start the page after or before.

For object fields like page, you should use the "form" encoding style. For example, to get the next page of runs, you can use page[after]=run_1234.

filter
object

Use this parameter to filter the runs. You can filter by created at, environment, status, task identifier, and version.

For array fields, you can provide multiple values to filter by using a comma-separated list. For example, to get QUEUED and EXECUTING runs, you can use filter[status]=QUEUED,EXECUTING.

For object fields, you should use the "form" encoding style. For example, to filter by the period, you can use filter[createdAt][period]=1d.

Response

200 - application/json
data
object[]
pagination
object