FleetbaseFleetbase

Files

Files store uploaded documents, images, and other binary assets used across Fleetbase. Use file endpoints to upload, retrieve, download, update, and attach file metadata to other resources.

The File object

A file represents an uploaded binary object and the metadata Fleetbase stores for it.
Attributes
idstringoptional

Public identifier of the file.

urlstringoptional

Public URL for the stored file.

original_filenamestringoptional

Original filename stored on the file record.

folderstringoptional

Storage folder containing the file.

content_typestringoptional

MIME content type of the file.

file_sizeintegeroptional

File size in bytes.

captionstringoptional

Caption displayed with the file.

typestringoptional

Logical file type stored on the file record.

metaobjectoptional

Arbitrary metadata stored with the file.

updated_attimestampoptional

Time the file record was last updated.

created_attimestampoptional

Time the file record was created.

The File object
{
  "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"
}
POST/v1/files

Upload File

Uploads a multipart file and creates a file record. The response includes the stored file URL and metadata captured from the upload.

Body parameters
filestringrequired

Multipart file upload. The uploaded file may be up to 100 MB and must use one of the supported MIME types.

resizeenumoptional

Optional image resize preset. One of thumb, sm, md, lg, xl, 2xl.

resize_widthintegeroptional

Target resize width in pixels. Must be between 1 and 10000.

resize_heightintegeroptional

Target resize height in pixels. Must be between 1 and 10000.

resize_modeenumoptional

Resize mode used when transforming the image. One of fit, crop, stretch, contain.

resize_qualityintegeroptional

Resize output quality from 1 to 100.

resize_formatenumoptional

Output image format for the resized file. One of jpg, jpeg, png, webp, gif, bmp, avif.

resize_upscalebooleanoptional

Whether smaller images may be upscaled during resizing.

POST/v1/files
curl -X POST https://api.fleetbase.io/v1/files \
  -H "Authorization: Bearer flb_live_…"
POST/v1/files/base64

Upload 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.

Body parameters
datastringrequired

Base64-encoded file contents.

file_namestringrequired

Filename to use when storing the decoded file.

file_typestringoptional

Logical file type stored on the file record. Defaults to image.

content_typestringoptional

MIME content type stored on the file record. Defaults to image/png.

subject_uuidstringoptional

UUID of a subject resource to associate with the file.

subject_typestringoptional

Model class or subject type for the associated resource.

resizeenumoptional

Optional image resize preset. One of thumb, sm, md, lg, xl, 2xl.

resize_widthintegeroptional

Target resize width in pixels. Must be between 1 and 10000.

resize_heightintegeroptional

Target resize height in pixels. Must be between 1 and 10000.

resize_modeenumoptional

Resize mode used when transforming the image. One of fit, crop, stretch, contain.

resize_qualityintegeroptional

Resize output quality from 1 to 100.

resize_formatenumoptional

Output image format for the resized file. One of jpg, jpeg, png, webp, gif, bmp, avif.

resize_upscalebooleanoptional

Whether smaller images may be upscaled during resizing.

POST/v1/files/base64
curl -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"
}'
PUT/v1/files/:id

Update File

Updates a file record's caption, metadata, or original filename. The uploaded binary object is not replaced.

Body parameters
captionstringoptional

Caption displayed with the file.

filenamestringoptional

New original filename to store on the file record.

metaobjectoptional

Arbitrary metadata stored with the file record.

PUT/v1/files/:id
curl -X PUT https://api.fleetbase.io/v1/files/:id \
  -H "Authorization: Bearer flb_live_…" \
  -H "Content-Type: application/json" \
  -d '{
  "caption": "Updated caption",
  "meta": {}
}'
GET/v1/files/:id/download

Download File

Downloads the binary contents of a file by ID. The API streams the stored file using its original filename.

GET/v1/files/:id/download
curl https://api.fleetbase.io/v1/files/:id/download \
  -H "Authorization: Bearer flb_live_…"
GET/v1/files

Query Files

Returns uploaded files for the current organization. Use query parameters to filter, sort, and paginate the result set.

Query parameters
limitstringoptional

Limit value for this files request.

offsetstringoptional

Offset value for this files request.

sortstringoptional

Sort value for this files request.

GET/v1/files
curl https://api.fleetbase.io/v1/files?limit=25&offset=0&sort=created_at \
  -H "Authorization: Bearer flb_live_…"
GET/v1/files/:id

Retrieve a File

Retrieves a file record by ID, including its URL, original filename, content type, size, caption, and metadata.

GET/v1/files/:id
curl https://api.fleetbase.io/v1/files/:id \
  -H "Authorization: Bearer flb_live_…"
DELETE/v1/files/:id

Delete a File

Deletes a file record by ID. The response returns a deleted-resource envelope for the removed file.

DELETE/v1/files/:id
curl -X DELETE https://api.fleetbase.io/v1/files/:id \
  -H "Authorization: Bearer flb_live_…"
Files | Fleetbase