# Update a session

Launch stage: Beta

`PATCH /api/2.0/agents/{name=session-stores/*/sessions/*}`

Updates a session's mutable fields.

API scopes: agent-kit

## Path parameters

- `name` (string, required, ID, Immutable)
  Resource name in the form `session-stores/{session_store_id}/sessions/{session_id}`.

## Query parameters

- `update_mask` (string, required)
  Fields to update. Only `metadata` is mutable; any other path returns
   `INVALID_PARAMETER_VALUE`.

## Request body

Session to update.
- `actor_id` (string, required, Immutable)
  Opaque caller-provided identifier for the application actor associated with the session.
  
   This is application data and has no Databricks authentication or authorization semantics.
   Use the same value as the Managed Memory Entry `actor_id` when storing memories associated
   with this actor. Every session must set it. A child session must use the same value as its parent.
- `parent_session_id` (string, optional, Immutable)
  Immediate parent session ID. Set only at creation for child sessions, immutable thereafter, and
   restricted to the same store.
- `metadata` (object, optional)
  Mutable caller-defined string labels.

## Returns

Returns the Session object.

## Response

```json
{
  "session_id": "string",
  "actor_id": "string",
  "parent_session_id": "string",
  "root_session_id": "string",
  "metadata": {},
  "create_time": "string",
  "update_time": "string",
  "last_activity_time": "string",
  "name": "string"
}
```

