---
title: "Get a new upload URL for a draft that has no file yet"
method: POST
path: "/api/v1/documents/{id}/upload-url"
tags: ["Documents"]
---

# Get a new upload URL for a draft that has no file yet

`POST /api/v1/documents/{id}/upload-url`

## Request

- Base URL: `https://api.korala.ai`
- URL: `https://api.korala.ai/api/v1/documents/{id}/upload-url`
- Auth: one of:
  - API key in header `X-API-Key`
  - `bearer` (a scheme the document does not define)

For a document created with POST upload-url whose file was never sent: returns a fresh presigned URL for the same document. Korala uses it when an AI assistant starts a document and the person uploads the PDF in the browser. Answers 409 once the file is there.

## Path parameters

- `id` string, required

## Response `200`

- UploadUrlResponseDto
  - `documentId` string, required
  - `uploadUrl` string, required
  - `key` string, required
  - `maxUploadBytes` number, required: Largest file this organization's plan accepts, in bytes. Uploading a bigger file is rejected when the upload is confirmed, so check it before transferring.

## Other responses

- `400`: Malformed UUID in path parameter (`id`).
- `404`: No such document
- `409`: The document is not a draft, or already has its file

---

[API](https://skmtc.dev/korala/apis/korala-public-api.md) · [All operations](https://skmtc.dev/korala/apis/korala-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/korala/apis/korala-public-api/revisions/5c4d7810c507?raw)
