Documentation

Guides and API reference for uploads, image transforms and video.

npm install @cd2/fileboy-react
API https://api.fileboy.io

Webhooks API reference

The webhooks 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.

Base URLhttps://api.fileboy.io

Events Fileboy sends to your server, the endpoints that receive them, and replaying past events again. Managing endpoints and replays needs your private key.

GET/webhooks/endpoints

List webhook endpoints

The app's webhook endpoints, oldest first, with their delivery health. An app has at most 10, so there are no pages. The signing secret is never part of a list: it is only sent when an endpoint is created or its secret is rotated.

Authorization: public key or signed token

Parameters

NameInTypeDescription
X-Fileboy-Appheaderstring (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

200The endpoints.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
POST/webhooks/endpoints

Create a webhook endpoint

Adds an endpoint that Fileboy sends events to, enabled. Its type is url (the default, a signed POST request), slack (a message in a channel, through a Slack incoming webhook) or email; event types, filters, retries, replays and the delivery log work the same for all three. A slack endpoint's url must be a Slack incoming webhook URL (https://hooks.slack.com/services/T…/B…/…, no redirects are followed). It is a secret: the answer and every later read show only a masked form. Each event is a readable message with what happened, the file or video's name and a link to it in the dashboard, and a thumbnail only when the file or video is public; no keys, signed URLs or metadata are put in it. An email endpoint takes up to 10 recipients. The addresses of the app's members are confirmed straight away; any other address is emailed a link to confirm and gets nothing until it does (status shows pending). Events within 5 minutes of the last email wait and go out together in one email, and every email has an unsubscribe link. An address that unsubscribed stays off for the app, even if it is added again. An app can ask for 30 confirmation emails a day, counted however the addresses change (429 rate_limited), and one address is sent at most 3 a day by all apps together (past that it is added, and emailed later when you ask again). Email endpoints have no delivery health or failure alerts: a delivery that can't be sent shows its reason in the delivery log. For a url endpoint: the URL must be https (in development http://localhost is allowed too) and point at a public address. Addresses that are private, loopback, link-local, cloud metadata and the like are refused, and a host name is resolved to check what it points at; Fileboy also refuses to connect to such an address when it delivers. events picks the event types, none (the default) meaning every event; filters narrow the file events and the video events, see WebhookEndpointFilters. An app can have 10 endpoints. The answer of a url endpoint holds its secret, which signs every delivery (see receiveWebhook). It is sent this once: store it now. If it is lost, rotate it. Errors: 400 validation_error for a type, URL, address, event type, filter or the limit that is refused, with a message that says why; 429 rate_limited at the daily limit of confirmation emails.

Authorization: public key or signed token

Parameters

NameInTypeDescription
X-Fileboy-Appheaderstring (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/json
type"url" | "slack" | "email"Where to deliver. url when left out.
urlstringRequired for url and slack. For url: https, and a public address (in development http://localhost is also allowed). For slack: a Slack incoming webhook URL, https://hooks.slack.com/services/T…/B…/… (or hooks.slack-gov.com), nothing else. Not allowed for email.
recipientsstring (email)[]Required for email: one to ten addresses. Not allowed for the other types.
descriptionstringUp to 200 characters, longer is cut.
events"file.uploaded" | "file.updated" | "file.deleted" | "file.restored" | "file.purged" | "file.moderation_flagged" | "file.infected" | "file.edit_completed" | "file.edit_failed" | "video.uploaded" | "video.playable" | "video.ready" | "video.failed" | "video.deleted" | "video.restored" | "video.purged" | "video.thumbnails_ready" | "video.thumbnails_failed" | "video.replaced" | "video.replacement_failed" | "video.comment_created" | "video.reaction_created" | "video.access_requested" | "video.transcribed" | "video.captions_translated" | "video.summarized" | "usage.threshold_reached" | "usage.threshold" | "usage.cap_reached"[]The event types to subscribe to. Empty or left out, every event.
filtersWebhookEndpointFilters

Responses

201The endpoint, with its secret for a url endpoint (Slack and email endpoints have none).
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
429An error. error is a short code and message says what went wrong.
application/json
GET/webhooks/endpoints/{id}

Get a webhook endpoint

One endpoint with its delivery health. It has no secret: that is only sent when it is created or rotated. An endpoint of another app is a 404.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A webhook endpoint id.
X-Fileboy-Appheaderstring (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

200The endpoint.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
PATCH/webhooks/endpoints/{id}

Change a webhook endpoint

Changes the fields you send and leaves the rest. The same checks as creating apply. Sending filters replaces all of them (null or {} removes them). Turning an endpoint on or off by hand, or pointing it at another URL, starts its health afresh: an old failing streak, or Fileboy having disabled it for failing, says nothing about it from then on. An endpoint that Fileboy disabled stays off until you set enabled: true. Errors: 400 validation_error; 404 endpoint_not_found; 429 rate_limited when new recipients would pass the daily limit of confirmation emails (nothing is changed then).

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A webhook endpoint id.
X-Fileboy-Appheaderstring (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/json
type"url" | "slack" | "email"Must be the endpoint's own type: it can't be changed.
urlstringA url endpoint's URL, or a slack endpoint's new Slack URL (sending back the masked url you read leaves it as it is).
recipientsstring (email)[]Replaces an email endpoint's addresses. An address already listed keeps its state (an unsubscribed one stays off), one still pending is asked again at most once a minute (and not at all, without an error, past a daily limit), a new one is asked to confirm, and one left out is removed. Leave it out to keep the addresses as they are.
descriptionstring
eventsstring[]Replaces the event types. Empty means every event.
enabledboolean
filtersWebhookEndpointFilters | nullReplaces the filters. null or {} removes them.

Responses

200The endpoint as it is now.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
429An error. error is a short code and message says what went wrong.
application/json
DELETE/webhooks/endpoints/{id}

Delete a webhook endpoint

Removes the endpoint and its delivery log. Events waiting to be sent to it are dropped. Replays skip it.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A webhook endpoint id.
X-Fileboy-Appheaderstring (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

204Deleted.
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
POST/webhooks/endpoints/{id}/rotate-secret

Rotate a webhook endpoint's secret

Gives a url endpoint a new signing secret and returns it this once (400 validation_error for a slack or email endpoint, which are not signed). Deliveries are signed with the secret as it is when they are sent, so the old secret stops signing straight away, including for deliveries waiting to be retried: update your receiver first, or accept both secrets briefly.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A webhook endpoint id.
X-Fileboy-Appheaderstring (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

200The endpoint, with its new secret.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
POST/webhooks/replays/preview

Count what a replay would send

How many events a replay with this body would send to each endpoint, without starting it. Takes the same body as starting one, and refuses what starting would refuse (except nothing_to_replay and too_many_events: check total against limit). With no endpointId every endpoint is listed; disabled ones have enabled: false and are skipped. Without an until the window ends now, so start the replay with the preview's until to send exactly what it counted.

Authorization: public key or signed token

Parameters

NameInTypeDescription
X-Fileboy-Appheaderstring (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/json
endpointIdstring (uuid)One endpoint. Left out, every enabled endpoint of the app.
since *string (date-time)Replay events recorded from this time, at most 30 days ago.
untilstring (date-time)And before this time. Defaults to now.
scope"failed" | "all"failed: only events the endpoint never received. all: every event, including ones it received.
eventTypes"file.uploaded" | "file.updated" | "file.deleted" | "file.restored" | "file.purged" | "file.moderation_flagged" | "file.infected" | "file.edit_completed" | "file.edit_failed" | "video.uploaded" | "video.playable" | "video.ready" | "video.failed" | "video.deleted" | "video.restored" | "video.purged" | "video.thumbnails_ready" | "video.thumbnails_failed" | "video.replaced" | "video.replacement_failed" | "video.comment_created" | "video.reaction_created" | "video.access_requested" | "video.transcribed" | "video.captions_translated" | "video.summarized" | "usage.threshold_reached" | "usage.threshold" | "usage.cap_reached"[]Only these event types. Empty or left out, every type each endpoint subscribes to.

Responses

200The counts.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
409An error. error is a short code and message says what went wrong.
application/json
POST/webhooks/replays

Replay past events

Sends the events recorded from since (at most 30 days ago, events are kept that long) until until (default now) again, to one endpoint or every enabled endpoint of the app. scope: failed (the default) sends only the events an endpoint never received: every attempt failed, or none was made because it was disabled. all sends every event. Events are only sent to endpoints that subscribe to their type now and existed when they happened, and events still being retried are left out. File events also follow each endpoint's filters as they are now, judged on the file as it was when the event was recorded: an event its filters skip is never replayed to it, and one the filters skipped then but match now counts as never received. The preview counts the same way. The events are chosen now, so the replay's progress.total is what it sends. Fileboy then sends them oldest first through its usual queue, at most 5 unfinished at a time per endpoint, each tried up to 5 times. Every replayed delivery has the event's original id and body, plus a replay object (id, requestedAt) that the signature covers and a Fileboy-Replay header. Replayed attempts don't change an endpoint's health, so they never send delivery alerts or disable it. A replay stops sending to an endpoint once 10 of its replayed deliveries in a row have failed, and skips endpoints that are disabled or deleted while it runs. One replay runs per app at a time (409 replay_running), and one sends up to 10,000 events (400 too_many_events: use a shorter window). Errors: 400 since_too_old, nothing_to_replay, invalid_parameter; 404 endpoint_not_found; 409 endpoint_disabled (enable it first).

Authorization: public key or signed token

Parameters

NameInTypeDescription
X-Fileboy-Appheaderstring (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/json
endpointIdstring (uuid)One endpoint. Left out, every enabled endpoint of the app.
since *string (date-time)Replay events recorded from this time, at most 30 days ago.
untilstring (date-time)And before this time. Defaults to now.
scope"failed" | "all"failed: only events the endpoint never received. all: every event, including ones it received.
eventTypes"file.uploaded" | "file.updated" | "file.deleted" | "file.restored" | "file.purged" | "file.moderation_flagged" | "file.infected" | "file.edit_completed" | "file.edit_failed" | "video.uploaded" | "video.playable" | "video.ready" | "video.failed" | "video.deleted" | "video.restored" | "video.purged" | "video.thumbnails_ready" | "video.thumbnails_failed" | "video.replaced" | "video.replacement_failed" | "video.comment_created" | "video.reaction_created" | "video.access_requested" | "video.transcribed" | "video.captions_translated" | "video.summarized" | "usage.threshold_reached" | "usage.threshold" | "usage.cap_reached"[]Only these event types. Empty or left out, every type each endpoint subscribes to.

Responses

201The replay, running.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
409An error. error is a short code and message says what went wrong.
application/json
GET/webhooks/replays

List replays

The app's replays, newest first, with their progress. Replays are kept for 30 days.

Authorization: public key or signed token

Parameters

NameInTypeDescription
limitqueryintegerHow many, 1 to 100.
X-Fileboy-Appheaderstring (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

200The replays.
application/json
400An error. error is a short code and message says what went wrong.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
GET/webhooks/replays/{id}

Get a replay

One replay and its progress, to follow it until its status is no longer running.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A replay id.
X-Fileboy-Appheaderstring (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

200The replay.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
POST/webhooks/replays/{id}/cancel

Cancel a replay

Stops a running replay: events it hasn't sent are not sent, and its deliveries waiting to be sent or retried are marked failed. A delivery being sent at that moment finishes, without a retry. Cancelling a cancelled replay changes nothing; a completed one is 409 replay_finished.

Authorization: public key or signed token

Parameters

NameInTypeDescription
id *pathstring (uuid)A replay id.
X-Fileboy-Appheaderstring (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

200The replay, cancelled.
application/json
401No key was sent.
application/json
403An error. error is a short code and message says what went wrong.
application/json
404An error. error is a short code and message says what went wrong.
application/json
409An error. error is a short code and message says what went wrong.
application/json