---
title: "Rename Session"
method: POST
path: "/sessions/{session_id}/rename"
tags: ["Sessions"]
---

# Rename Session

`POST /sessions/{session_id}/rename`

Update the name of an existing session. Useful for organizing and categorizing sessions with meaningful names for better identification and management.

## Path parameters

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

## Query parameters

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

## Request body

- BodyRenameSession
  - `session_name` string, required — New name for the session

## Response `200`

Session renamed 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` — Invalid session name
- `401` — Unauthorized
- `404` — Session not found
- `422` — Invalid session type or validation error
- `500` — Internal Server Error

---

[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)
