Skip to main content
There are two ways to authenticate with the management API:
  • Secret key (tr_dev_… / tr_prod_…) — scoped to a single environment in a project.
  • Personal Access Token (PAT) (tr_pat_…) — tied to a user account and can access all orgs, projects, and environments that user has permission to.
Both methods should only be used in backend server code. They provide full access to the project. See the Realtime guide for frontend authentication.

Secret key

Secret key authentication scopes API access to a specific environment. Obtain a secret key from your project’s API Keys page in the Trigger.dev dashboard.
Send the key as a Bearer token in the Authorization header for direct HTTP requests:

Personal Access Token (PAT)

A PAT grants access to all the orgs, projects, and environments the user has permission to. Because a PAT does not scope access to a specific environment, you must provide the projectRef (and sometimes the environment) for calls that require it.

Endpoint support matrix

Preview branch targeting

When working with preview branches you can target a specific branch by including the x-trigger-branch header (HTTP) or the previewBranch option (SDK).
The x-trigger-branch header only applies to the preview environment. It has no effect on dev, staging, or prod.