---
title: "Delete a session"
method: DELETE
path: "/api/sessions/{id}"
tags: ["Sessions"]
---

# Delete a session

`DELETE /api/sessions/{id}`

## Request

- Base URL: `https://your-deployment.example.com`
- URL: `https://your-deployment.example.com/api/sessions/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Deletes one of your sessions (called a "notebook" in the product UI). This cannot be undone through the API. Files you uploaded into the session are deleted with it; files other people uploaded into it are kept, and every access grant this session gave out on a file is revoked. A session you do not own, or one already deleted, is `404`. A `409` means a concurrent change touched one of those files mid-delete; nothing was deleted, so retry. An API key needs `notebooks:write`.

## Path parameters

- `id` string, required

## Response `200`

The session was deleted.

- DeleteSessionResponse200
  - `newLastNotebookId` string, nullable, required: The caller's most recently updated remaining session, which the product UI opens next; null when none remains.

## Other responses

- `401`: Missing or invalid credentials.
- `403`: The API key does not hold any of the required scopes.
- `404`: No session with that id is visible to the caller.
- `405`: The path does not serve this HTTP method.
- `409`: A concurrent change touched a file this session shares; nothing was deleted. Retry.
- `422`: Request failed validation.
- `429`: Per-user rate limit exceeded.

---

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