staqlydocs
REST APIAPI referenceMedia

The media library

The media library (media:read), newest first by default

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

Authorization

headerAuthorizationBearer <token>

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

Query Parameters

q?string

Part of the file name (case-insensitive)

kind?string
Value in"image""video""audio"
used?string

used (posts carry it) or unused

Value in"used""unused"
folder?string

A folder id (files directly in it) or root (the top level); omit for every folder

tag?string

Files carrying this tag (normalised like on save: lowercase, no #)

deleted?boolean

true lists the files in Deleted (each with deleted_at and purge_at) instead of the library

Defaultfalse
duplicates?boolean

true lists only files with an identical twin (same sha256), grouped by content, oldest first

Defaultfalse
sort?string
Default"created_desc"
Value in"created_desc""created_asc""size_desc""name_asc"
offset?integer
Range0 <= value
Default0
limit?integer
Range1 <= value <= 200
Default60

Response Body

One page

application/json
  1. response
data*array<>
next_offset?integer

Where the next page starts; absent on the last page

curl -X GET 'https://staqly.example.com/v1/media'
{  "data": [    {      "id": "string",      "mime_type": "string",      "size_bytes": 0,      "original_name": "string",      "url": "string",      "sha256": "string",      "created_at": "2019-08-24T14:15:22Z",      "alt_text": "string",      "width": 0,      "height": 0,      "duration_ms": 0,      "folder_id": "string",      "tags": [        "string"      ],      "deleted_at": "2019-08-24T14:15:22Z",      "purge_at": "2019-08-24T14:15:22Z",      "duplicate_of": "string",      "uses": 0    }  ],  "next_offset": 0}