Sluby
REST APIAssets

Update asset metadata.

Changing access_tier takes effect on the delivery gateway at once. An asset being deleted answers 404, as it does to every read. Send If-Match with the ETag of the version you edited (from GET or an earlier PATCH, or built from `updated_at` as `"<epoch milliseconds>"`) and the edit applies only if nobody changed the asset since; otherwise 412 with the asset as it is now. Processing changes the version too.

PATCH
/api/v1/assets/{id}

Changing access_tier takes effect on the delivery gateway at once. An asset being deleted answers 404, as it does to every read. Send If-Match with the ETag of the version you edited (from GET or an earlier PATCH, or built from updated_at as "<epoch milliseconds>") and the edit applies only if nobody changed the asset since; otherwise 412 with the asset as it is now. Processing changes the version too.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A Sluby API key (sluby_...) sent as Authorization: Bearer <key>. Keys carry scopes: upload, read, manage.

Path Parameters

id*string

Asset id.

Header Parameters

If-Match?string

One or more ETags, or * for any version. The weak form of an ETag (W/"…", as a compressing proxy such as the bundled nginx sends it) matches the same version.

Request Body

application/json
  1. body
title?string

Trimmed; no control characters.

Length1 <= length <= 200
description?string

No control characters other than tabs and line breaks.

Lengthlength <= 5000
access_tier?string
Value in"public""private"

Response Body

Updated.

application/json
  1. response
id*string
Formatuuid
title*string
description*string
manifest_object_id*string|null
thumbnail_object_ids*array<string>
duration_ms*|

Null until processing has measured it.

resolution*|

Source resolution, e.g. 1920x1080; null until processing has read it.

status*string
Value in"created""uploading""processing""ready""failed"
access_tier*string
Value in"public""private"
creator_address*string
segment_count*integer
total_storage_bytes*integer
play_count*integer

All-time plays: player loads this server saw, through the gateway or by minting a share map to play direct from Sia. One viewer loading the same video again within 30 minutes counts once, previews in the Studio do not count, and counts reach the API within about 10 seconds.

Range0 <= value
last_played_at*|

When the newest counted play happened; null before the first.

Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X PATCH 'https://sluby.example.com/api/v1/assets/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "title": "string",  "description": "string",  "manifest_object_id": "string",  "thumbnail_object_ids": [    "string"  ],  "duration_ms": 0,  "resolution": "string",  "status": "created",  "access_tier": "public",  "creator_address": "string",  "segment_count": 0,  "total_storage_bytes": 0,  "play_count": 0,  "last_played_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}