Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Expiring links API reference
The expiring links 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.ioLinks to a file or an image transform that stop working at a time you choose and can be revoked early. Making, listing and revoking them needs your private key, opening one needs nothing.
/files/{id}/linksMake an expiring link
A link to the file, or to one image transform of it, that stops working at expiresAt and can be revoked before then. Give expiresAt or expiresIn, from a minute to 365 days away. A file can have 100 active links. The link works whatever the file's read permission or the app's signed reads setting, but it does not make a public file private: the file's own URL keeps working. The id can also be PUBLIC_KEY+LABEL. Files that are part of a video, and image copies Fileboy made, cannot have links.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
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/jsonexpiresAt | string (date-time) | When the link stops working, with a time zone. A minute to 365 days away. |
expiresIn | integer | Seconds from now. |
transform | string | An image transform, like resize:400x_;format:webp. Checked when the link is made (400 invalid_transform). |
download | boolean | |
filename | string | The name the file is saved under. No slashes. |
note | string | For you: who or what the link is for. |
Responses
201 | The new link. Hand out its url.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 | An error. error is a short code and message says what went wrong.application/json |
409 | An error. error is a short code and message says what went wrong.application/json |
/files/{id}/linksList a file's expiring links
Newest first, every status unless status=active. Each link says how often it was opened (useCount, reads that started at the beginning of the file) and when it was last opened.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
status | query | "active" | "all" | active leaves out links that have expired or been revoked. |
limit | query | integer | Page size, 1 to 100. |
cursor | query | string | The nextCursor of the previous page. Use it with the same filters and sort. Paging is stable: files added or deleted while you page are never skipped or repeated. |
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 | One page of links.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 | An error. error is a short code and message says what went wrong.application/json |
/files/{id}/links/{linkId}Revoke an expiring link
The link stops working now: reads answer 410 link_revoked. Safe to repeat, a link that is already revoked keeps its first revocation time. A browser that already downloaded the file keeps its copy, for at most five minutes of cache.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
linkId * | 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 link, now revoked.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 | An error. error is a short code and message says what went wrong.application/json |
/links/{token}Open an expiring link
Serves what the link was made for, exactly as /files/get/{id} or /images/get/{id}?transform=... would, while the link is active. Needs nothing else: the link is the permission. The query string is ignored, so a link cannot be changed into another transform or a download. A link with no transform to a HEIC or HEIF image (not a download link) serves it as format:auto would (AVIF or WebP where the browser takes them, else JPEG), since most browsers can't show HEIC; one too large to transform is served as it is. Range works (seeking in audio and video) and format:auto follows Accept. Responses are Cache-Control: private for at most five minutes and never past the expiry, with X-Robots-Tag: noindex.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token * | path | string | The last part of the link's url. |
Responses
200 | The file or the transformed image.*/* |
206 | Part of the file, for a Range request.*/* |
400 | An error. error is a short code and message says what went wrong.application/json |
404 | link_not_found: there is no such link, or its file was deleted.application/json |
410 | link_expired or link_revoked.application/json |
416 | The Range holds no bytes of the file (it starts past the end, or is empty). Content-Range gives the file's size, as bytes */SIZE. A Range sent with an If-Range that doesn't name the file's current ETag is ignored and the whole file sent instead. |
429 | delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
/links/{token}Check an expiring link
Like GET, without the body. Not counted as a use.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token * | path | string |
Responses
200 | The link is active. |
404 | link_not_found. |
410 | link_expired or link_revoked. |
/videos/{id}/linksMake an expiring link to a video
A watch page (url) and embed URL (embedUrl) for the video that stop working at expiresAt and can be turned off before then. Give expiresAt or expiresIn, from a minute to 365 days away. A video can have 100 active links. The page plays the video whatever the app's signed reads setting: the player sends the link's token with every request (fb_link=...), and it is checked each time, so a link that expires or is turned off stops at once, even part way through. It does not make a public video private: the video's own watch page keeps working. It never opens downloads that are turned off. The video's embed domains apply to its pages.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The video's 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/jsonexpiresAt | string (date-time) | |
expiresIn | integer | Seconds. |
note | string | Shown in the dashboard only. |
Responses
201 | The new link. Hand out its url, or put embedUrl in an iframe.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 | An error. error is a short code and message says what went wrong.application/json |
409 | An error. error is a short code and message says what went wrong.application/json |
/videos/{id}/linksList a video's expiring links
Newest first, every status unless status=active. useCount is how often the link's page was opened.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The video's id. |
status | query | "active" | "all" | active leaves out links that have expired or been turned off. |
limit | query | integer | Page size, 1 to 100. |
cursor | query | string | The nextCursor of the previous page. Use it with the same filters and sort. Paging is stable: files added or deleted while you page are never skipped or repeated. |
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 | One page of links.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 | An error. error is a short code and message says what went wrong.application/json |
/videos/{id}/links/{linkId}Turn off an expiring link to a video
The link stops now: its page says so, and a player already using it gets 410 link_revoked on its next request. Safe to repeat.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The video's id. |
linkId * | 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 link, now turned off.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 | An error. error is a short code and message says what went wrong.application/json |
/video-links/{token}Open an expiring link to a video
What the link's page plays: the video id and the query (fb_link=...) to send with every request for it, as <fileboy-player signed-query>. Needs nothing else: the link is the permission. Each call counts as one use. Answers Cache-Control: no-store.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token * | path | string | The last part of the link's url. |
Responses
200 | The video to play.application/json |
404 | link_not_found: there is no such link, or its video was deleted.application/json |
410 | link_expired or link_revoked.application/json |