---
title: "Generate pre-signed URL for document"
method: POST
path: "/documents/{id}/presigned-url"
tags: ["Documents"]
---

# Generate pre-signed URL for document

`POST /documents/{id}/presigned-url`

Generate a pre-signed URL for accessing a document. The URL is valid for 60 seconds and allows secure temporary access to the document file.

## Path parameters

- `id` string, uuid, required — Unique identifier of the document to generate a pre-signed URL for

## Query parameters

- `download` boolean, nullable — Whether to force download the file. If true, the file will be downloaded. If false or omitted, the file will be displayed in the browser if possible.

## Response `200`

Pre-signed URL generated successfully

- object
  - `url` string, uri, required — Pre-signed URL for accessing the document, valid for 60 seconds
  - `expiresAt` string, date-time, required — ISO 8601 timestamp when the URL expires
  - `fileName` string, nullable, required — Original filename of the document

## Other responses

- `400` — Bad request - Document file path not available
- `404` — Document not found
- `500` — Internal server error - Failed to generate pre-signed URL

---

[API](https://skmtc.net/midday-ai/apis/midday-api.md) · [All operations](https://skmtc.net/midday-ai/apis/midday-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/midday-ai/midday-api/versions/c0df9243c1b0/schema)
