Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
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.
https://api.fileboy.ioOrdered 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.
/playlistsList playlists
The app's playlists, newest first, without their items.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
X-Fileboy-App | header | string (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
200 | The playlists.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
/playlistsCreate 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
| Name | In | Type | Description |
|---|---|---|---|
X-Fileboy-App | header | string (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/jsontitle * | string | |
description | string | |
visibility | PlaylistVisibility | |
videoIds | string (uuid)[] |
Responses
201 | The playlist.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | video_not_found: one of the videos is not one of the app's.application/json |
415 | An error. error is a short code and message says what went wrong.application/json |
/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
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A playlist id. |
fb_exp | query | integer (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_sig | query | string | The 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_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For 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
200 | The playlist.application/json |
400 | The id is not a playlist id.application/json |
401 | The 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 |
403 | The 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 |
404 | playlist_not_found.application/json |
/playlists/{id}Check a playlist
Same as the GET, without the body.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A playlist id. |
fb_exp | query | integer (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_sig | query | string | The 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_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For 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
200 | Headers only. |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | The 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 |
403 | The 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 |
404 | An error. error is a short code and message says what went wrong.application/json |
/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
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A playlist id. |
X-Fileboy-App | header | string (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/jsontitle | string | |
description | string | null | |
visibility | PlaylistVisibility |
Responses
200 | The playlist.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | playlist_not_found.application/json |
415 | An error. error is a short code and message says what went wrong.application/json |
/playlists/{id}Delete a playlist
The playlist goes; its videos stay. Its embed page stops working.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A playlist id. |
X-Fileboy-App | header | string (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
204 | Deleted. |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | playlist_not_found.application/json |
/playlists/{id}/itemsSet 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
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A playlist id. |
X-Fileboy-App | header | string (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/jsonvideoIds * | string (uuid)[] |
Responses
200 | The playlist.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | playlist_not_found, or video_not_found when a video is not one of the app's.application/json |
415 | An error. error is a short code and message says what went wrong.application/json |
/playlists/{id}/itemsAdd 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
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A playlist id. |
X-Fileboy-App | header | string (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/jsonvideoId * | string (uuid) | |
position | integer |
Responses
200 | The playlist.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | playlist_not_found, or video_not_found when the video is not one of the app's.application/json |
409 | video_already_in_playlist.application/json |
415 | An error. error is a short code and message says what went wrong.application/json |
/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
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A playlist id. |
videoId * | path | string (uuid) | |
X-Fileboy-App | header | string (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
200 | The playlist.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | No key was sent.application/json |
403 | An error. error is a short code and message says what went wrong.application/json |
404 | playlist_not_found, or playlist_item_not_found.application/json |