Update session
Update a session’s tags or metadata. Pass metadata: null to clear it.
Requires a secret key — a session public token cannot update a session. externalId is read-only after create: it cannot be changed or cleared. Sending a value different from the current one (including null when one is set) returns 422; sending the same value is accepted as a no-op.
Authorizations
Use your project-specific Secret API key. Will start with tr_dev_, tr_prod, tr_stg, etc.
You can find your Secret API key in the API Keys section of your Trigger.dev project dashboard.
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.
import { configure } from "@trigger.dev/sdk";
configure({ accessToken: "tr_dev_1234" });
Path Parameters
The session's friendly ID (session_…) or your externalId. The server disambiguates by the session_ prefix.
Body
Body for PATCH /api/v1/sessions/{session}. The whole body must be 32KB or smaller. Every field is optional; omitted fields are left unchanged.
Replaces the tags on the session row.
10128Replaces the metadata. Pass null to clear it.
Read-only after create: cannot be changed or cleared. Sending a value different from the current one (including null when one is set) returns 422; sending the same value is idempotent.
1 - 256Response
Session updated successfully
A session row.
The session's friendly ID, prefixed with session_.
"session_abc123"
The session type discriminator.
"chat.agent"
The task this session triggers runs against.
"my-chat"
Tags on the session row.
["chat:1234"]
Your stable identity for the session, if one was set.
"chat_1234"
Trigger options applied to every run a session schedules. basePayload is the wire payload merged into each run; the remaining fields map onto the standard trigger options.
Friendly ID of the live run for this session, if any. Prefixed with run_. Omitted on list rows.
"run_def456"
Arbitrary JSON metadata, or null if unset.
When the session was closed, or null if open.
The optional reason recorded when the session was closed.
The session's retention deadline, or null if none.

