Files

Download a document’s file

The bytes themselves, streamed through the API rather than from a signed URL: every read of a file is a request that carried a session, so it can be refused the moment an account is closed and it leaves the same trace every other read leaves. This is the one response in the API that is not the { ok, data, meta } envelope. A refusal still is, unless the request names text/html ahead of JSON, which a browser following a link does: then the refusal is a short page carrying the same sentence and request id, and a way back, so a link never opens a raw envelope. It is served as an attachment whatever the file claims to be, except a PDF asked for with inline=1.

get/api/v1/documents/{id}/content

Request

  • Base URL: http://localhost:5180
  • URL: http://localhost:5180/api/v1/documents/{id}/content
  • Auth: API key in cookie better-auth.session_token

Path parameters

idstring required

Document id, for example doc_014.

Query parameters

variant'thumb' | 'display'

A derived copy rather than the original: thumb for a grid, display for one photo on screen. Left out, the original is served, so a link that never asked for one never changes.

vstring

The file’s checksum, as the listing gives it. When it matches, the browser may keep the answer for a year, because a stored file is never replaced; without it, or with one that no longer matches, nothing is kept.

inline'1'

Set to 1 to have an original PDF shown in place rather than saved, so the product can open it in the browser’s own viewer. Anything that is not a PDF is still an attachment.

Response

The file, with the content type the upload claimed for it and the request id in the header. A photo filed before it had copies has the one asked for made on the spot.

Changes

No recorded changes to this operation across all 1 revision of this API.