Update a Forward session title, metadata, environment variables, or model configuration.
POST /api/v1/forward/sessions/{session_id}
config supports updates to environment_variables and model. Model updates apply only to this Session and do not modify the Template or Identity Config.
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. Only environment_variables and model are allowed. null is invalid; omission or {} leaves the existing configuration unchanged. |
config.environment_variables | object<string, string> (recommended) | No | Session environment variables. For new integrations, pass every value as a string. 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.model | string | object | null | No | A non-null value replaces the entire Session model override; null removes the override and restores inheritance. Omission keeps the current override. |
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. - Use strings for values; object and array values are invalid.
- 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.
config.model
config.model accepts a non-empty model ID string (for example, "ultimate") or an object containing a model ID and optional tuning parameters, using the same format as Template / Identity Config. See List models for available models and supported options.
| Object field | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Non-empty model ID from the id returned by List models. |
| effort | string | No | Reasoning effort: none, low, medium, high, xhigh, or max. Supported levels are defined by the model's efforts; if omitted, the model default is used. |
| speed | string | No | Inference speed: standard or high; defaults to standard. Supported speeds are defined by the model's speed array. |
| context_window | integer | No | Context window in tokens. Must be a positive integer selected from the model's available_context_windows; if omitted, the model default window is used. |
- Omit
config.model: keep the current configuration. - Pass a string or object: replace the entire model configuration. Previous options not supplied are not retained. The new configuration applies to subsequent model calls.
- Pass
null: remove the Session model override and inherit the current Template / Identity Config model. - Pass
{}: returns HTTP 400. A model object must contain a non-emptyid.
template.model is the template summary. See config.model in the response for the Session model override.
Example request
Example response
HTTP 200 OK
Response fields
Returns the updated Session object.
| Field | Type | Description |
|---|---|---|
config.model | string | object | The saved Session model override retains its string or object form; omitted when the override is removed. |
Errors
| HTTP | Type | Code | Trigger |
|---|---|---|---|
| 503 | api_error | session_materialization_busy | Refreshing Session configuration for a config.environment_variables or config.model update encounters a runtime version or state conflict. The response includes Retry-After: 1; wait for the current Turn to finish before retrying. |
| 400 | invalid_request_error | invalid_request | Invalid update body, including invalid config.model ( {}, an empty ID, or invalid types or parameters), or unsupported configuration fields. |
| 400 | invalid_request_error | invalid_request_body | Invalid JSON body, or invalid config or config.environment_variables. |
| 404 | not_found_error | session_not_found | Session does not exist. |
| 409 | invalid_request_error | session_archived | Session is archived. |
| 401 | authentication_error | - | PAT or SAT invalid or expired. |
Notes
- Updating only the title or metadata does not trigger this configuration refresh. If an environment variable or model update returns
session_materialization_busy, followRetry-After, wait for the current Turn to finish, and retry with the same request body. If the original request includedIdempotency-Key, reuse that key. This temporary rejection is not cached as a final idempotent response; this rule applies only to this error code. 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.- For compatibility with existing calls only, non-string scalar values are normalized to strings (
nullbecomes an empty string). For new integrations, use string values.

