sessions
Close a session
Changed onClose a session. Closing is terminal and idempotent — closing an already-closed session returns the existing row unchanged. A closed session cannot be reopened, and reusing its externalId on create returns 409.
Requires a secret key — a session public token cannot close a session.
post/api/v1/sessions/{session}/close
Request
- Base URLhttps://api.trigger.dev
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"reason": "user signed out"
}Response
Session closed successfully. Returns the session row.
Example response
{
"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"
]
}Changes
- info
endpoint added
- info