staqlydocs
REST APIAPI referenceMedia

Rename a file, set its alt text, move it to a folder, set its tags, or report a video's size and length

Rename a file, set its alt text, move it to a folder, set its tags, or report a video's size and length (media:write)

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.

PATCH
/v1/media/{id}

Authorization

headerAuthorizationBearer <token>

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

Path Parameters

id*string

Request Body

application/json
  1. body
name?string
Length1 <= length
alt_text?string
Lengthlength <= 1500
width?integer
Range0 <= value <= 100000
height?integer
Range0 <= value <= 100000
duration_ms?integer
Range0 <= value <= 86400000
folder_id?string

Moves the file: a folder id, or empty for the top level

tags?array<>

Replaces the file's tags; lowercased, without #, spaces become dashes

Itemsitems <= 20

Response Body

The file

application/json
  1. response

An uploaded file

id*string
mime_type*string
size_bytes*integer
original_name*string
url*string

Absolute URL (PUBLIC_API_URL); requires authentication

sha256*string
created_at*string
Formatdate-time
alt_text*string

Describes a picture for people who can't see it; platforms that take alt text receive it

width*integer

Pixels; measured on upload for pictures, reported by the uploading browser for videos; 0 when unknown

height*integer

Pixels; 0 when unknown

duration_ms*integer

A video's or audio file's length in milliseconds; 0 when unknown

folder_id*string

The library folder the file sits in; empty for the top level

tags*array<string>
deleted_at?string

Set while the file is in Deleted

Formatdate-time
purge_at?string

When a file in Deleted is deleted for good

Formatdate-time
duplicate_of?string

The oldest other file with the same content, if any

curl -X PATCH 'https://staqly.example.com/v1/media/string' \  -H 'Content-Type: application/json' \  -d '{}'
{  "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"}