---
title: "Get Document Preview Url"
method: GET
path: "/documents/preview-url"
tags: ["documents"]
---

# Get Document Preview Url

`GET /documents/preview-url`

## Request

- Base URL: `https://api.projectindi.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.projectindi.com/documents/preview-url`
- Auth: none declared

Mint a short-lived signed URL for previewing a stored document file.

Replaces appweb's Next ``/api/documents/preview`` proxy: the browser fetches
this (Bearer JWT) and uses the returned URL directly as an <img>/link source.
Access to the private ``documents`` bucket is gated at mint time by
``_authorize_document_preview`` - the R2 backend presigns without storage-RLS,
so the old create-signed-url gate no longer holds. TTL matches the old route (1h).

## Query parameters

- `url` string, required
- `bucket` 'documents' | 'public-documents'

## Response `200`

Successful Response

- PreviewUrlResponse
  - `signed_url` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/projectindi/apis/indi-agent-api-first-principles.md) - [All operations](https://skmtc.dev/projectindi/apis/indi-agent-api-first-principles/llms.txt) - [OpenAPI document](https://skmtc.dev/projectindi/apis/indi-agent-api-first-principles/revisions/25a7813e21fd?raw)
