staqlydocs
REST APIAPI referenceMedia

Download/preview a file

Download/preview a file (media:read). Supports Range requests.

Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.

GET
/v1/media/{id}

With w, returns a thumbnail at most w pixels wide instead of the original (PNG, JPEG, GIF first frame, WebP). Thumbnails are generated on first request and cached on disk; JPEG for opaque images, PNG when there is transparency; EXIF orientation is applied. Images are never upscaled: when the original is not wider than w, it is returned as is, as it is for AVIF and for images over 50 megapixels (not decoded server-side). Thumbnail responses carry an ETag and Cache-Control: private, max-age=31536000, immutable (a media id never changes content). Other file types answer 422 when w is set.

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Path Parameters

id*string

Query Parameters

download?string

Force attachment disposition

w?integer

Thumbnail width in pixels (images only)

Value in1603206401280

Response Body

File bytes (or the thumbnail), with the stored MIME type

response?file*/*
Formatbinary
curl -X GET 'https://staqly.example.com/v1/media/string'
"string"