Fleets
The Fleet object
idstringoptionalPublic fleet identifier.
namestringoptionalFleet display name.
colorstringoptionalDisplay colour for the fleet.
taskstringoptionalTask associated with the fleet.
statusstringoptionalFleet status.
photo_urlstringoptionalURL of the fleet image, or the default fleet image when none is set.
service_area_idstringoptionalPublic ID of the assigned service area, or null. Always present.
zone_idstringoptionalPublic ID of the assigned zone, or null. Always present.
vendor_idstringoptionalPublic ID of the assigned vendor, or null. Always present.
parent_fleet_idstringoptionalPublic ID of the parent fleet, or null for a root fleet. Always present.
photo_idstringoptionalPublic ID of the fleet image file, or null. Always present.
service_areaobjectoptionalThe assigned service area, returned only when requested through with=service_area. Never a string — read service_area_id for the identifier.
zoneobjectoptionalThe assigned zone, returned only when requested through with=zone.
vendorobjectoptionalThe assigned vendor, returned only when requested through with=vendor.
parent_fleetobjectoptionalThe parent fleet, returned only when requested through with=parent_fleet.
photoobjectoptionalThe fleet image file, returned only when requested through with=photo.
subfleetsarray of objectsoptionalChild fleets, when requested through with=subfleets.
driversarray of objectsoptionalDrivers assigned to the fleet, when requested through with=drivers.
vehiclesarray of objectsoptionalVehicles assigned to the fleet, when requested through with=vehicles.
updated_attimestampoptionalTimestamp when the fleet was last updated.
created_attimestampoptionalTimestamp when the fleet was created.
{
"id": "fleet_4Mnp8Qx2Vz",
"name": "Haulers",
"color": "#2563EB",
"task": "Long haul distribution",
"status": "active",
"photo_url": "https://s3.ap-northeast-2.amazonaws.com/fleetbase/public/default-fleet.png",
"service_area_id": "service_area_9Kp2Vx4Qm1",
"zone_id": null,
"vendor_id": null,
"parent_fleet_id": null,
"photo_id": null,
"updated_at": "2026-05-07T08:30:00.000000Z",
"created_at": "2026-05-07T08:30:00.000000Z"
}/v1/fleetsCreate a Fleet
Creates a fleet for grouping drivers and vehicles.
Every safe fleet field is accepted: name, colour, task, status, and the service area, zone, vendor and parent fleet relationships. Relationships are given as public IDs (service_area_..., zone_..., vendor_..., fleet_...) and are resolved inside the authenticated organization — a public ID belonging to another organization is rejected exactly as a non-existent one is.
Omitting parent_fleet creates a root fleet. This request creates the parent used by Create a Subfleet.
namestringrequiredFleet display name.
colorstringoptionalDisplay colour for the fleet, for example a hex value such as #2563EB.
taskstringoptionalFree-text description of what the fleet is used for.
statusstringoptionalFleet status. The console offers active, disabled and decommissioned; the field is not a closed enum, so any short status string an integration already uses is accepted.
service_areastringoptionalService area public ID (service_area_...) to assign to the fleet. Must belong to the authenticated organization.
zonestringoptionalZone public ID (zone_...) to assign to the fleet. Must belong to the authenticated organization.
vendorstringoptionalVendor public ID (vendor_...) to assign to the fleet. Must belong to the authenticated organization.
parent_fleetstringoptionalParent fleet public ID (fleet_...), which makes the new fleet a subfleet. Omit it to create a root fleet. Must belong to the authenticated organization.
photostringoptionalFile public ID (file_...) to use as the fleet image.
/v1/fleetscurl -X POST https://api.fleetbase.io/v1/fleets \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Haulers",
"color": "#2563EB",
"task": "Long haul distribution",
"status": "active",
"service_area": "{{service_area_id}}"
}'{
"id": "fleet_4Mnp8Qx2Vz",
"name": "Haulers",
"color": "#2563EB",
"task": "Long haul distribution",
"status": "active",
"photo_url": "https://s3.ap-northeast-2.amazonaws.com/fleetbase/public/default-fleet.png",
"service_area_id": "service_area_9Kp2Vx4Qm1",
"zone_id": null,
"vendor_id": null,
"parent_fleet_id": null,
"photo_id": null,
"updated_at": "2026-05-07T08:30:00.000000Z",
"created_at": "2026-05-07T08:30:00.000000Z"
}/v1/fleetsCreate a Subfleet
Creates a fleet nested beneath another fleet by sending the parent's public ID in parent_fleet.
Hierarchies are validated on write: a fleet cannot be its own parent, and cannot be moved beneath one of its own subfleets. Both are answered with 422. A parent belonging to another organization is answered with 404, the same as a parent that does not exist.
namestringrequiredSubfleet display name.
parent_fleetstringrequiredPublic ID (fleet_...) of the fleet this subfleet belongs to. A fleet may not name itself, and may not be placed beneath one of its own descendants.
colorstringoptionalDisplay colour for the subfleet.
taskstringoptionalFree-text description of what the subfleet is used for.
statusstringoptionalSubfleet status.
/v1/fleetscurl -X POST https://api.fleetbase.io/v1/fleets \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Carpool",
"color": "#059669",
"task": "Employee transport",
"status": "active",
"parent_fleet": "{{parent_fleet_id}}"
}'{
"id": "fleet_1Bd7Rk9Tz3",
"name": "Carpool",
"color": "#059669",
"task": "Employee transport",
"status": "active",
"photo_url": "https://s3.ap-northeast-2.amazonaws.com/fleetbase/public/default-fleet.png",
"service_area_id": null,
"zone_id": null,
"vendor_id": null,
"parent_fleet_id": "fleet_4Mnp8Qx2Vz",
"updated_at": "2026-05-07T08:31:00.000000Z",
"created_at": "2026-05-07T08:31:00.000000Z"
}/v1/vehiclesCreate a Fleet Vehicle
Creates a vehicle for the fleet membership requests to operate on.
The vehicle created in the Vehicles folder is deleted before this folder runs, so the membership assertions need a resource of their own. It is removed again by Delete a Fleet Vehicle at the end of this folder.
/v1/vehiclescurl -X POST https://api.fleetbase.io/v1/vehicles \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Fleet Membership Van",
"make": "Toyota",
"model": "HiAce",
"year": 2024,
"plate_number": "FLT-0001",
"status": "available"
}'/v1/driversCreate a Fleet Driver
Creates a driver for the fleet membership requests to operate on.
The driver created in the Drivers folder is deleted before this folder runs, so the membership assertions need a resource of their own. It is removed again by Delete a Fleet Driver at the end of this folder.
/v1/driverscurl -X POST https://api.fleetbase.io/v1/drivers \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Fleet Membership Driver",
"internal_id": "DRV-FLT-0001"
}'/v1/fleetsQuery Fleets
Returns a paginated list of fleets for the current organization. Use pagination and sorting parameters to control the result set.
querystringoptionalFree-text search across the fleet's name, task and public ID.
namestringoptionalFilter by fleet name.
public_idstringoptionalFilter by fleet public ID (fleet_...). Exact match.
statusstringoptionalFilter by fleet status. Accepts a comma-separated list.
taskstringoptionalFilter by the fleet's task.
parent_fleetstringoptionalFilter to the subfleets of a parent fleet, given as its public ID (fleet_...).
parents_onlybooleanoptionalReturn only root fleets — those with no parent fleet.
vendorstringoptionalFilter by vendor, given as its public ID (vendor_...).
service_areastringoptionalFilter by service area, given as its public ID (service_area_...).
zonestringoptionalFilter by zone, given as its public ID (zone_...).
limitintegeroptionalMaximum number of fleets to return.
offsetintegeroptionalNumber of fleets to skip before returning results.
sortstringoptionalSort expression for the fleet query.
witharray of stringsoptionalRelationships to expand: service_area, zone, vendor, parent_fleet, photo, subfleets, drivers, vehicles, and the nested subfleets.drivers / subfleets.vehicles. Accepted as ?with=vendor, ?with[]=vendor, ?with[]=vendor&with[]=driver and ?with=vendor,driver; expand is an alias for all four. Expanding adds the nested object — it never replaces or retypes the <name>_id identifier, which is always present. A name outside the supported set is ignored rather than rejected.
/v1/fleetscurl https://api.fleetbase.io/v1/fleets?limit=25&offset=0&sort=created_at \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"[
{
"id": "fleet_4Mnp8Qx2Vz",
"name": "Haulers",
"color": "#2563EB",
"task": "Long haul distribution",
"status": "active",
"photo_url": "https://s3.ap-northeast-2.amazonaws.com/fleetbase/public/default-fleet.png",
"service_area_id": "service_area_9Kp2Vx4Qm1",
"zone_id": null,
"vendor_id": null,
"parent_fleet_id": null,
"photo_id": null,
"updated_at": "2026-05-07T08:30:00.000000Z",
"created_at": "2026-05-07T08:30:00.000000Z"
}
]/v1/fleets/:idRetrieve a Fleet
Retrieves a fleet.
/v1/fleets/:idcurl https://api.fleetbase.io/v1/fleets/:id \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"id": "fleet_4Mnp8Qx2Vz",
"name": "Haulers",
"color": "#2563EB",
"task": "Long haul distribution",
"status": "active",
"photo_url": "https://s3.ap-northeast-2.amazonaws.com/fleetbase/public/default-fleet.png",
"service_area_id": "service_area_9Kp2Vx4Qm1",
"zone_id": null,
"vendor_id": null,
"parent_fleet_id": null,
"photo_id": null,
"updated_at": "2026-05-07T08:30:00.000000Z",
"created_at": "2026-05-07T08:30:00.000000Z"
}/v1/fleets/:id/vehicles/:vehicleAssign a Vehicle to a Fleet
Adds a vehicle to a fleet. Both path parameters are public IDs; no internal uuid is accepted or returned.
Assignment is idempotent. Repeating it answers the same way and never creates a second membership; a membership that was previously removed is restored rather than duplicated. Assigning to one fleet does not remove the resource from any other fleet, and does not change a driver's current vehicle.
/v1/fleets/:id/vehicles/:vehiclecurl -X POST https://api.fleetbase.io/v1/fleets/:id/vehicles/:vehicle \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"vehicle": "vehicle_7YqM3KpL2n",
"assigned": true
}/v1/fleets/:id/vehicles/:vehicleReassign a Vehicle to a Fleet
Adds a vehicle to a fleet. Both path parameters are public IDs; no internal uuid is accepted or returned.
This request repeats the assignment above deliberately: assignment is idempotent, so a second call answers exactly as the first did and produces one active membership, not two.
/v1/fleets/:id/vehicles/:vehiclecurl -X POST https://api.fleetbase.io/v1/fleets/:id/vehicles/:vehicle \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"vehicle": "vehicle_7YqM3KpL2n",
"assigned": true
}/v1/fleets/:id/drivers/:driverAssign a Driver to a Fleet
Adds a driver to a fleet. Both path parameters are public IDs; no internal uuid is accepted or returned.
Assignment is idempotent. Repeating it answers the same way and never creates a second membership; a membership that was previously removed is restored rather than duplicated. Assigning to one fleet does not remove the resource from any other fleet, and does not change a driver's current vehicle.
/v1/fleets/:id/drivers/:drivercurl -X POST https://api.fleetbase.io/v1/fleets/:id/drivers/:driver \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"driver": "driver_7YqM3KpL2n",
"assigned": true
}/v1/fleets/:id/drivers/:driverReassign a Driver to a Fleet
Adds a driver to a fleet. Both path parameters are public IDs; no internal uuid is accepted or returned.
This request repeats the assignment above deliberately: assignment is idempotent, so a second call answers exactly as the first did and produces one active membership, not two.
/v1/fleets/:id/drivers/:drivercurl -X POST https://api.fleetbase.io/v1/fleets/:id/drivers/:driver \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"driver": "driver_7YqM3KpL2n",
"assigned": true
}/v1/fleets/:idUpdate a Fleet
Updates any safe fleet field: name, colour, task, status, and the service area, zone, vendor and parent fleet relationships.
Relationship inputs take public IDs and are resolved inside the authenticated organization. Sending null for a relationship clears it — "parent_fleet": null promotes a subfleet back to a root fleet.
namestringoptionalFleet display name.
colorstringoptionalDisplay colour for the fleet.
taskstringoptionalFree-text description of what the fleet is used for.
statusstringoptionalFleet status.
service_areastringoptionalService area public ID (service_area_...). Send null to clear the assignment.
zonestringoptionalZone public ID (zone_...). Send null to clear the assignment.
vendorstringoptionalVendor public ID (vendor_...). Send null to clear the assignment.
parent_fleetstringoptionalParent fleet public ID (fleet_...). Send null to promote the fleet back to a root fleet. A fleet may not be its own parent, and may not be moved beneath one of its own subfleets.
photostringoptionalFile public ID (file_...) to use as the fleet image.
/v1/fleets/:idcurl -X PUT https://api.fleetbase.io/v1/fleets/:id \
-H "Authorization: Bearer flb_live_…" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "Haulers North",
"color": "#7C3AED",
"task": "Regional distribution",
"status": "active",
"service_area": "{{service_area_id}}"
}'{
"id": "fleet_4Mnp8Qx2Vz",
"name": "Haulers North",
"color": "#7C3AED",
"task": "Regional distribution",
"status": "active",
"photo_url": "https://s3.ap-northeast-2.amazonaws.com/fleetbase/public/default-fleet.png",
"service_area_id": "service_area_9Kp2Vx4Qm1",
"zone_id": null,
"vendor_id": null,
"parent_fleet_id": null,
"photo_id": null,
"updated_at": "2026-05-07T09:12:00.000000Z",
"created_at": "2026-05-07T08:30:00.000000Z"
}/v1/fleets/:id/vehicles/:vehicleRemove a Vehicle from a Fleet
Removes a vehicle from a fleet. Both path parameters are public IDs.
Removing a membership never deletes the vehicle, never changes a driver's current vehicle, and never affects the resource's membership of any other fleet. Repeating the removal is a successful no-op.
/v1/fleets/:id/vehicles/:vehiclecurl -X DELETE https://api.fleetbase.io/v1/fleets/:id/vehicles/:vehicle \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"vehicle": "vehicle_7YqM3KpL2n",
"assigned": false
}/v1/fleets/:id/vehicles/:vehicleRemove a Vehicle from a Fleet Again
Removes a vehicle from a fleet. Both path parameters are public IDs.
This request repeats the removal above deliberately: removing a membership that is not there is a documented, successful no-op.
/v1/fleets/:id/vehicles/:vehiclecurl -X DELETE https://api.fleetbase.io/v1/fleets/:id/vehicles/:vehicle \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"vehicle": "vehicle_7YqM3KpL2n",
"assigned": false
}/v1/fleets/:id/drivers/:driverRemove a Driver from a Fleet
Removes a driver from a fleet. Both path parameters are public IDs.
Removing a membership never deletes the driver, never changes a driver's current vehicle, and never affects the resource's membership of any other fleet. Repeating the removal is a successful no-op.
/v1/fleets/:id/drivers/:drivercurl -X DELETE https://api.fleetbase.io/v1/fleets/:id/drivers/:driver \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"driver": "driver_7YqM3KpL2n",
"assigned": false
}/v1/fleets/:id/drivers/:driverRemove a Driver from a Fleet Again
Removes a driver from a fleet. Both path parameters are public IDs.
This request repeats the removal above deliberately: removing a membership that is not there is a documented, successful no-op.
/v1/fleets/:id/drivers/:drivercurl -X DELETE https://api.fleetbase.io/v1/fleets/:id/drivers/:driver \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"fleet": "fleet_4Mnp8Qx2Vz",
"driver": "driver_7YqM3KpL2n",
"assigned": false
}/v1/vehicles/:idDelete a Fleet Vehicle
Deletes the vehicle created for the fleet membership requests. Runs after every membership has been removed.
/v1/vehicles/:idcurl -X DELETE https://api.fleetbase.io/v1/vehicles/:id \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"/v1/drivers/:idDelete a Fleet Driver
Deletes the driver created for the fleet membership requests. Runs after every membership has been removed.
/v1/drivers/:idcurl -X DELETE https://api.fleetbase.io/v1/drivers/:id \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"/v1/fleets/:idDelete a Subfleet
Deletes the subfleet created by Create a Subfleet.
It runs before Delete a Fleet so the child is removed before its parent.
/v1/fleets/:idcurl -X DELETE https://api.fleetbase.io/v1/fleets/:id \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"/v1/fleets/:idDelete a Fleet
Deletes a fleet.
/v1/fleets/:idcurl -X DELETE https://api.fleetbase.io/v1/fleets/:id \
-H "Authorization: Bearer flb_live_…" \
-H "Accept: application/json"{
"id": "<string>",
"object": "<string>",
"deleted": "<boolean>"
}