Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Access requests API reference
The access requests 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.ioAsking to watch a private video: a signed-in Fileboy person asks, you approve or deny, and an approval lets that one person watch that one video until you revoke it. Asking needs a viewer session and no key; approving, denying, revoking, blocking and the settings need your private key.
/videos/{id}/accessSee whether a viewer can ask for access to a video
What a watch page asks to know when a private video won't play: whether the video takes requests (requests), whether the viewer is signed in (signedIn), what became of their request (request.status: pending, approved or denied, which is also what a revoked or blocked person is told) and, once they are approved for a private video, an access grant. The viewer is named by the X-Fileboy-Viewer-Session header, a short-lived token the website server makes for a signed-in Fileboy person (POST /api/account/viewer-session). Without it signedIn is false. Put the grant's query (fb_access=...) on every request for the video, as <fileboy-player signed-query>. It opens that one video for that one person until it expires (four hours) and stops at once, on the next request, when the owner revokes the access or blocks the person (403 access_revoked). It never opens the video's original file. Needs no key. Answers Cache-Control: no-store.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The video's id. |
X-Fileboy-Viewer-Session | header | string | A signed-in viewer's session token. |
Responses
200 | What the viewer can do.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | sign_in_required: the viewer session is not valid.application/json |
404 | An error. error is a short code and message says what went wrong.application/json |
/videos/{id}/access-requestsAsk to watch a private video
A signed-in Fileboy person asks the video's owner to let them watch. Only a Fileboy account can ask, so there is no anonymous or by-email request. The owner is shown the account's email address and whether it is verified (requester.emailVerified: the person used a link Fileboy emailed to it). Unverified accounts can still ask. The optional message is plain text of up to 500 characters, and any links in it are removed. One request per person and video: asking again while waiting is 409 already_requested, and after the owner denied or revoked it 409 request_declined until a week has passed. 409 video_not_private for a video that isn't private, and 403 requests_off when the owner turned requests off. A person the owner blocked is answered 409 request_declined, like someone who was denied, so they are not told it is a block. Limits per hour: 10 requests per person, 30 per video, 100 per app and 30 per address (429 rate_limited with Retry-After), and a video holds at most 200 waiting requests (429 inbox_full). The app's members are emailed with Approve and Deny buttons, the dashboard lists the request and a video.access_requested webhook is sent. Needs the X-Fileboy-Viewer-Session header and no key.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The video's id. |
X-Fileboy-Viewer-Session * | header | string | A signed-in viewer's session token. |
Request body
application/jsonmessage | string |
Responses
201 | The request was made and the owner has been told.application/json |
400 | An error. error is a short code and message says what went wrong.application/json |
401 | sign_in_required.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 |
429 | rate_limited or inbox_full.application/json |
/access-requestsList requests for access
The app's requests, newest first, filtered by videoId and status (pending, approved, denied or revoked) and paged with cursor and limit. pendingCount is how many are waiting in the whole app. An approved request is the grant: that person can watch that video.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
videoId | query | string (uuid) | |
status | query | "pending" | "approved" | "denied" | "revoked" | |
cursor | query | string | |
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 | A page of requests.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 |
/access-requests/{id}/approveApprove a request
Lets that one person watch that one video until you revoke it. A waiting request, or one you denied or revoked before, can be approved; the person is emailed the video's link. 409 invalid_state for a request that is approved already, and 409 requester_blocked while the person is blocked. Recorded as video.access_approved.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The request'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. |
Responses
200 | The approved request.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 |
/access-requests/{id}/denyDeny a request
For a waiting request. The person is told, in a short email that gives no reason, and can ask again after a week. 409 invalid_state for a request that isn't waiting. Recorded as video.access_denied.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The request'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. |
Responses
200 | The denied request.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 |
/access-requests/{id}/revokeRevoke an approval
Ends the person's access to the video from the next request: a player that has the video open stops being served (403 access_revoked). They aren't emailed, and can ask again after a week. 409 invalid_state for a request that isn't approved. Recorded as video.access_revoked.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string (uuid) | The request'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. |
Responses
200 | The revoked request.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 |
/access-requests/settingsGet the app's default for requests
on unless you turned requests off for the app.
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 default.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 |
/access-requests/settingsTurn requests on or off for the app
Private videos offer "Request access" unless the app or the video turned it off, the video's own setting winning. Turning requests off never ends access you approved. Needs the app's own private key, not a scoped key. Recorded as app.access_requests_updated.
Authorization: public key or signed token
Request body
application/jsonrequests * | "on" | "off" |
Responses
200 | The new default.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 |
/videos/{id}/access-requests/settingsGet a video's setting for requests
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. |
Responses
200 | The setting.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}/access-requests/settingsTurn requests on or off for a video
app follows the app's default, on and off override it. Recorded as video.access_requests_updated.
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/jsonrequests * | "app" | "on" | "off" |
Responses
200 | The new setting.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 |
/access-blocksList blocked requesters
The people blocked from asking for access in the app, newest first (at most 1000).
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 blocks.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 |
/access-blocksBlock a requester
The person can't ask for access to any video of the app, and everything they had ends at once: approved requests are revoked (with no email, like any revoke) and waiting ones denied (with the same short email as any denial, so they can't tell it was a block; ended says how many). 404 requester_not_found unless they have asked for a video of this app, so a block can't be used to find out who has an account. Blocking someone who is blocked answers 200. Recorded as viewer.access_blocked.
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/jsonuserId * | string (uuid) | |
reason | string |
Responses
200 | The person was blocked already.application/json |
201 | The block.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 |
/access-blocks/{userId}Unblock a requester
They can ask again after a week. What ended when you blocked them stays ended until you approve it again. 404 block_not_found. Recorded as viewer.access_unblocked. Answers 204.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
userId * | path | string (uuid) | The person's user id, as requester.userId of their request. |
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 | Unblocked. |
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 |