Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Watermarks
Burn your logo, a line of text, or both into a video's renditions when they are encoded, so it shows in every player, embed and rendition download. Set a default for the app and change it for any video.
What is watermarked
The watermark is drawn into the picture of every rendition (240p to 1080p) when a video is encoded. Everything made from the renditions has it too: HLS and DASH playback, the MP4 downloads of each rendition, the seek-preview thumbnails and the animated preview.
/files/get/{rawFileId}), people can get the clean file: turn downloads off on the video, or keep the app or video private, when that matters. A watermark deters copying and shows where a copy came from; it doesn't stop someone determined from cropping or blurring it out.Audio files have no picture and are never watermarked: the app's default leaves them alone, and setting a watermark on one, or re-processing it, answers 409 not_supported_for_audio.
For a logo that sits on top of the player instead (clickable, and not part of the picture), use player branding. To watermark images, use the overlay and text transforms: a video watermark has the same options.
The watermark
A watermark has a logo, a text, or both, each placed on its own. Sizes are relative to the video, so one watermark sits in the same place, at the same size, in every rendition.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17{ "logo": { "fileId": "LOGO_FILE_ID", "width": 12, "position": "top-right", "x": 3, "y": 3, "opacity": 70 }, "text": { "value": "© Acme 2026", "font": "sans-bold", "size": 3, "color": "#ffffff", "position": "bottom-left" } }
logo: fileId is an image of the same app (PNG, JPEG, WebP, BMP or TIFF, at most 5 MB; upload it like any file). A file of another app, a quarantined one, and (for a scoped key without files:read) one that needs a signature to read are refused like one that doesn't exist. A tiled layer too small to tile on an HD picture is refused too. width is a percentage of the video's width (1 to 100, default 15); the logo keeps its shape. Transparency is kept.
text: value is up to 200 characters on up to 5 lines, drawn exactly as written: nothing in it is expanded or interpreted. font is one of the bundled fonts, sans, sans-bold (the default), sans-italic, mono or mono-bold, which cover Latin, Greek and Cyrillic. size is the font size as a percentage of the video's width (1 to 25, default 4). color (default white) and an optional background box are #rgb, #rrggbb or #rrggbbaa.
Placement, for each: position is a corner, the middle of an edge or center (default bottom-right); x and y move it in from that edge, as percentages of the video's width and height (0 to 50, default 3); opacity is 0 to 100 (default 80); rotate turns it clockwise, in degrees; tile: true repeats it across the whole picture, with gap between copies (a percentage of the width, default 10).
App default and per-video settings
Set the app's default in the dashboard (Settings, Video watermark) or with PUT /app/video-watermark. Every video follows it unless it has its own setting, on its Edit tab or with PUT /videos/{id}/watermark: app follows the default, off has none and custom has its own logo and text.
A watermark is applied when a video is encoded: when it is uploaded, and when it is replaced, trimmed, cut or blurred (each makes a new version from the clean original, with the watermark the video has then). Changing a watermark never re-encodes anything by itself. New uploads get the new default; an existing video keeps the watermark it was encoded with until you re-process it.
Re-process an existing video
GET /videos/{id}/watermark shows what the version that plays now was encoded with (applied) and what it would get now (effective); upToDate is false when they differ. The video's Edit tab says so, with a Re-process button.
Re-processing (POST /videos/{id}/reprocess) encodes the original again with the current watermark, as a new version: it works like a replacement, with replacement.reason reprocess. The current version keeps playing until the new one is ready; then the version goes up (URLs of the old version stop working, so caches and players move on) and video.replaced is sent. The original, trim, blurs, chapters and captions stay as they are; the poster, thumbnails and downloads are made again.
A video that is already up to date isn't re-encoded: the answer is 409 watermark_up_to_date and nothing is queued. A logo that can't be drawn any more (deleted, say) is left out of effective, as it is left out when the video is encoded.
SDKs
1 2 3 4 5 6 7 8 9 10 11 12// Node (Ruby, Python and PHP have the same in their own style) await fileboy.setAppVideoWatermark({ logo: { fileId: logoId, width: 12, position: "top-right", opacity: 70 }, }) // One video with its own, or none await fileboy.setVideoWatermark(videoId, { mode: "custom", text: { value: "Preview copy" } }) await fileboy.setVideoWatermark(videoId, { mode: "off" }) // Existing videos keep what they were encoded with until they are re-processed const state = await fileboy.getVideoWatermark(videoId) if (!state.upToDate) await fileboy.reprocessVideo(videoId)
Set the app's default
Sets the watermark the app's videos are encoded with, or removes it with null. Answers with it as stored, with every default filled in. GET /app/video-watermark reads it. Needs the app's own private key (not a scoped key).
1https://api.fileboy.io/app/video-watermark
Body
watermark object | null
A logo, text or both, as above. null removes the default.
Example
1curl -X PUT https://api.fileboy.io/app/video-watermark -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{"watermark": {"text": {"value": "© Acme 2026", "position": "bottom-left"}}}'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20{ "data": { "watermark": { "logo": null, "text": { "value": "© Acme 2026", "font": "sans-bold", "size": 4, "color": "#ffffff", "position": "bottom-left", "x": 3, "y": 3, "opacity": 80, "rotate": 0, "tile": false, "gap": 0 } } } }
Set a video's watermark
Sets one video's own setting and answers with its state, as GET /videos/{id}/watermark does. Nothing is re-encoded. Needs the private key, or a scoped key with videos:write (videos:read to GET).
1https://api.fileboy.io/videos/{id}/watermark
URL Params
id string
The video's id.
Body
watermark object | null
{"mode": "app"} (or null) follows the app, {"mode": "off"} has none, {"mode": "custom", "logo"?, "text"?} has its own.
Example
1curl -X PUT https://api.fileboy.io/videos/VIDEO_ID/watermark -H "Authorization: token YOUR_SIGNED_TOKEN" -H "Content-Type: application/json" -d '{"watermark": {"mode": "custom", "text": {"value": "Preview copy", "position": "center", "tile": true}}}'
1 2 3 4 5 6 7 8 9 10{ "data": { "setting": { "mode": "custom", "logo": null, "text": { "value": "Preview copy", ... } }, "appDefault": { "logo": null, "text": { "value": "© Acme 2026", ... } }, "effective": { "logo": null, "text": { "value": "Preview copy", ... } }, "applied": { "logo": null, "text": { "value": "© Acme 2026", ... } }, "upToDate": false, "supported": true } }
Re-process a video
Encodes the original again with the watermark the video has now, as a new version (202, replacement.reason reprocess). 409 watermark_up_to_date when nothing would change (nothing is queued), video_not_ready while it processes, replacement_in_progress while a replacement, trim, cut, blur or re-process waits or runs, not_supported_for_audio for an audio file. Needs the private key, or a scoped key with videos:write.
1https://api.fileboy.io/videos/{id}/reprocess
URL Params
id string
The video's id.
Example
1curl -X POST https://api.fileboy.io/videos/VIDEO_ID/reprocess -H "Authorization: token YOUR_SIGNED_TOKEN"
1 2 3 4 5 6 7 8{ "data": { "id": "VIDEO_ID", "version": 2, "replacement": { "status": "pending", "reason": "reprocess", "message": "", "replacedAt": null }, ... } }