---
title: "Update session"
method: PATCH
path: "/sessions/{session_id}"
tags: ["Sessions"]
---

# Update session

`PATCH /sessions/{session_id}`

## Request

- Base URL: `https://api.metorial.com`
- URL: `https://api.metorial.com/sessions/{session_id}`
- Auth: HTTP bearer

Updates a session.

## Path parameters

- `session_id` string, required

## Headers

- `Metorial-Version` string

## Request body

- BodyRequest51
  - `name` string
  - `description` string
  - `metadata` object: Custom key-value pairs for storing additional information

## Response `200`

Successful response

- ProviderSession
  - `object` 'session', required: String representing the object's type
  - `id` string, required: Unique session identifier
  - `status` 'active' | 'archived' | 'deleted', required: Session status
  - `name` string, nullable, required: Display name
  - `description` string, nullable, required: Description
  - `metadata` object, nullable, required: Custom key-value pairs for storing additional information
  - `connection_state` 'connected' | 'disconnected', required: Session connection state
  - `connection_url` string, required: MCP connection URL for this session
  - `client_secret` string, nullable, required: Session-scoped fine grained client secret token
  - `usage` Usage, required
    - `total_productive_client_message_count` number, required: Total productive client messages
    - `total_productive_provider_message_count` number, required: Total productive provider messages
  - `providers` Provider5[], required: Session providers
    - `object` 'session.provider', required: String representing the object's type
    - `id` string, required: Unique session provider identifier
    - `status` 'active' | 'archived' | 'deleted', required: Provider status
    - `usage` Usage2, required: Usage statistics
      - `total_productive_client_message_count` number, required: Total productive client messages
      - `total_productive_provider_message_count` number, required: Total productive provider messages
    - `tool_filter` union, required: Tool filter configuration
      - object
        - `type` 'allow_all', required
        - `ignore_parent_filters` boolean, required
      - ToolFilter
        - `type` 'filter', required
        - `filters` union[], required
          - union
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
        - `ignore_parent_filters` boolean, required
    - `provider_id` string, required: Provider ID
    - `session_id` string, required: Parent session ID
    - `from_template_id` string, nullable, required: Source template ID
    - `from_template_provider_id` string, nullable, required: Source template provider ID
    - `deployment` Deployment2, required
      - `object` 'provider.deployment#preview', required: String representing the object's type
      - `id` string, required: Deployment ID
      - `is_default` boolean, required: Whether this is the default deployment
      - `name` string, nullable, required: Deployment name
      - `description` string, nullable, required: Description
      - `metadata` object, nullable, required: Custom key-value pairs for storing additional information
      - `provider_id` string, required: Provider ID
      - `created_at` string, date-time, required: Timestamp when created
      - `updated_at` string, date-time, required: Timestamp when last updated
    - `config` Config3, required
      - `object` 'provider.config#preview', required: String representing the object's type
      - `id` string, required: Config ID
      - `is_default` boolean, required: Whether this is the default config
      - `name` string, nullable, required: Config name
      - `description` string, nullable, required: Description
      - `metadata` object, nullable, required: Custom key-value pairs for storing additional information
      - `provider_id` string, required: Provider ID
      - `created_at` string, date-time, required: Timestamp when created
      - `updated_at` string, date-time, required: Timestamp when last updated
    - `auth_config` object, nullable, required
      - `object` 'provider.auth_config#preview', required
      - `id` string, required
    - `created_at` string, date-time, required: Timestamp when created
    - `updated_at` string, date-time, required: Timestamp when last updated
  - `from_template_ids` string[], required: Template IDs this session was created from
  - `has_errors` boolean, required: Whether the session has any errors
  - `has_warnings` boolean, required: Whether the session has any warnings
  - `identity_actor_id` string, nullable, required
  - `access` Access, required: Resource ownership and access settings.
    - `source` 'explorer', nullable, required: Integration resource source, or null when the resource is not from Explorer.
    - `type` 'public' | 'owner_locked', required: Whether usage is public or locked to the owner under the project ownership rules.
    - `visibility` 'anyone' | 'owner', required: Whether visibility is unrestricted or limited to the owner under the project ownership rules.
    - `owner` object, nullable, required: The actor that owns this resource, if any.
      - `type` 'person' | 'agent' | 'consumer' | 'organization_member', required: Type of the owning actor.
      - `name` string, nullable, required: Display name of the owning actor.
      - `image_url` string, nullable, required: Avatar image URL of the owning actor, if available.
      - `email` string, nullable, required: Email address of the owning actor, if available.
      - `organization_member` object: Organization member associated with this owner.
        - `id` string, required: Identifier of the organization member who owns the resource.
      - `consumer` Consumer: Consumer and profile associated with this owner.
        - `id` string, required: Identifier of the owning consumer.
        - `profile_id` string, required: Identifier of the owning consumer profile.
        - `portal_id` string, nullable, required: Identifier of the consumer profile’s portal, if any.
  - `identity_id` string, nullable, required
  - `created_at` string, date-time, required: Timestamp when created
  - `updated_at` string, date-time, required: Timestamp when last updated

## Other responses

- `400`: Invalid parameters or action
- `401`: Missing or invalid API key
- `403`: The key lacks permission for this resource
- `404`: No such resource
- `422`: Validation failed
- `429`: Rate limit exceeded
- `500`: Unexpected server error

---

[API](https://skmtc.dev/metorial/apis/metorial-api.md) - [All operations](https://skmtc.dev/metorial/apis/metorial-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metorial/apis/metorial-api/revisions/10ccc89f3eac?raw)
