Documentation
Guides and API reference for uploads, image transforms and video.
npm install @cd2/fileboy-react API https://api.fileboy.io
Documentation menu
Images API reference
The images 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.ioServe images and transform them with a URL.
/images/get/{id}Get an image, optionally transformed
Serves an image, running the transforms in the transform query parameter in order. Results are cached per transform chain. A transform that does not parse, or would make the image too large, is answered with 400 and a JSON body saying what is wrong. Files that are not JPEG, PNG, WebP, BMP, TIFF or HEIC (GIF, SVG, PDF...) are served unchanged; a HEIC is written as JPEG unless a format is asked for. JPEG orientation from EXIF is applied, and transformed output carries no metadata. With format:auto the response varies on Accept and says so in Vary. Animated GIF and WebP are served unchanged. See the transform parameter for the grammar.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
transform | query | string | Transforms joined by ; and run in order, each written name:value~option:value. At most 20 transforms and 2048 characters.
Size and shape: resize:WxH (_ leaves a side free; options ~fit:cover|contain|fill|inside|outside, ~position:top-left|top|top-right|left|center|right|bottom-left|bottom|bottom-right, ~background:COLOUR, ~format:FORMAT, ~focus:X,Y to keep a point in view with fit cover, or ~focus:faces to keep the faces in view, ~upscale:false to never make the image bigger than its source), resizeAR:WxH (crop or pad to an aspect ratio; same options as resize except focus), crop:WxH (sizes in px or 50pc; @X,Y places the centre of the crop, or ~position: anchors it), smartCrop:WxH (crops to the most detailed part of the image; ~focus:faces centres it on the faces instead, falling back when there are none), rotate:DEGREES (clockwise, ~background:COLOUR), flip:x|y|xy, flop, radius:PX|max (rounded corners or a circle, ~background:), pad:ALL|V,H|T,R,B,L (~background:), border:PX (~color:), trim or trim:0-100 (cuts away a border of one colour, the top-left pixel's unless ~color: is given; the number is the tolerance, default 10), dpr:N (multiplies every pixel size, 0.1 to 5).
Look: blur:0-100, sharpen or sharpen:0-10, grayscale, saturate:N (0 grey, 1 unchanged, up to 10), brightness:-100-100, contrast:-100-100, hue:DEGREES, gamma:0.1-10, sepia or sepia:0-100, tint:COLOUR (alpha sets strength), opacity:0-100, pixelate:1-200, invert.
Layers: overlay:FILE_ID draws another image file of the same app on top (~width: and ~height: in px or pc of the image; one keeps its shape, both fit it inside the box; ~transform:(CHAIN) runs transforms on the overlay first). text:TEXT writes text, URL-encoded inside the transform (so encoded twice in the URL: %2520 for a space), up to 500 characters (~font:sans|sans-bold|sans-italic|mono|mono-bold, ~size:PX|Npc of the image height (default 32), ~color:, ~background: for a box, ~padding:PX, ~wrap:PX|Npc, ~align:left|center|right). Both take ~position: (default center), ~x: and ~y: (in from that edge, px or pc, may be negative), ~opacity:0-100, ~rotate:DEGREES and ~tile:true with ~gap: to repeat the layer as a pattern. At most 5 layers. An overlay must be a file of the same app (anything else is a 400 invalid_transform), an image of at most 25 MB; if it needs a signed URL, so does this request, even for a public image.
Output: format:auto|avif|webp|jpeg|png|tiff|bmp|json (auto picks AVIF, then WebP, then the source format, from what Accept allows; images over 16 megapixels are sent as WebP instead of AVIF; json answers with the image's size instead of the image), quality:1-100 (the same scale for JPEG, WebP and AVIF), lossless (lossless WebP or AVIF; auto keeps lossless chains on WebP), background:COLOUR (the default for later transforms that leave empty space), strip (re-encode without metadata), palette or palette:json|css (the image's main colours instead of the image, see the Palette schema; ~colors:0-16, default 6, and for CSS ~prefix:NAME). Whichever of format and palette comes last decides the output.
A transform's options can follow its name when its main value is left out, as in trim~color:white.
A value a transform doesn't take is a 400 invalid_transform, except resize's fit, position, background and format: as they always have, those fall back to the default (cover, center, none, the image's own format), and the response has a Fileboy-Transform-Warning header saying what was ignored.
Presets: preset:NAME runs a chain your app has saved (see /transform-presets), and can be combined with other steps, as in preset:thumbnail;grayscale. The combined chain is held to the same limits; an unknown preset is a 400 invalid_transform. Presets are used only at the top level, not inside an overlay's ~transform:(...). A preset URL is sent with Cache-Control: private, no-cache and an ETag that changes when the preset does, so editing a preset changes what its URLs return straight away. A signature covers preset:NAME as written, so a signed URL keeps working after the preset is edited.
Numbers past a limit are clamped (resize to 4000px, blur to 100...). Colours are hex(RGB), hex(RRGGBB), hex(RRGGBBAA), rgb(R,G,B), rgba(R,G,B,A) or a CSS name. Empty space is transparent in PNG, WebP, AVIF and TIFF and white in JPEG and BMP unless a background is given.e.g. resize:300x_~fit:cover;format:webp;quality:75e.g. resize:200x200~fit:contain~background:hex(fff)e.g. smartCrop:96x96;radius:max;dpr:2;format:autoe.g. smartCrop:96x96~focus:faces;radius:max;dpr:2;format:autoe.g. resize:800x_;format:avif;quality:60e.g. resize:1600x_;overlay:3f2a9c1e-7b4d-4e8a-9c6f-1d2e3f4a5b6c~width:15pc~position:bottom-right~x:24~y:24~opacity:85e.g. text:%C2%A9%20Jane%20Doe~size:4pc~color:white~background:hex(00000080)~padding:8~position:bottom-left~x:16~y:16e.g. resize:1200x600~focus:70pc,30pc;format:auto;quality:80e.g. resize:1600x_~upscale:false;format:autoe.g. trim;pad:24~background:white;resize:600x600~fit:contain~background:whitee.g. resize:300x_;format:jsone.g. palette~colors:4e.g. crop:100pcx20pc~position:top;palette:css~prefix:heroe.g. resizeAR:4x3~fit:contain~background:white;pad:16;border:1~color:hex(ddd) |
download | query | string | Add ?download to send the file as an attachment so browsers save it. download=false turns it off. |
fb_exp | query | integer (int64) | Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated). |
fb_sig | query | string | The signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise. |
fb_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed. |
Responses
200 | The image. Content-Type is the output format. With format:json, a JSON description of the image instead; with palette, its colours as JSON (a Palette) or, with palette:css, a stylesheet.image/*, text/css, application/json |
400 | The transform is not valid, the image is too large to transform, or an overlay is not an image file of this app (error is invalid_transform), the id is not a file id or PUBLIC_KEY+LABEL (invalid_id), or the file could not be read from storage (image_unreadable).application/json |
401 | The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.application/json |
403 | The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).application/json |
404 | No file with that id or label. error is file_not_found.application/json |
409 | Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).application/json |
422 | A palette or format:json was asked for a file that is not a JPEG, PNG, WebP, BMP, TIFF or HEIC image (a GIF or an SVG, say). error is unsupported_image.application/json |
429 | rate_limited: too many new (not yet cached) transforms from this address for this app, 120 a minute per server (four times that for a single preset). Retry-After says when to try again. Cached transforms, files served unchanged, signed URLs and private-key requests are not limited. Or delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
500 | The image could not be transformed. error is transform_failed or internal_error.application/json |
503 | transform_failed: the transform this request waited for was given up, more than once, by the requests making it. Try again.application/json |
/images/get/{id}Check an image
Same as the GET (the transform included), without the body.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
transform | query | string | Transforms joined by ; and run in order, each written name:value~option:value. At most 20 transforms and 2048 characters.
Size and shape: resize:WxH (_ leaves a side free; options ~fit:cover|contain|fill|inside|outside, ~position:top-left|top|top-right|left|center|right|bottom-left|bottom|bottom-right, ~background:COLOUR, ~format:FORMAT, ~focus:X,Y to keep a point in view with fit cover, or ~focus:faces to keep the faces in view, ~upscale:false to never make the image bigger than its source), resizeAR:WxH (crop or pad to an aspect ratio; same options as resize except focus), crop:WxH (sizes in px or 50pc; @X,Y places the centre of the crop, or ~position: anchors it), smartCrop:WxH (crops to the most detailed part of the image; ~focus:faces centres it on the faces instead, falling back when there are none), rotate:DEGREES (clockwise, ~background:COLOUR), flip:x|y|xy, flop, radius:PX|max (rounded corners or a circle, ~background:), pad:ALL|V,H|T,R,B,L (~background:), border:PX (~color:), trim or trim:0-100 (cuts away a border of one colour, the top-left pixel's unless ~color: is given; the number is the tolerance, default 10), dpr:N (multiplies every pixel size, 0.1 to 5).
Look: blur:0-100, sharpen or sharpen:0-10, grayscale, saturate:N (0 grey, 1 unchanged, up to 10), brightness:-100-100, contrast:-100-100, hue:DEGREES, gamma:0.1-10, sepia or sepia:0-100, tint:COLOUR (alpha sets strength), opacity:0-100, pixelate:1-200, invert.
Layers: overlay:FILE_ID draws another image file of the same app on top (~width: and ~height: in px or pc of the image; one keeps its shape, both fit it inside the box; ~transform:(CHAIN) runs transforms on the overlay first). text:TEXT writes text, URL-encoded inside the transform (so encoded twice in the URL: %2520 for a space), up to 500 characters (~font:sans|sans-bold|sans-italic|mono|mono-bold, ~size:PX|Npc of the image height (default 32), ~color:, ~background: for a box, ~padding:PX, ~wrap:PX|Npc, ~align:left|center|right). Both take ~position: (default center), ~x: and ~y: (in from that edge, px or pc, may be negative), ~opacity:0-100, ~rotate:DEGREES and ~tile:true with ~gap: to repeat the layer as a pattern. At most 5 layers. An overlay must be a file of the same app (anything else is a 400 invalid_transform), an image of at most 25 MB; if it needs a signed URL, so does this request, even for a public image.
Output: format:auto|avif|webp|jpeg|png|tiff|bmp|json (auto picks AVIF, then WebP, then the source format, from what Accept allows; images over 16 megapixels are sent as WebP instead of AVIF; json answers with the image's size instead of the image), quality:1-100 (the same scale for JPEG, WebP and AVIF), lossless (lossless WebP or AVIF; auto keeps lossless chains on WebP), background:COLOUR (the default for later transforms that leave empty space), strip (re-encode without metadata), palette or palette:json|css (the image's main colours instead of the image, see the Palette schema; ~colors:0-16, default 6, and for CSS ~prefix:NAME). Whichever of format and palette comes last decides the output.
A transform's options can follow its name when its main value is left out, as in trim~color:white.
A value a transform doesn't take is a 400 invalid_transform, except resize's fit, position, background and format: as they always have, those fall back to the default (cover, center, none, the image's own format), and the response has a Fileboy-Transform-Warning header saying what was ignored.
Presets: preset:NAME runs a chain your app has saved (see /transform-presets), and can be combined with other steps, as in preset:thumbnail;grayscale. The combined chain is held to the same limits; an unknown preset is a 400 invalid_transform. Presets are used only at the top level, not inside an overlay's ~transform:(...). A preset URL is sent with Cache-Control: private, no-cache and an ETag that changes when the preset does, so editing a preset changes what its URLs return straight away. A signature covers preset:NAME as written, so a signed URL keeps working after the preset is edited.
Numbers past a limit are clamped (resize to 4000px, blur to 100...). Colours are hex(RGB), hex(RRGGBB), hex(RRGGBBAA), rgb(R,G,B), rgba(R,G,B,A) or a CSS name. Empty space is transparent in PNG, WebP, AVIF and TIFF and white in JPEG and BMP unless a background is given.e.g. resize:300x_~fit:cover;format:webp;quality:75e.g. resize:200x200~fit:contain~background:hex(fff)e.g. smartCrop:96x96;radius:max;dpr:2;format:autoe.g. smartCrop:96x96~focus:faces;radius:max;dpr:2;format:autoe.g. resize:800x_;format:avif;quality:60e.g. resize:1600x_;overlay:3f2a9c1e-7b4d-4e8a-9c6f-1d2e3f4a5b6c~width:15pc~position:bottom-right~x:24~y:24~opacity:85e.g. text:%C2%A9%20Jane%20Doe~size:4pc~color:white~background:hex(00000080)~padding:8~position:bottom-left~x:16~y:16e.g. resize:1200x600~focus:70pc,30pc;format:auto;quality:80e.g. resize:1600x_~upscale:false;format:autoe.g. trim;pad:24~background:white;resize:600x600~fit:contain~background:whitee.g. resize:300x_;format:jsone.g. palette~colors:4e.g. crop:100pcx20pc~position:top;palette:css~prefix:heroe.g. resizeAR:4x3~fit:contain~background:white;pad:16;border:1~color:hex(ddd) |
download | query | string | Add ?download to send the file as an attachment so browsers save it. download=false turns it off. |
fb_exp | query | integer (int64) | Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated). |
fb_sig | query | string | The signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise. |
fb_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed. |
Responses
200 | The image. Content-Type is the output format. With format:json, a JSON description of the image instead; with palette, its colours as JSON (a Palette) or, with palette:css, a stylesheet. Headers only. |
400 | The transform is not valid, the image is too large to transform, or an overlay is not an image file of this app (error is invalid_transform), the id is not a file id or PUBLIC_KEY+LABEL (invalid_id), or the file could not be read from storage (image_unreadable).application/json |
401 | The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.application/json |
403 | The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).application/json |
404 | No file with that id or label. error is file_not_found.application/json |
409 | Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).application/json |
422 | A palette or format:json was asked for a file that is not a JPEG, PNG, WebP, BMP, TIFF or HEIC image (a GIF or an SVG, say). error is unsupported_image.application/json |
429 | rate_limited: too many new (not yet cached) transforms from this address for this app, 120 a minute per server (four times that for a single preset). Retry-After says when to try again. Cached transforms, files served unchanged, signed URLs and private-key requests are not limited. Or delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
500 | The image could not be transformed. error is transform_failed or internal_error.application/json |
503 | transform_failed: the transform this request waited for was given up, more than once, by the requests making it. Try again.application/json |
/images/get/{id}/{filename}Get an image under a chosen file name
Serves an image, running the transforms in the transform query parameter in order. Results are cached per transform chain. A transform that does not parse, or would make the image too large, is answered with 400 and a JSON body saying what is wrong. Files that are not JPEG, PNG, WebP, BMP, TIFF or HEIC (GIF, SVG, PDF...) are served unchanged; a HEIC is written as JPEG unless a format is asked for. JPEG orientation from EXIF is applied, and transformed output carries no metadata. With format:auto the response varies on Accept and says so in Vary. Animated GIF and WebP are served unchanged. See the transform parameter for the grammar.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
filename * | path | string | File name to serve the file as. If it has no extension, one is added from the file's type. |
transform | query | string | Transforms joined by ; and run in order, each written name:value~option:value. At most 20 transforms and 2048 characters.
Size and shape: resize:WxH (_ leaves a side free; options ~fit:cover|contain|fill|inside|outside, ~position:top-left|top|top-right|left|center|right|bottom-left|bottom|bottom-right, ~background:COLOUR, ~format:FORMAT, ~focus:X,Y to keep a point in view with fit cover, or ~focus:faces to keep the faces in view, ~upscale:false to never make the image bigger than its source), resizeAR:WxH (crop or pad to an aspect ratio; same options as resize except focus), crop:WxH (sizes in px or 50pc; @X,Y places the centre of the crop, or ~position: anchors it), smartCrop:WxH (crops to the most detailed part of the image; ~focus:faces centres it on the faces instead, falling back when there are none), rotate:DEGREES (clockwise, ~background:COLOUR), flip:x|y|xy, flop, radius:PX|max (rounded corners or a circle, ~background:), pad:ALL|V,H|T,R,B,L (~background:), border:PX (~color:), trim or trim:0-100 (cuts away a border of one colour, the top-left pixel's unless ~color: is given; the number is the tolerance, default 10), dpr:N (multiplies every pixel size, 0.1 to 5).
Look: blur:0-100, sharpen or sharpen:0-10, grayscale, saturate:N (0 grey, 1 unchanged, up to 10), brightness:-100-100, contrast:-100-100, hue:DEGREES, gamma:0.1-10, sepia or sepia:0-100, tint:COLOUR (alpha sets strength), opacity:0-100, pixelate:1-200, invert.
Layers: overlay:FILE_ID draws another image file of the same app on top (~width: and ~height: in px or pc of the image; one keeps its shape, both fit it inside the box; ~transform:(CHAIN) runs transforms on the overlay first). text:TEXT writes text, URL-encoded inside the transform (so encoded twice in the URL: %2520 for a space), up to 500 characters (~font:sans|sans-bold|sans-italic|mono|mono-bold, ~size:PX|Npc of the image height (default 32), ~color:, ~background: for a box, ~padding:PX, ~wrap:PX|Npc, ~align:left|center|right). Both take ~position: (default center), ~x: and ~y: (in from that edge, px or pc, may be negative), ~opacity:0-100, ~rotate:DEGREES and ~tile:true with ~gap: to repeat the layer as a pattern. At most 5 layers. An overlay must be a file of the same app (anything else is a 400 invalid_transform), an image of at most 25 MB; if it needs a signed URL, so does this request, even for a public image.
Output: format:auto|avif|webp|jpeg|png|tiff|bmp|json (auto picks AVIF, then WebP, then the source format, from what Accept allows; images over 16 megapixels are sent as WebP instead of AVIF; json answers with the image's size instead of the image), quality:1-100 (the same scale for JPEG, WebP and AVIF), lossless (lossless WebP or AVIF; auto keeps lossless chains on WebP), background:COLOUR (the default for later transforms that leave empty space), strip (re-encode without metadata), palette or palette:json|css (the image's main colours instead of the image, see the Palette schema; ~colors:0-16, default 6, and for CSS ~prefix:NAME). Whichever of format and palette comes last decides the output.
A transform's options can follow its name when its main value is left out, as in trim~color:white.
A value a transform doesn't take is a 400 invalid_transform, except resize's fit, position, background and format: as they always have, those fall back to the default (cover, center, none, the image's own format), and the response has a Fileboy-Transform-Warning header saying what was ignored.
Presets: preset:NAME runs a chain your app has saved (see /transform-presets), and can be combined with other steps, as in preset:thumbnail;grayscale. The combined chain is held to the same limits; an unknown preset is a 400 invalid_transform. Presets are used only at the top level, not inside an overlay's ~transform:(...). A preset URL is sent with Cache-Control: private, no-cache and an ETag that changes when the preset does, so editing a preset changes what its URLs return straight away. A signature covers preset:NAME as written, so a signed URL keeps working after the preset is edited.
Numbers past a limit are clamped (resize to 4000px, blur to 100...). Colours are hex(RGB), hex(RRGGBB), hex(RRGGBBAA), rgb(R,G,B), rgba(R,G,B,A) or a CSS name. Empty space is transparent in PNG, WebP, AVIF and TIFF and white in JPEG and BMP unless a background is given.e.g. resize:300x_~fit:cover;format:webp;quality:75e.g. resize:200x200~fit:contain~background:hex(fff)e.g. smartCrop:96x96;radius:max;dpr:2;format:autoe.g. smartCrop:96x96~focus:faces;radius:max;dpr:2;format:autoe.g. resize:800x_;format:avif;quality:60e.g. resize:1600x_;overlay:3f2a9c1e-7b4d-4e8a-9c6f-1d2e3f4a5b6c~width:15pc~position:bottom-right~x:24~y:24~opacity:85e.g. text:%C2%A9%20Jane%20Doe~size:4pc~color:white~background:hex(00000080)~padding:8~position:bottom-left~x:16~y:16e.g. resize:1200x600~focus:70pc,30pc;format:auto;quality:80e.g. resize:1600x_~upscale:false;format:autoe.g. trim;pad:24~background:white;resize:600x600~fit:contain~background:whitee.g. resize:300x_;format:jsone.g. palette~colors:4e.g. crop:100pcx20pc~position:top;palette:css~prefix:heroe.g. resizeAR:4x3~fit:contain~background:white;pad:16;border:1~color:hex(ddd) |
download | query | string | Add ?download to send the file as an attachment so browsers save it. download=false turns it off. |
fb_exp | query | integer (int64) | Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated). |
fb_sig | query | string | The signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise. |
fb_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed. |
Responses
200 | The image. Content-Type is the output format. With format:json, a JSON description of the image instead; with palette, its colours as JSON (a Palette) or, with palette:css, a stylesheet.image/*, text/css, application/json |
400 | The transform is not valid, the image is too large to transform, or an overlay is not an image file of this app (error is invalid_transform), the id is not a file id or PUBLIC_KEY+LABEL (invalid_id), or the file could not be read from storage (image_unreadable).application/json |
401 | The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.application/json |
403 | The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).application/json |
404 | No file with that id or label. error is file_not_found.application/json |
409 | Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).application/json |
422 | A palette or format:json was asked for a file that is not a JPEG, PNG, WebP, BMP, TIFF or HEIC image (a GIF or an SVG, say). error is unsupported_image.application/json |
429 | rate_limited: too many new (not yet cached) transforms from this address for this app, 120 a minute per server (four times that for a single preset). Retry-After says when to try again. Cached transforms, files served unchanged, signed URLs and private-key requests are not limited. Or delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
500 | The image could not be transformed. error is transform_failed or internal_error.application/json |
503 | transform_failed: the transform this request waited for was given up, more than once, by the requests making it. Try again.application/json |
/images/get/{id}/{filename}Check an image under a chosen file name
Same as the GET (the transform included), without the body.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
filename * | path | string | File name to serve the file as. If it has no extension, one is added from the file's type. |
transform | query | string | Transforms joined by ; and run in order, each written name:value~option:value. At most 20 transforms and 2048 characters.
Size and shape: resize:WxH (_ leaves a side free; options ~fit:cover|contain|fill|inside|outside, ~position:top-left|top|top-right|left|center|right|bottom-left|bottom|bottom-right, ~background:COLOUR, ~format:FORMAT, ~focus:X,Y to keep a point in view with fit cover, or ~focus:faces to keep the faces in view, ~upscale:false to never make the image bigger than its source), resizeAR:WxH (crop or pad to an aspect ratio; same options as resize except focus), crop:WxH (sizes in px or 50pc; @X,Y places the centre of the crop, or ~position: anchors it), smartCrop:WxH (crops to the most detailed part of the image; ~focus:faces centres it on the faces instead, falling back when there are none), rotate:DEGREES (clockwise, ~background:COLOUR), flip:x|y|xy, flop, radius:PX|max (rounded corners or a circle, ~background:), pad:ALL|V,H|T,R,B,L (~background:), border:PX (~color:), trim or trim:0-100 (cuts away a border of one colour, the top-left pixel's unless ~color: is given; the number is the tolerance, default 10), dpr:N (multiplies every pixel size, 0.1 to 5).
Look: blur:0-100, sharpen or sharpen:0-10, grayscale, saturate:N (0 grey, 1 unchanged, up to 10), brightness:-100-100, contrast:-100-100, hue:DEGREES, gamma:0.1-10, sepia or sepia:0-100, tint:COLOUR (alpha sets strength), opacity:0-100, pixelate:1-200, invert.
Layers: overlay:FILE_ID draws another image file of the same app on top (~width: and ~height: in px or pc of the image; one keeps its shape, both fit it inside the box; ~transform:(CHAIN) runs transforms on the overlay first). text:TEXT writes text, URL-encoded inside the transform (so encoded twice in the URL: %2520 for a space), up to 500 characters (~font:sans|sans-bold|sans-italic|mono|mono-bold, ~size:PX|Npc of the image height (default 32), ~color:, ~background: for a box, ~padding:PX, ~wrap:PX|Npc, ~align:left|center|right). Both take ~position: (default center), ~x: and ~y: (in from that edge, px or pc, may be negative), ~opacity:0-100, ~rotate:DEGREES and ~tile:true with ~gap: to repeat the layer as a pattern. At most 5 layers. An overlay must be a file of the same app (anything else is a 400 invalid_transform), an image of at most 25 MB; if it needs a signed URL, so does this request, even for a public image.
Output: format:auto|avif|webp|jpeg|png|tiff|bmp|json (auto picks AVIF, then WebP, then the source format, from what Accept allows; images over 16 megapixels are sent as WebP instead of AVIF; json answers with the image's size instead of the image), quality:1-100 (the same scale for JPEG, WebP and AVIF), lossless (lossless WebP or AVIF; auto keeps lossless chains on WebP), background:COLOUR (the default for later transforms that leave empty space), strip (re-encode without metadata), palette or palette:json|css (the image's main colours instead of the image, see the Palette schema; ~colors:0-16, default 6, and for CSS ~prefix:NAME). Whichever of format and palette comes last decides the output.
A transform's options can follow its name when its main value is left out, as in trim~color:white.
A value a transform doesn't take is a 400 invalid_transform, except resize's fit, position, background and format: as they always have, those fall back to the default (cover, center, none, the image's own format), and the response has a Fileboy-Transform-Warning header saying what was ignored.
Presets: preset:NAME runs a chain your app has saved (see /transform-presets), and can be combined with other steps, as in preset:thumbnail;grayscale. The combined chain is held to the same limits; an unknown preset is a 400 invalid_transform. Presets are used only at the top level, not inside an overlay's ~transform:(...). A preset URL is sent with Cache-Control: private, no-cache and an ETag that changes when the preset does, so editing a preset changes what its URLs return straight away. A signature covers preset:NAME as written, so a signed URL keeps working after the preset is edited.
Numbers past a limit are clamped (resize to 4000px, blur to 100...). Colours are hex(RGB), hex(RRGGBB), hex(RRGGBBAA), rgb(R,G,B), rgba(R,G,B,A) or a CSS name. Empty space is transparent in PNG, WebP, AVIF and TIFF and white in JPEG and BMP unless a background is given.e.g. resize:300x_~fit:cover;format:webp;quality:75e.g. resize:200x200~fit:contain~background:hex(fff)e.g. smartCrop:96x96;radius:max;dpr:2;format:autoe.g. smartCrop:96x96~focus:faces;radius:max;dpr:2;format:autoe.g. resize:800x_;format:avif;quality:60e.g. resize:1600x_;overlay:3f2a9c1e-7b4d-4e8a-9c6f-1d2e3f4a5b6c~width:15pc~position:bottom-right~x:24~y:24~opacity:85e.g. text:%C2%A9%20Jane%20Doe~size:4pc~color:white~background:hex(00000080)~padding:8~position:bottom-left~x:16~y:16e.g. resize:1200x600~focus:70pc,30pc;format:auto;quality:80e.g. resize:1600x_~upscale:false;format:autoe.g. trim;pad:24~background:white;resize:600x600~fit:contain~background:whitee.g. resize:300x_;format:jsone.g. palette~colors:4e.g. crop:100pcx20pc~position:top;palette:css~prefix:heroe.g. resizeAR:4x3~fit:contain~background:white;pad:16;border:1~color:hex(ddd) |
download | query | string | Add ?download to send the file as an attachment so browsers save it. download=false turns it off. |
fb_exp | query | integer (int64) | Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated). |
fb_sig | query | string | The signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise. |
fb_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed. |
Responses
200 | The image. Content-Type is the output format. With format:json, a JSON description of the image instead; with palette, its colours as JSON (a Palette) or, with palette:css, a stylesheet. Headers only. |
400 | The transform is not valid, the image is too large to transform, or an overlay is not an image file of this app (error is invalid_transform), the id is not a file id or PUBLIC_KEY+LABEL (invalid_id), or the file could not be read from storage (image_unreadable).application/json |
401 | The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.application/json |
403 | The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).application/json |
404 | No file with that id or label. error is file_not_found.application/json |
409 | Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).application/json |
422 | A palette or format:json was asked for a file that is not a JPEG, PNG, WebP, BMP, TIFF or HEIC image (a GIF or an SVG, say). error is unsupported_image.application/json |
429 | rate_limited: too many new (not yet cached) transforms from this address for this app, 120 a minute per server (four times that for a single preset). Retry-After says when to try again. Cached transforms, files served unchanged, signed URLs and private-key requests are not limited. Or delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
500 | The image could not be transformed. error is transform_failed or internal_error.application/json |
503 | transform_failed: the transform this request waited for was given up, more than once, by the requests making it. Try again.application/json |
/images/{id}DEPRECATEDGet an image, optionally transformed
Legacy alias of /images/get/{id}. Serves an image, running the transforms in the transform query parameter in order. Results are cached per transform chain. A transform that does not parse, or would make the image too large, is answered with 400 and a JSON body saying what is wrong. Files that are not JPEG, PNG, WebP, BMP, TIFF or HEIC (GIF, SVG, PDF...) are served unchanged; a HEIC is written as JPEG unless a format is asked for. JPEG orientation from EXIF is applied, and transformed output carries no metadata. With format:auto the response varies on Accept and says so in Vary. Animated GIF and WebP are served unchanged. See the transform parameter for the grammar.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
transform | query | string | Transforms joined by ; and run in order, each written name:value~option:value. At most 20 transforms and 2048 characters.
Size and shape: resize:WxH (_ leaves a side free; options ~fit:cover|contain|fill|inside|outside, ~position:top-left|top|top-right|left|center|right|bottom-left|bottom|bottom-right, ~background:COLOUR, ~format:FORMAT, ~focus:X,Y to keep a point in view with fit cover, or ~focus:faces to keep the faces in view, ~upscale:false to never make the image bigger than its source), resizeAR:WxH (crop or pad to an aspect ratio; same options as resize except focus), crop:WxH (sizes in px or 50pc; @X,Y places the centre of the crop, or ~position: anchors it), smartCrop:WxH (crops to the most detailed part of the image; ~focus:faces centres it on the faces instead, falling back when there are none), rotate:DEGREES (clockwise, ~background:COLOUR), flip:x|y|xy, flop, radius:PX|max (rounded corners or a circle, ~background:), pad:ALL|V,H|T,R,B,L (~background:), border:PX (~color:), trim or trim:0-100 (cuts away a border of one colour, the top-left pixel's unless ~color: is given; the number is the tolerance, default 10), dpr:N (multiplies every pixel size, 0.1 to 5).
Look: blur:0-100, sharpen or sharpen:0-10, grayscale, saturate:N (0 grey, 1 unchanged, up to 10), brightness:-100-100, contrast:-100-100, hue:DEGREES, gamma:0.1-10, sepia or sepia:0-100, tint:COLOUR (alpha sets strength), opacity:0-100, pixelate:1-200, invert.
Layers: overlay:FILE_ID draws another image file of the same app on top (~width: and ~height: in px or pc of the image; one keeps its shape, both fit it inside the box; ~transform:(CHAIN) runs transforms on the overlay first). text:TEXT writes text, URL-encoded inside the transform (so encoded twice in the URL: %2520 for a space), up to 500 characters (~font:sans|sans-bold|sans-italic|mono|mono-bold, ~size:PX|Npc of the image height (default 32), ~color:, ~background: for a box, ~padding:PX, ~wrap:PX|Npc, ~align:left|center|right). Both take ~position: (default center), ~x: and ~y: (in from that edge, px or pc, may be negative), ~opacity:0-100, ~rotate:DEGREES and ~tile:true with ~gap: to repeat the layer as a pattern. At most 5 layers. An overlay must be a file of the same app (anything else is a 400 invalid_transform), an image of at most 25 MB; if it needs a signed URL, so does this request, even for a public image.
Output: format:auto|avif|webp|jpeg|png|tiff|bmp|json (auto picks AVIF, then WebP, then the source format, from what Accept allows; images over 16 megapixels are sent as WebP instead of AVIF; json answers with the image's size instead of the image), quality:1-100 (the same scale for JPEG, WebP and AVIF), lossless (lossless WebP or AVIF; auto keeps lossless chains on WebP), background:COLOUR (the default for later transforms that leave empty space), strip (re-encode without metadata), palette or palette:json|css (the image's main colours instead of the image, see the Palette schema; ~colors:0-16, default 6, and for CSS ~prefix:NAME). Whichever of format and palette comes last decides the output.
A transform's options can follow its name when its main value is left out, as in trim~color:white.
A value a transform doesn't take is a 400 invalid_transform, except resize's fit, position, background and format: as they always have, those fall back to the default (cover, center, none, the image's own format), and the response has a Fileboy-Transform-Warning header saying what was ignored.
Presets: preset:NAME runs a chain your app has saved (see /transform-presets), and can be combined with other steps, as in preset:thumbnail;grayscale. The combined chain is held to the same limits; an unknown preset is a 400 invalid_transform. Presets are used only at the top level, not inside an overlay's ~transform:(...). A preset URL is sent with Cache-Control: private, no-cache and an ETag that changes when the preset does, so editing a preset changes what its URLs return straight away. A signature covers preset:NAME as written, so a signed URL keeps working after the preset is edited.
Numbers past a limit are clamped (resize to 4000px, blur to 100...). Colours are hex(RGB), hex(RRGGBB), hex(RRGGBBAA), rgb(R,G,B), rgba(R,G,B,A) or a CSS name. Empty space is transparent in PNG, WebP, AVIF and TIFF and white in JPEG and BMP unless a background is given.e.g. resize:300x_~fit:cover;format:webp;quality:75e.g. resize:200x200~fit:contain~background:hex(fff)e.g. smartCrop:96x96;radius:max;dpr:2;format:autoe.g. smartCrop:96x96~focus:faces;radius:max;dpr:2;format:autoe.g. resize:800x_;format:avif;quality:60e.g. resize:1600x_;overlay:3f2a9c1e-7b4d-4e8a-9c6f-1d2e3f4a5b6c~width:15pc~position:bottom-right~x:24~y:24~opacity:85e.g. text:%C2%A9%20Jane%20Doe~size:4pc~color:white~background:hex(00000080)~padding:8~position:bottom-left~x:16~y:16e.g. resize:1200x600~focus:70pc,30pc;format:auto;quality:80e.g. resize:1600x_~upscale:false;format:autoe.g. trim;pad:24~background:white;resize:600x600~fit:contain~background:whitee.g. resize:300x_;format:jsone.g. palette~colors:4e.g. crop:100pcx20pc~position:top;palette:css~prefix:heroe.g. resizeAR:4x3~fit:contain~background:white;pad:16;border:1~color:hex(ddd) |
download | query | string | Add ?download to send the file as an attachment so browsers save it. download=false turns it off. |
fb_exp | query | integer (int64) | Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated). |
fb_sig | query | string | The signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise. |
fb_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed. |
Responses
200 | The image. Content-Type is the output format. With format:json, a JSON description of the image instead; with palette, its colours as JSON (a Palette) or, with palette:css, a stylesheet.image/*, text/css, application/json |
400 | The transform is not valid, the image is too large to transform, or an overlay is not an image file of this app (error is invalid_transform), the id is not a file id or PUBLIC_KEY+LABEL (invalid_id), or the file could not be read from storage (image_unreadable).application/json |
401 | The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.application/json |
403 | The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).application/json |
404 | No file with that id or label. error is file_not_found.application/json |
409 | Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).application/json |
422 | A palette or format:json was asked for a file that is not a JPEG, PNG, WebP, BMP, TIFF or HEIC image (a GIF or an SVG, say). error is unsupported_image.application/json |
429 | rate_limited: too many new (not yet cached) transforms from this address for this app, 120 a minute per server (four times that for a single preset). Retry-After says when to try again. Cached transforms, files served unchanged, signed URLs and private-key requests are not limited. Or delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
500 | The image could not be transformed. error is transform_failed or internal_error.application/json |
503 | transform_failed: the transform this request waited for was given up, more than once, by the requests making it. Try again.application/json |
/images/{id}DEPRECATEDCheck an image
Same as the GET (the transform included), without the body.
Authorization: public key or signed token
Parameters
| Name | In | Type | Description |
|---|---|---|---|
id * | path | string | A file id (UUID), or PUBLIC_KEY+LABEL to address a labelled file.e.g. 2a860257-ecf9-424a-846e-00ab68e2fd58e.g. YOUR_PUBLIC_KEY+logo |
transform | query | string | Transforms joined by ; and run in order, each written name:value~option:value. At most 20 transforms and 2048 characters.
Size and shape: resize:WxH (_ leaves a side free; options ~fit:cover|contain|fill|inside|outside, ~position:top-left|top|top-right|left|center|right|bottom-left|bottom|bottom-right, ~background:COLOUR, ~format:FORMAT, ~focus:X,Y to keep a point in view with fit cover, or ~focus:faces to keep the faces in view, ~upscale:false to never make the image bigger than its source), resizeAR:WxH (crop or pad to an aspect ratio; same options as resize except focus), crop:WxH (sizes in px or 50pc; @X,Y places the centre of the crop, or ~position: anchors it), smartCrop:WxH (crops to the most detailed part of the image; ~focus:faces centres it on the faces instead, falling back when there are none), rotate:DEGREES (clockwise, ~background:COLOUR), flip:x|y|xy, flop, radius:PX|max (rounded corners or a circle, ~background:), pad:ALL|V,H|T,R,B,L (~background:), border:PX (~color:), trim or trim:0-100 (cuts away a border of one colour, the top-left pixel's unless ~color: is given; the number is the tolerance, default 10), dpr:N (multiplies every pixel size, 0.1 to 5).
Look: blur:0-100, sharpen or sharpen:0-10, grayscale, saturate:N (0 grey, 1 unchanged, up to 10), brightness:-100-100, contrast:-100-100, hue:DEGREES, gamma:0.1-10, sepia or sepia:0-100, tint:COLOUR (alpha sets strength), opacity:0-100, pixelate:1-200, invert.
Layers: overlay:FILE_ID draws another image file of the same app on top (~width: and ~height: in px or pc of the image; one keeps its shape, both fit it inside the box; ~transform:(CHAIN) runs transforms on the overlay first). text:TEXT writes text, URL-encoded inside the transform (so encoded twice in the URL: %2520 for a space), up to 500 characters (~font:sans|sans-bold|sans-italic|mono|mono-bold, ~size:PX|Npc of the image height (default 32), ~color:, ~background: for a box, ~padding:PX, ~wrap:PX|Npc, ~align:left|center|right). Both take ~position: (default center), ~x: and ~y: (in from that edge, px or pc, may be negative), ~opacity:0-100, ~rotate:DEGREES and ~tile:true with ~gap: to repeat the layer as a pattern. At most 5 layers. An overlay must be a file of the same app (anything else is a 400 invalid_transform), an image of at most 25 MB; if it needs a signed URL, so does this request, even for a public image.
Output: format:auto|avif|webp|jpeg|png|tiff|bmp|json (auto picks AVIF, then WebP, then the source format, from what Accept allows; images over 16 megapixels are sent as WebP instead of AVIF; json answers with the image's size instead of the image), quality:1-100 (the same scale for JPEG, WebP and AVIF), lossless (lossless WebP or AVIF; auto keeps lossless chains on WebP), background:COLOUR (the default for later transforms that leave empty space), strip (re-encode without metadata), palette or palette:json|css (the image's main colours instead of the image, see the Palette schema; ~colors:0-16, default 6, and for CSS ~prefix:NAME). Whichever of format and palette comes last decides the output.
A transform's options can follow its name when its main value is left out, as in trim~color:white.
A value a transform doesn't take is a 400 invalid_transform, except resize's fit, position, background and format: as they always have, those fall back to the default (cover, center, none, the image's own format), and the response has a Fileboy-Transform-Warning header saying what was ignored.
Presets: preset:NAME runs a chain your app has saved (see /transform-presets), and can be combined with other steps, as in preset:thumbnail;grayscale. The combined chain is held to the same limits; an unknown preset is a 400 invalid_transform. Presets are used only at the top level, not inside an overlay's ~transform:(...). A preset URL is sent with Cache-Control: private, no-cache and an ETag that changes when the preset does, so editing a preset changes what its URLs return straight away. A signature covers preset:NAME as written, so a signed URL keeps working after the preset is edited.
Numbers past a limit are clamped (resize to 4000px, blur to 100...). Colours are hex(RGB), hex(RRGGBB), hex(RRGGBBAA), rgb(R,G,B), rgba(R,G,B,A) or a CSS name. Empty space is transparent in PNG, WebP, AVIF and TIFF and white in JPEG and BMP unless a background is given.e.g. resize:300x_~fit:cover;format:webp;quality:75e.g. resize:200x200~fit:contain~background:hex(fff)e.g. smartCrop:96x96;radius:max;dpr:2;format:autoe.g. smartCrop:96x96~focus:faces;radius:max;dpr:2;format:autoe.g. resize:800x_;format:avif;quality:60e.g. resize:1600x_;overlay:3f2a9c1e-7b4d-4e8a-9c6f-1d2e3f4a5b6c~width:15pc~position:bottom-right~x:24~y:24~opacity:85e.g. text:%C2%A9%20Jane%20Doe~size:4pc~color:white~background:hex(00000080)~padding:8~position:bottom-left~x:16~y:16e.g. resize:1200x600~focus:70pc,30pc;format:auto;quality:80e.g. resize:1600x_~upscale:false;format:autoe.g. trim;pad:24~background:white;resize:600x600~fit:contain~background:whitee.g. resize:300x_;format:jsone.g. palette~colors:4e.g. crop:100pcx20pc~position:top;palette:css~prefix:heroe.g. resizeAR:4x3~fit:contain~background:white;pad:16;border:1~color:hex(ddd) |
download | query | string | Add ?download to send the file as an attachment so browsers save it. download=false turns it off. |
fb_exp | query | integer (int64) | Unix time in seconds after which a signed URL stops working (30 seconds of leeway for clock differences). Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated). |
fb_sig | query | string | The signature of a signed URL. Only used for reads that need a signature (apps that require signed reads, files whose read permission is authenticated), ignored otherwise. |
fb_ip | query | string | An IP address or CIDR range the request must come from. Part of the signature, so it cannot be added or removed afterwards. |
fb_key | query | string | For a URL signed with a scoped key or a personal access token: its prefix (fbk_ or fbp_ and 12 characters). fb_sig is then keyed with its signing key, the hex HMAC-SHA256 of fileboy-url-signing-v1 keyed with the whole key. Accepted only while it works, only with files:read (files, images, file data, share pages) or videos:read (videos, downloads, playlists), and for a token only while its owner is a member of the app that owns what is signed. |
Responses
200 | The image. Content-Type is the output format. With format:json, a JSON description of the image instead; with palette, its colours as JSON (a Palette) or, with palette:css, a stylesheet. Headers only. |
400 | The transform is not valid, the image is too large to transform, or an overlay is not an image file of this app (error is invalid_transform), the id is not a file id or PUBLIC_KEY+LABEL (invalid_id), or the file could not be read from storage (image_unreadable).application/json |
401 | The app requires signed reads, or the file's read permission is authenticated, and the request has no signature. In an app that requires signed reads the same answer is given whether or not the file exists.application/json |
403 | The signature is wrong (signature_invalid: tampered, for another file, transform or filename, or made with another key), has expired (signature_expired) or the request comes from an address the URL is not valid for (ip_not_allowed).application/json |
404 | No file with that id or label. error is file_not_found.application/json |
409 | Only for an app with holdDownloadsUntilScanned on: file_scan_pending, the file is still being scanned (try again shortly), file_scan_failed, it could not be scanned, or file_not_scanned, it was skipped (larger than the scan limit, or uploaded while scanning was off).application/json |
422 | A palette or format:json was asked for a file that is not a JPEG, PNG, WebP, BMP, TIFF or HEIC image (a GIF or an SVG, say). error is unsupported_image.application/json |
429 | rate_limited: too many new (not yet cached) transforms from this address for this app, 120 a minute per server (four times that for a single preset). Retry-After says when to try again. Cached transforms, files served unchanged, signed URLs and private-key requests are not limited. Or delivery_limit_reached: the app is on Free and has served 150% of its monthly delivery allowance, so its files and images are not served until the month ends at midnight UTC. Retry-After is the seconds until then, and beside error and message the body has resetsAt and upgradeUrl. Paid plans are never cut off, and the dashboard's own reads always work. See /docs/delivery/cdn.application/json |
500 | The image could not be transformed. error is transform_failed or internal_error.application/json |
503 | transform_failed: the transform this request waited for was given up, more than once, by the requests making it. Try again.application/json |