Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Folders API reference
The folders 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.ioOrganise your files in nested folders, from your server. Folders are never part of a file's URL, so renaming or moving one changes no links. Files with no folder are at the root. Needs your private key.
/files/moveMove files to a folder
Puts up to 100 files in one folder, or at the root with folderId: null. folderPath creates any missing folders on the path. Ids that are unknown or belong to another app are listed in notFound, so the request can be repeated safely. Moving never changes a file's URL. Sends one file.updated webhook for each file that changes folder; a file already in the folder sends none.
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/jsonids * | string (uuid)[] | |
folderId | string | null | The folder, or null for the root. |
folderPath | string | The folder's path, like /products/shoes. / is the root. |
Responses
200 | What happened to each id.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 | The folder does not exist.application/json |
/foldersList folders
Your app's folders, by name. With parentId only the folders directly inside one folder (root for the top level), otherwise every folder. path looks up one folder by its path and returns it, or an empty list.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
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. |
sort | query | "name" | "createdAt" | |
order | query | "asc" | "desc" | Defaults to desc, except for sort=name which defaults to asc. |
parentId | query | string (uuid) | string | Only the folders directly inside this folder, or root for the top level. |
name | query | string | Only folders whose name contains this text, ignoring case. |
path | query | string | Find the folder at this path, like /products/shoes, ignoring case. |
maxFileCount | query | integer | Count each folder's files no further than this: a folder with more has fileCount one past it, so maxFileCount=100 gives 101 for "more than 100". Quicker when folders hold many files. Without it every file is counted, and the folder found by path is always counted exactly. |
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 folders.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 | parentId is not one of your folders.application/json |
/foldersCreate a folder
Send a name, and a parentId to make it inside another folder: 201, or 409 folder_exists if that folder already has one of the same name, ignoring case. Or send a path to make every missing folder on it, like mkdir -p: 201 if anything was made, 200 if it all existed. Names are 1 to 255 characters with no / or \, and cannot be . or ... Folders nest up to 20 deep and an app can have up to 10,000.
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/jsonname | string | |
parentId | string | null | |
path | string |
Responses
200 | Every folder on path already existed. The last one.application/json |
201 | The new folder (with path, the last folder on it).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 | No private key, or folder_limit_reached.application/json |
404 | parentId is not one of your folders.application/json |
409 | An error. error is a short code and message says what went wrong.application/json |
/folders/{id}Get a folder
One folder, with the folders above it in ancestors for breadcrumbs.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A folder 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
200 | The folder.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 |
/folders/{id}Rename or move a folder
Send name to rename it and parentId to move it, with what is inside, into another folder (null for the root). A folder cannot move into itself or one of its subfolders (400 invalid_move), and the destination cannot already have a folder of the same name (409 folder_exists). No file URLs change.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A folder 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/jsonname | string | |
parentId | string | null |
Responses
200 | The folder as it is now.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 |
/folders/{id}Delete a folder
contents says what happens to what is inside. refuse (the default) only deletes an empty folder and answers 409 folder_not_empty otherwise. moveToParent moves its files and subfolders up into its parent (the root for a top-level folder), with a file.updated webhook for each file, and answers 409 folder_exists if a subfolder's name is taken there. delete deletes its subfolders and every file in them, stored data included, with a file.deleted webhook for each: up to 1000 files, more is 409 folder_too_large. If storage cannot be reached, the files already deleted stay deleted, the folder is kept and the request can be repeated. On a plan that keeps deleted files (retentionDays above 0), refuse and delete put the folder, its subfolders and its files in the trash instead (file.deleted is still sent for each file), where POST /folders/{id}/restore brings them all back as they were. moveToParent deletes only the folder, at once.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | A folder id. |
contents | query | "refuse" | "moveToParent" | "delete" | |
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 | What was deleted and moved.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 |
500 | An error. error is a short code and message says what went wrong.application/json |