---
title: "Create File Route"
method: POST
path: "/notebook/create"
tags: ["runtime_mutations", "notebook"]
---

# Create File Route

`POST /notebook/create`

Create a new notebook or text file, failing if the path already exists.

Unlike ``/notebook/save`` (an upsert), this endpoint refuses to overwrite
an existing file and returns ``409 Conflict`` when ``path`` is taken.

For ``.ipynb`` files this writes a starter notebook containing one empty
code cell whose ``cell_id`` is minted on the backend. That avoids the
frontend (``useNotebookLoader.makeEmptyCell``) fabricating a phantom cell
with a client-side id when it loads a zero-cell notebook.

## Request body

- FileCreateRequest
  - `path` string, required
  - `content` string, nullable
  - `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

## 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/ee473d0e84e0/schema)
