Update a Forward session title, metadata, or environment variables.
POST /api/v1/forward/sessions/{session_id}
Updates stable Session fields. In config, this endpoint currently supports only environment_variables.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Content-Type | Yes | application/json |
Idempotency-Key | No | Optional idempotency key for unsafe requests. |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
session_id | string | Yes | Session ID. |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | New session title. |
metadata | object | No | Metadata merge patch. Provided keys overwrite existing keys; omitted keys remain unchanged. |
config | object | No | Session configuration update. Currently, only environment_variables is allowed. null is invalid. |
config.environment_variables | object | No | Session environment variable key-value pairs. Values must be strings. null is invalid. The supplied map replaces the entire existing set of Session-level environment variables. The replacement is then merged on top of the compiled Template + Identity Config result, with Session-level values overriding base-layer values with the same key. |
config.environment_variables:
- Omitted, or
configis{}: leave the environment variables unchanged. - Non-empty object: replace the entire Session-level environment variable map. It is not incrementally merged with the previous map, and existing keys that are omitted are deleted.
- Empty object
{}: clear all Session-level environment variables. - The replacement applies only to the Session-level layer. After the update, the Session runtime environment variables are still merged on top of the compiled Template + Identity Config result, with Session-level values overriding base-layer values with the same key.
- The runtime validates environment variable names, reserved words, and capacity limits. Invalid values return HTTP 400.
Example request
Example response
HTTP 200 OK
Response fields
Returns the updated Session object.
Errors
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request | Invalid update body. |
| 400 | invalid_request_error | invalid_request_body | Invalid JSON body, or config or config.environment_variables is null. |
| 401 | authentication_error | authentication_required | PAT or SAT invalid or expired. |
| 404 | not_found_error | session_not_found | Session does not exist. |
| 409 | conflict_error | session_archived | Session is archived. |
Notes
resourcesis a create-time setting and cannot be changed here. To add a file resource while the session is in progress, use the Add a session resource endpoint.config.environment_variablesin the response reflects the updated result.