---
title: "Request Upload Url"
method: POST
path: "/api/files/request-upload"
tags: ["files"]
---

# Request Upload Url

`POST /api/files/request-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/request-upload`
- Auth: HTTP bearer

Get a presigned URL for direct file upload.

This allows clients to upload files directly to S3/MinIO without
passing the file data through the API server, saving bandwidth and tokens.

Flow:
1. Call this endpoint to get upload_url and file_id
2. PUT the file directly to upload_url using curl or similar
3. Call /files/confirm-upload to create the database record

## Request body

- UploadUrlRequest: Request for presigned upload URL.
  - `filename` string, required
  - `mime_type` string, required
  - `page_id` string, uuid, nullable

## Response `200`

Successful Response

- UploadUrlResponse: Response with presigned upload URL.
  - `file_id` string, uuid, required
  - `upload_url` string, required
  - `s3_key` string, required
  - `expires_in` integer
  - `mime_type` string, required
  - `filename` string, required

## 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)
