Get file contents via presigned redirect (ASK-205)
GET/files/:file_id/download
Returns 302 with a freshly-minted presigned S3 GET URL in the
Location header. The browser follows the redirect and loads
the bytes directly from object storage. Presigned URL TTL is
15 minutes; clients with long-lived references (e.g. <img src>
baked into study-guide markdown) keep pointing at this stable
endpoint and get a new signed URL on every request.
Grants are respected -- the viewer must own the file or hold
a direct view grant (or the public sentinel). Files in
pending / failed / soft-deleted states return 404 so
callers can't distinguish "not ready" from "forbidden".
Request
Responses
- 302
- 400
- 401
- 403
- 404
- 500
Redirect to a freshly-minted presigned S3 GET URL (15-min TTL). The browser follows the Location header and loads bytes directly from object storage.
Response Headers
Presigned S3 GET URL.
Bad request
Unauthorized
Forbidden
Not found
Internal server error