Skip to main content
POST
See the Query documentation for comprehensive examples including:
  • Failed runs analysis
  • Task success rates over time
  • Cost tracking and optimization
  • Performance metrics and percentiles

Authorizations

Authorization
string
header
required

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.

Body

application/json
query
string
required

The TRQL query to execute

Example:

"SELECT run_id, status, triggered_at FROM runs WHERE status = 'Failed' LIMIT 10"

scope
enum<string>
default:environment

The scope of data to query - environment (default), project, or organization

Available options:
environment,
project,
organization
period
string | null

Time period shorthand (e.g., "7d", "30d", "1h"). Cannot be used with from/to.

Example:

"7d"

from
string<date-time> | null

Start of time range as ISO 8601 timestamp. Must be used with 'to'.

Example:

"2024-01-01T00:00:00Z"

to
string<date-time> | null

End of time range as ISO 8601 timestamp. Must be used with 'from'.

Example:

"2024-01-31T23:59:59Z"

format
enum<string>
default:json

Response format - "json" returns structured data (default), "csv" returns CSV string

Available options:
json,
csv

Response

Query executed successfully

JSON format response

format
enum<string>
Available options:
json
results
object[]

Array of result rows