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

# Update Session

`PATCH /sessions/{session_id}`

Update session properties such as session_name, session_state, metadata, or summary. Use this endpoint to modify the session name, update state, add metadata, or update the session summary.

## Path parameters

- `session_id` string, required — Session ID to update

## Query parameters

- `type` 'agent' | 'team' | 'workflow'
- `user_id` string, nullable — User ID
- `db_id` string, nullable — Database ID to use for update operation
- `table` string, nullable — Table to use for update operation

## Request body

- UpdateSessionRequest
  - `session_name` string, nullable — Updated session name
  - `session_state` object, nullable — Updated session state
  - `metadata` object, nullable — Updated metadata
  - `summary` object, nullable — Session summary

## Response `200`

Session updated successfully

- union
  - AgentSessionDetailSchema
    - `user_id` string, nullable — User ID associated with the session
    - `agent_session_id` string, required — Unique agent session identifier
    - `session_id` string, required — Session identifier
    - `session_name` string, required — Human-readable session name
    - `session_summary` object, nullable — Summary of session interactions
    - `session_state` object, nullable — Current state of the session
    - `agent_id` string, nullable — Agent ID used in this session
    - `total_tokens` integer, nullable — Total tokens used in this session
    - `agent_data` object, nullable — Agent-specific data
    - `metrics` object, nullable — Session metrics
    - `metadata` object, nullable — Additional metadata
    - `chat_history` object[], nullable — Complete chat history
    - `created_at` string, date-time, nullable — Session creation timestamp
    - `updated_at` string, date-time, nullable — Last update timestamp
  - TeamSessionDetailSchema
    - `session_id` string, required — Unique session identifier
    - `session_name` string, required — Human-readable session name
    - `user_id` string, nullable — User ID associated with the session
    - `team_id` string, nullable — Team ID used in this session
    - `session_summary` object, nullable — Summary of team interactions
    - `session_state` object, nullable — Current state of the session
    - `metrics` object, nullable — Session metrics
    - `team_data` object, nullable — Team-specific data
    - `metadata` object, nullable — Additional metadata
    - `chat_history` object[], nullable — Complete chat history
    - `created_at` string, date-time, nullable — Session creation timestamp
    - `updated_at` string, date-time, nullable — Last update timestamp
    - `total_tokens` integer, nullable — Total tokens used in this session
  - WorkflowSessionDetailSchema
    - `user_id` string, nullable — User ID associated with the session
    - `workflow_id` string, nullable — Workflow ID used in this session
    - `workflow_name` string, nullable — Name of the workflow
    - `session_id` string, required — Unique session identifier
    - `session_name` string, required — Human-readable session name
    - `session_data` object, nullable — Complete session data
    - `session_state` object, nullable — Current workflow state
    - `workflow_data` object, nullable — Workflow-specific data
    - `metadata` object, nullable — Additional metadata
    - `created_at` string, date-time, nullable — Session creation timestamp
    - `updated_at` string, date-time, nullable — Last update timestamp

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Session not found
- `422` — Invalid request
- `500` — Failed to update session

---

[API](https://skmtc.net/agno/apis/agno-api-reference.md) · [All operations](https://skmtc.net/agno/apis/agno-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/agno/agno-api-reference/versions/5f6149d395d0/schema)
