---
title: "Save Or Export Notebook Route"
method: POST
path: "/notebook/save"
tags: ["runtime_mutations", "notebook"]
---

# Save Or Export Notebook Route

`POST /notebook/save`

Save handler for notebooks and text files.

For notebooks, this now saves to the session draft store first, then
promotes to canonical with CAS conflict detection.

## Request body

- FileSaveRequest
  - `cells` Cell[]
    - `type` 'code' | 'markdown' | 'raw'
    - `content` string
    - `outputs` SerializedOutput[]
      - `type` string, required
      - `content` unknown, required
      - `execution_time_ms` integer, nullable
    - `cellId` string
    - `executionCount` integer, nullable
    - `executionTimeMs` integer, nullable
    - `executedAtMs` integer, nullable
    - `metadata` object
  - `metadata` object
  - `path` string, required
  - `content` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

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