Files
The File object
idstringoptionalPublic identifier of the file.
urlstringoptionalPublic URL for the stored file.
original_filenamestringoptionalOriginal filename stored on the file record.
folderstringoptionalStorage folder containing the file.
content_typestringoptionalMIME content type of the file.
file_sizeintegeroptionalFile size in bytes.
captionstringoptionalCaption displayed with the file.
typestringoptionalLogical file type stored on the file record.
metaobjectoptionalArbitrary metadata stored with the file.
updated_attimestampoptionalTime the file record was last updated.
created_attimestampoptionalTime the file record was created.
{
"id": "file_4WdX9o2",
"url": "https://files.example.com/uploads/example.png",
"original_filename": "example.png",
"folder": "uploads",
"content_type": "image/png",
"file_size": 24576,
"caption": "Proof of delivery",
"type": "attachment",
"meta": {},
"updated_at": "2026-05-07T09:30:00Z",
"created_at": "2026-05-07T09:30:00Z"
}/v1/filesUpload File
Uploads a multipart file and creates a file record. The response includes the stored file URL and metadata captured from the upload.
filestringrequiredMultipart file upload. The uploaded file may be up to 100 MB and must use one of the supported MIME types.
resizeenumoptionalOptional image resize preset. One of thumb, sm, md, lg, xl, 2xl.
resize_widthintegeroptionalTarget resize width in pixels. Must be between 1 and 10000.
resize_heightintegeroptionalTarget resize height in pixels. Must be between 1 and 10000.
resize_modeenumoptionalResize mode used when transforming the image. One of fit, crop, stretch, contain.
resize_qualityintegeroptionalResize output quality from 1 to 100.
resize_formatenumoptionalOutput image format for the resized file. One of jpg, jpeg, png, webp, gif, bmp, avif.
resize_upscalebooleanoptionalWhether smaller images may be upscaled during resizing.
/v1/filescurl -X POST https://api.fleetbase.io/v1/files \
-H "Authorization: Bearer flb_live_…"/v1/files/base64Upload Base64 File
Creates a file from base64-encoded data. Fleetbase stores the decoded file, creates a file record, and optionally associates it with a subject resource.
datastringrequiredBase64-encoded file contents.
file_namestringrequiredFilename to use when storing the decoded file.
file_typestringoptionalLogical file type stored on the file record. Defaults to image.
content_typestringoptionalMIME content type stored on the file record. Defaults to image/png.
subject_uuidstringoptionalUUID of a subject resource to associate with the file.
subject_typestringoptionalModel class or subject type for the associated resource.
resizeenumoptionalOptional image resize preset. One of thumb, sm, md, lg, xl, 2xl.
resize_widthintegeroptionalTarget resize width in pixels. Must be between 1 and 10000.
resize_heightintegeroptionalTarget resize height in pixels. Must be between 1 and 10000.
resize_modeenumoptionalResize mode used when transforming the image. One of fit, crop, stretch, contain.
resize_qualityintegeroptionalResize output quality from 1 to 100.
resize_formatenumoptionalOutput image format for the resized file. One of jpg, jpeg, png, webp, gif, bmp, avif.
resize_upscalebooleanoptionalWhether smaller images may be upscaled during resizing.
/v1/files/base64curl -X POST https://api.fleetbase.io/v1/files/base64 \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"data": "{{base64_file_data}}",
"file_name": "example.png",
"file_type": "image",
"content_type": "image/png",
"path": "uploads"
}'/v1/files/:idUpdate File
Updates a file record's caption, metadata, or original filename. The uploaded binary object is not replaced.
captionstringoptionalCaption displayed with the file.
filenamestringoptionalNew original filename to store on the file record.
metaobjectoptionalArbitrary metadata stored with the file record.
/v1/files/:idcurl -X PUT https://api.fleetbase.io/v1/files/:id \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-d '{
"caption": "Updated caption",
"meta": {}
}'/v1/files/:id/downloadDownload File
Downloads the binary contents of a file by ID. The API streams the stored file using its original filename.
/v1/files/:id/downloadcurl https://api.fleetbase.io/v1/files/:id/download \
-H "Authorization: Bearer flb_live_…"/v1/filesQuery Files
Returns uploaded files for the current organization. Use query parameters to filter, sort, and paginate the result set.
limitstringoptionalLimit value for this files request.
offsetstringoptionalOffset value for this files request.
sortstringoptionalSort value for this files request.
/v1/filescurl https://api.fleetbase.io/v1/files?limit=25&offset=0&sort=created_at \
-H "Authorization: Bearer flb_live_…"/v1/files/:idRetrieve a File
Retrieves a file record by ID, including its URL, original filename, content type, size, caption, and metadata.
/v1/files/:idcurl https://api.fleetbase.io/v1/files/:id \
-H "Authorization: Bearer flb_live_…"/v1/files/:idDelete a File
Deletes a file record by ID. The response returns a deleted-resource envelope for the removed file.
/v1/files/:idcurl -X DELETE https://api.fleetbase.io/v1/files/:id \
-H "Authorization: Bearer flb_live_…"