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

# Request Upload Url

`POST /api/v1/files/upload`

Request a presigned upload URL for direct client-side upload to storage.

This is the recommended upload flow:
1. Client calls this endpoint with filename and content_type
2. Backend creates a pending file record and returns presigned PUT URL
3. Client uploads directly to storage using the presigned URL
4. Client calls /confirm to verify upload and get actual file size

## Cookies

- `wos-session` string
- `datalab_active_team` string

## Request body

- RequestUploadUrlRequest — Request to get a presigned upload URL.
  - `filename` string, required — Original filename (used for storage path and metadata)
  - `content_type` string, required — MIME type of the file
  - `processing_location` string, nullable — Optional residency region override (e.g. us, eu). When provided, the direct-upload URL is issued for storage in that region.

## Response `200`

Successful Response

- RequestUploadUrlResponse — Response with presigned PUT URL for direct storage upload.
  - `file_id` integer, required — Unique file ID (use this to confirm upload)
  - `upload_url` string, required — Presigned PUT URL to upload the file to
  - `expires_in` integer — URL expiry time in seconds
  - `reference` string, required — File reference in datalab://file-{id} format

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/datalab/apis/datalab-api.md) · [All operations](https://skmtc.dev/datalab/apis/datalab-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/datalab/datalab-api/revisions/aa9f8ee18efb/schema)
