---
title: "This can be used to rename the session."
method: PATCH
path: "/api/sessions/{session}"
tags: ["sessions"]
---

# This can be used to rename the session.

`PATCH /api/sessions/{session}`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - API key in query parameter `token`

## Request body

- Session: A session
  - `id` string, uuid
  - `path` string: path to the session
  - `name` string: name of the session
  - `type` string: session type
  - `kernel` Kernel: Kernel information
    - `id` string, uuid, required: uuid of kernel
    - `name` string, required: kernel spec name
    - `last_activity` string: ISO 8601 timestamp for the last-seen activity on this kernel. Use this in combination with execution_state == 'idle' to identify which kernels have been idle since a given time. Timestamps will be UTC, indicated 'Z' suffix. Added in notebook server 5.0.
    - `connections` number: The number of active connections to this kernel.
    - `execution_state` string: Current execution state of the kernel (typically 'idle' or 'busy', but may be other values, such as 'starting'). Added in notebook server 5.0.

## Response `200`

Session

- Session: A session
  - `id` string, uuid
  - `path` string: path to the session
  - `name` string: name of the session
  - `type` string: session type
  - `kernel` Kernel: Kernel information
    - `id` string, uuid, required: uuid of kernel
    - `name` string, required: kernel spec name
    - `last_activity` string: ISO 8601 timestamp for the last-seen activity on this kernel. Use this in combination with execution_state == 'idle' to identify which kernels have been idle since a given time. Timestamps will be UTC, indicated 'Z' suffix. Added in notebook server 5.0.
    - `connections` number: The number of active connections to this kernel.
    - `execution_state` string: Current execution state of the kernel (typically 'idle' or 'busy', but may be other values, such as 'starting'). Added in notebook server 5.0.

## Other responses

- `400`: No data provided

---

[API](https://skmtc.dev/jupyter-server/apis/jupyter-enterprise-gateway-api.md) - [All operations](https://skmtc.dev/jupyter-server/apis/jupyter-enterprise-gateway-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jupyter-server/apis/jupyter-enterprise-gateway-api/revisions/15b16ff20d45?raw)
