---
title: "Upload File"
method: POST
path: "/api/files/upload"
tags: ["files"]
---

# Upload File

`POST /api/files/upload`

## Request

- Base URL: `https://app.ctlsurf.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.ctlsurf.com/api/files/upload`
- Auth: HTTP bearer

Upload a file to storage.

Supports images (PNG, JPG, GIF, WebP), PDFs, and Office documents.
Max file size: 10 MB.

## Query parameters

- `page_id` string, uuid, nullable: Associate with a page
- `block_id` string, uuid, nullable: Associate with a block

## Response `200`

Successful Response

- FileUploadResponse: Response after successful file upload.
  - `file` FileResponse, required: Schema for file response.
    - `original_filename` string, required
    - `mime_type` string, required
    - `size_bytes` integer, required
    - `width` integer, nullable
    - `height` integer, nullable
    - `id` string, uuid, required
    - `user_id` string, uuid, required
    - `page_id` string, uuid, nullable
    - `block_id` string, uuid, nullable
    - `filename` string, required
    - `s3_key` string, required
    - `created_at` string, date-time, required
    - `url` string, nullable
    - `has_extracted_text` boolean
  - `message` string

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/ctlsurf/apis/notebook-control-plane.md) · [All operations](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/llms.txt) · [OpenAPI document](https://skmtc.dev/ctlsurf/apis/notebook-control-plane/revisions/ddfbbe20d5ce?raw)
