Documentation

Guides and API reference for uploads, image transforms and video.

npm install @cd2/fileboy-react
API https://api.fileboy.io

Playlists API reference

The playlists endpoints, generated from the OpenAPI document you can download for code generators and API clients: openapi.json or openapi.yaml. See every endpoint for the rest of the API.

Base URLhttps://api.fileboy.io

Ordered lists of your videos, played one after another by the playlist embed page or your own player. Managing them needs your private key; reading one follows the playlist's visibility and each video's own.

GET/playlists

List playlists

The app's playlists, newest first, without their items.

Authorization: public key or signed token

Parameters

NameInTypeDescription
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Responses

200The playlists.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
POST/playlists

Create a playlist

A title (1 to 200 characters, spaces tidied), an optional description (up to 2000 characters) and, optionally, its first videos in order. visibility defaults to private in an app that requires signed reads and public otherwise. Only the app's own videos go in, each once, up to 200. An app can have up to 500 playlists (403 playlist_limit_reached).

Authorization: public key or signed token

Parameters

NameInTypeDescription
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Request body

application/json
title *string
descriptionstring
visibilityPlaylistVisibility
videoIdsstring (uuid)[]

Responses

201The playlist.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404video_not_found: one of the videos is not one of the app's.
application/json
415An error. error is a short code and message says what went wrong.
application/json
GET/playlists/{id}

Get a playlist and its videos

What players read: the playlist and its videos in order, each with what a player needs (name, duration, poster URL) and a query to put on every URL of that video (as <fileboy-player signed-query>), empty when none is needed. A public or unlisted playlist opens for anyone with its id; a private one needs a URL signed for it (scope playlist: sign https://api.fileboy.io/playlists/{id} or the embed page https://fileboy.io/video/playlist/{id}/embed, which passes its signature on) or the private key, and is 401 playlist_private without. A bad signature is refused whatever the visibility. Each video still follows its own visibility. Without a signature, a private video (including every video that follows an app that requires signed reads) is left out, and a password video is listed with access: "password" and only its id, so a page can ask for the password (unlockVideo). With a signature or the private key every video is listed, and private and password videos carry a signed query with the playlist signature's expiry and address range (four hours for the private key). A playlist signature covers what is in the playlist when it is read: a video added later plays under signatures already handed out, until they expire, and each item's query opens the same reads as signing that video. itemCount is how many videos this reader was given. Answers Cache-Control: private, no-cache.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A playlist id.
fb_expqueryinteger (int64)Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated).
fb_sigquerystringThe signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise.
fb_ipquerystringAn IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards.
fb_keyquerystringFor a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed.

Responses

200The playlist.
application/json
400The id is not a playlist id.
application/json
401The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.
application/json
403The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).
application/json
404playlist_not_found.
application/json
HEAD/playlists/{id}

Check a playlist

Same as the GET, without the body.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A playlist id.
fb_expqueryinteger (int64)Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated).
fb_sigquerystringThe signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise.
fb_ipquerystringAn IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards.
fb_keyquerystringFor a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed.

Responses

200Headers only.
400An error. error is a short code and message says what went wrong.
application/json
401The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.
application/json
403The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).
application/json
404An error. error is a short code and message says what went wrong.
application/json
PATCH/playlists/{id}

Change a playlist

Change its title, description (null removes it) or visibility. Send at least one. Its videos change with setPlaylistItems, addPlaylistItem and removePlaylistItem.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A playlist id.
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Request body

application/json
titlestring
descriptionstring | null
visibilityPlaylistVisibility

Responses

200The playlist.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404playlist_not_found.
application/json
415An error. error is a short code and message says what went wrong.
application/json
DELETE/playlists/{id}

Delete a playlist

The playlist goes; its videos stay. Its embed page stops working.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A playlist id.
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Responses

204Deleted.
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404playlist_not_found.
application/json
PUT/playlists/{id}/items

Set or reorder a playlist's videos

Replaces the whole list with these videos, in this order: how a playlist is reordered. [] empties it. Only the app's own videos, each once, up to 200.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A playlist id.
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Request body

application/json
videoIds *string (uuid)[]

Responses

200The playlist.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404playlist_not_found, or video_not_found when a video is not one of the app's.
application/json
415An error. error is a short code and message says what went wrong.
application/json
POST/playlists/{id}/items

Add a video to a playlist

At the end, or at position (from 0; past the end means the end). 409 video_already_in_playlist when it is in already.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A playlist id.
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Request body

application/json
videoId *string (uuid)
positioninteger

Responses

200The playlist.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404playlist_not_found, or video_not_found when the video is not one of the app's.
application/json
409video_already_in_playlist.
application/json
415An error. error is a short code and message says what went wrong.
application/json
DELETE/playlists/{id}/items/{videoId}

Take a video out of a playlist

The video itself stays. Deleting a video takes it out of every playlist.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A playlist id.
videoId *pathstring (uuid)
X-Fileboy-Appheaderstring (uuid)With a personal access token: the id of the app the request is for. Ignored for an app's own keys and scoped keys.

Responses

200The playlist.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404playlist_not_found, or playlist_item_not_found.
application/json