List sessions
Changed onList sessions in the current environment, newest first. Filter by type, tags, task identifier, external id, status, and creation window. Use cursor-based pagination with page[after] and page[before] to navigate pages.
List rows omit triggerConfig; retrieve a single session to read it.
Request
- Base URLhttps://api.trigger.dev
- Auth
- HTTP bearer
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
Paginate the results. Specify the number of sessions per page, and the ID of the session to start the page after or before.
For object fields like page, use the "form" encoding style. For example, to get the next page, use page[after]=session_1234.
Use this parameter to filter the sessions. You can filter by type, tags, task identifier, external id, status, and created at.
For array fields, you can provide multiple values to filter by using a comma-separated list. For example, to get ACTIVE and CLOSED sessions, you can use filter[status]=ACTIVE,CLOSED.
For object fields, you should use the "form" encoding style. For example, to filter by the period, you can use filter[createdAt][period]=1d.
{
"type": [
"chat.agent"
],
"createdAt": {
"period": "1d"
}
}Response
Successful request
Example response
{
"data": [
{
"id": "session_abc123",
"externalId": "chat_1234",
"type": "chat.agent",
"taskIdentifier": "my-chat",
"triggerConfig": {
"machine": "small-1x",
"lockToVersion": "20240523.1"
},
"currentRunId": "run_def456",
"tags": [
"chat:1234"
]
}
],
"pagination": {
"next": "session_abc123",
"previous": "session_xyz789"
}
}Changes
- info
endpoint added
- info