Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Labels API reference
The labels 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.ioLabels are names that point at one file. Create, rename, point and group them, read every change in their history and roll back, and schedule swaps to another file at a set time. Needs your private key.
/labelsList labels
Your app's labels, by name. A label is a name that points at one file, so you can use PUBLIC_KEY+LABEL in place of a file id. group lists one group's labels, or none the labels in no group.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
group | query | string | A label group id, or none. |
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 | All labels.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 |
/labelsCreate a label
Label names are 1 to 100 characters with no spaces and none of - + / \ ? # % &. Optionally point it at a file straight away, which sends a file.updated webhook for that file. Answers 409 if the name is taken.
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 | |
fileId | string | null | |
groupId | string | null |
Responses
201 | The new label.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 | fileId is not one of your files, or groupId one of your groups.application/json |
409 | An error. error is a short code and message says what went wrong.application/json |
/labels/{name}Update a label
Rename the label, point it at another file (fileId, or null for none) and move it to a group (groupId, or null for none). Send any of the three. Each change is recorded in the label's history. A rename or a new file sends file.updated webhooks for the files it touches. {name} is the label's name or id.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name * | path | string | The label's name, or its 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 | |
fileId | string | null | |
groupId | string | null |
Responses
200 | The label.application/json |
400 | invalid_label, validation_error or empty_update.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 | label_not_found, file_not_found or label_group_not_found.application/json |
409 | label_taken: another label has that name.application/json |
/labels/{name}Delete a label
Removes the label, not the file it points at. The file loses the label, which sends a file.updated webhook. The deletion is the last entry in the app's label history (GET /label-history). {name} is the label's name or id. 404 if there is no such label.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name * | path | string | The label's name, or its 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. |
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 |
/labels/{name}/historyA label's history
Every change to the label, newest first: created, file_changed, renamed, rolled_back and swap_applied, with who made it (someone in the dashboard, the API, or a scheduled swap) and the file it pointed at after. Changes are recorded from when label history was added. Moving a label to another group is not recorded: groups never change what a label serves.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name * | path | string | The label's name, or its id. |
limit | query | integer | |
cursor | query | string | nextCursor from the previous page. |
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 | A page of history, newest first.application/json |
400 | invalid_parameter or invalid_cursor.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 |
/labels/{name}/rollbackRoll a label back
Point the label back at the file it pointed at after one of its history entries. Refused with 409 file_deleted when that file has been deleted, and nothing_to_roll_back_to when the label had no file then. Rolling back to the file it has already changes nothing.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name * | path | string | The label's name, or its 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/jsonhistoryId * | string (uuid) |
Responses
200 | The label, pointing at the file again.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 | label_not_found or history_entry_not_found.application/json |
409 | file_deleted or nothing_to_roll_back_to.application/json |
/labels/{name}/swapsA label's scheduled swaps
Pending swaps soonest first, then finished ones newest first.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name * | path | string | The label's name, or its id. |
status | query | "pending" | "applied" | "failed" | "cancelled" | |
limit | query | integer | |
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 | Scheduled swaps.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 |
/labels/{name}/swapsSchedule a label swap
Point the label at a file at a time you choose, up to a year ahead. Swaps are applied within about 30 seconds of their time, and appear in the label's history as swap_applied. If the file is deleted before then, the swap is marked failed with failureReason file_deleted and the label keeps its file. A label can have 50 swaps waiting.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
name * | path | string | The label's name, or its 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/jsonfileId * | string (uuid) | |
runAt * | string (date-time) | RFC 3339, in the future. |
Responses
201 | The scheduled swap.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 | label_not_found or file_not_found.application/json |
409 | too_many_swaps.application/json |
/label-historyEvery label's history
Every change to every label of the app, newest first, including labels that have since been deleted (their entries have a null labelId).
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | |
cursor | query | string | nextCursor from the previous page. |
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 | A page of history, newest first.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 |
/label-swapsList scheduled swaps
Every label's swaps: pending ones soonest first, then finished ones newest first.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
status | query | "pending" | "applied" | "failed" | "cancelled" | |
limit | query | integer | |
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 | Scheduled swaps.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 |
/label-swaps/{id}/cancelCancel a scheduled swap
Only a pending swap can be cancelled: 409 swap_not_pending otherwise.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | 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 cancelled swap.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 |
/label-groupsList label groups
Your app's label groups, by name, with how many labels each has.
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 | All groups.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 |
/label-groupsCreate a label group
Group names are 1 to 100 characters and unique in the app, whatever their case. An app can have 200 groups. Put labels in it with groupId on POST /labels or PATCH /labels/{name}.
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 |
Responses
201 | The new group.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 |
409 | label_group_taken or too_many_label_groups.application/json |
/label-groups/{id}Rename a label group
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | 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. |
Request body
application/jsonname * | string |
Responses
200 | The group.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 |
/label-groups/{id}Delete a label group
The labels in it are kept, in no group.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | 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
204 | Deleted. |
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 |