Skip to content
Skip to Content
Full reference

Assets

GET
/v1/items/{id}/assets

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Response Body

The item's files. Thumbnails are not listed here; they are on the item.

application/json
  1. response
assets*array<>
Example Request
curl -X GET 'https://example.com/v1/items/string/assets'
Example Response
{  "assets": [    {      "id": "string",      "item_id": "string",      "kind": "upload",      "content_type": "string",      "size_bytes": 0,      "width": 0,      "height": 0,      "url": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/v1/items/{id}/assets

An attached image only becomes the card thumbnail when the item has none. Send as_thumbnail: true to make it replace the current thumbnail (for example when a crawl picked a poor image). as_thumbnail needs an image; any other file is refused with 422.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Request Body

application/json
  1. body
upload_id*string
as_thumbnail?boolean

Replace the item's card thumbnail with this image. The thumbnail is swapped by a background task, so the change shows on the item shortly after.

Defaultfalse

Response Body

The attached file

application/json
  1. response
id*string
item_id?string|null
kind*string

archive is MHTML (multipart/related) or one HTML file (text/html); video is a copy of a link's video

Value in"upload""banner""screenshot""archive""pdf""video"
content_type*string
size_bytes?integer|null
width?|

Pixels. Always set for a still image; stored images from before sizes were always read are filled in by the hourly cleanup task, 100 at a time. null for non-images and for an image no decoder reads.

height?integer|null
url?string

Signed download URL; expires after an hour. For a still image (not an animation or SVG) it is a resizable image URL instead: add ?width=400 (see the API description). Animations keep the plain signed URL, which returns the original bytes.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/v1/items/string/assets' \  -H 'Content-Type: application/json' \  -d '{  "upload_id": "string"}'
Example Response
{  "id": "string",  "item_id": "string",  "kind": "upload",  "content_type": "string",  "size_bytes": 0,  "width": 0,  "height": 0,  "url": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
GET
/v1/assets

Every file stored for the user (uploads, banners, screenshots, archives, PDFs, videos and thumbnails), for a storage page. Uploads not yet attached to an item are left out. Each file names its item, or null when it has none or the item is deleted. 50 a page by default; send next_cursor back as cursor (with the same sort and kind) for the next page. API keys need read on assets.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Query Parameters

sort?string

size: most bytes first (a file with no known size counts as 0). newest: most recently stored first.

Default"size"
Value in"size""newest"
kind?string
Value in"upload""banner""screenshot""archive""pdf""video""thumbnail""product_image""article_image"
cursor?string
limit?integer
Range1 <= value <= 200
Default50

Response Body

A page of files

application/json
  1. response
files*array<>
next_cursor*|

null on the last page

Example Request
curl -X GET 'https://example.com/v1/assets'
Example Response
{  "files": [    {      "id": "string",      "kind": "upload",      "content_type": "string",      "size_bytes": 0,      "width": 0,      "height": 0,      "created_at": "2019-08-24T14:15:22Z",      "url": "string",      "deletable": true,      "item": {        "id": "string",        "kind": "link",        "title": "string",        "url": "string",        "domain": "string"      }    }  ],  "next_cursor": "string"}
DELETE
/v1/assets/{assetId}

Deletes the file and frees its storage, whatever item it belongs to. Thumbnails cannot be deleted (422): they are replaced or removed with their item. API keys need write on assets.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

assetId*string

Response Body

Deleted

Example Request
curl -X DELETE 'https://example.com/v1/assets/string'
Example Response
Empty
DELETE
/v1/items/{id}/assets/{assetId}

Thumbnails cannot be deleted.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string
assetId*string

Response Body

Deleted

Example Request
curl -X DELETE 'https://example.com/v1/items/string/assets/string'
Example Response
Empty