---
title: "Create an interactive session"
method: POST
path: "/sessions"
tags: ["Sessions"]
---

# Create an interactive session

`POST /sessions`

Creates an interactive session that runs the specified notebook and stays alive to accept further submissions. The session executes its own copy of the notebook (see `sessionNotebookId`); edit that copy via the standard notebook and block endpoints to change what subsequent runs execute — the source notebook is never modified. The session ends after a period of inactivity.

## Request body

- object
  - `notebookId` string, required — ID of the source notebook the session is anchored to.
  - `inputs` object — Input values for the initial run, keyed by input block `name`. Same shape as `POST /v2/runs`.
  - `storageMode` 'read_write' | 'readonly' — Storage mode for the session. `read_write` (default) allows the session to write to project storage. `readonly` makes project storage read-only for the session; the session can still create temporary files.

## Response `202`

Session created with initial run

- CreateSessionResponse
  - `session` Session, required
    - `id` string, uuid, required — Session identifier. Use this as the sessionId in subsequent operations.
    - `status` 'idle' | 'busy' | 'terminated', required — `busy` while a run is pending or running, `idle` when no runs are active, `terminated` once the session has ended.
    - `projectId` string, uuid, required — ID of the project the session was created in.
    - `notebookId` string, required — ID of the notebook the session was created from.
    - `sessionNotebookId` string, required — ID of the session's own editable copy of the notebook. The session executes this copy, not the source notebook. Use the standard notebook and block endpoints against this ID to read and edit what the session runs; changes never affect the source notebook and are discarded when the session ends. Each run persists as a run snapshot.
    - `currentRunId` string, uuid, nullable, required — ID of the active (pending or running) run in this session, or null when idle.
    - `createdAt` string, date-time, required
    - `lastActivityAt` string, date-time, required — Timestamp of the most recent submission to the session. Refreshed on every new run.
    - `expiresAt` string, date-time, required — When the session will end if no further submissions are made.
  - `run` object, required
    - `runId` string, uuid, required
    - `status` 'pending' | 'running' | 'success' | 'error' | 'internal_error' | 'stopped', required
    - `createdAt` string, date-time, required

## Other responses

- `400` — Validation error
- `401` — Unauthorized
- `403` — Insufficient permissions
- `404` — Notebook not found
- `409` — Project is suspended
- `429` — Rate limit exceeded
- `500` — Hardware unable to start

---

[API](https://skmtc.net/deepnote/apis/deepnote-public-api.md) · [All operations](https://skmtc.net/deepnote/apis/deepnote-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/deepnote/deepnote-public-api/revisions/726970fd2992/schema)
