Skip to main content
The Trigger.dev management API lets you control and inspect every aspect of your background tasks from outside of a running task. Use it to trigger tasks, list and cancel runs, manage schedules, pause queues, create waitpoints, and set environment variables.

Base URL

All API requests go to:
https://api.trigger.dev

Installation

The management API is available through the @trigger.dev/sdk package. If you have already installed the package, you can skip this step.
npm i @trigger.dev/sdk@latest

Usage

All management functionality is exported from @trigger.dev/sdk. Configure the client once with your secret key and then call the management functions.
import { configure, runs } from "@trigger.dev/sdk";

configure({
  // secretKey defaults to process.env["TRIGGER_SECRET_KEY"]
  secretKey: process.env["TRIGGER_SECRET_KEY"],
});

async function main() {
  const page = await runs.list({
    limit: 10,
    status: ["COMPLETED"],
  });

  for (const run of page.data) {
    console.log(run.id, run.status);
  }
}

main().catch(console.error);

Available resources

Tasks

Trigger tasks and batch-trigger multiple runs at once.

Runs

List, retrieve, cancel, and replay task runs.

Schedules

Create and manage CRON-based schedules for your tasks.

Queues

Inspect and pause/resume your task queues.

Waitpoints

Create tokens to pause runs until an external event completes them.

Environment Variables

Read and write environment variables for your project environments.

Build docs developers (and LLMs) love