Skip to main content

Vehicles

5 API calls in this section.

List Vehicles

Delivery & Last-Mile / Vehicles
GET/delivery/vehicles?page=1&limit=10&search=&sort_by=created_at&sort_order=desc&column_filters=&active=&name=&code=&fuel_type=&license_requirements=&tenant_id=&language=en

Get a paginated list of vehicles with optional column_filters, sort_by, sort_order and inline stats. Requires view:tenant or manage:operations:tenant permission.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/vehicles?page=1&limit=10&search=&sort_by=created_at&sort_order=desc&column_filters=&active=&name=&code=&fuel_type=&license_requirements=&tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

Page number for pagination (1-based)

limitOptional
query string

10

Number of items per page

searchOptional
query string

Free-text search across name and code

sort_byOptional
query string

created_at

Sort column. Allowed: name, code, created_at

sort_orderOptional
query string

desc

asc or desc (default desc)

column_filtersOptional
query string

JSON object with per-column filters. Keys: name (ILIKE), code (ILIKE), active (boolean), fuel_type (exact: petrol|diesel|electric|hybrid|cng), license_requirements (exact array element: standard|commercial|special), created_at ({from?, to?} ISO date range). Example: {"active":true,"fuel_type":"diesel","created_at":{"from":"2025-01-01","to":"2025-12-31"}}

activeOptional
query string

Legacy: filter by active status (true/false)

nameOptional
query string

Legacy: filter by vehicle name (ILIKE)

codeOptional
query string

Legacy: filter by vehicle code (ILIKE)

fuel_typeOptional
query string

Legacy: filter by fuel type (exact)

license_requirementsOptional
query string

Legacy: filter by license requirement (array element match)

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK
Bad Request - invalid column_filters400Bad Request

Get Vehicle

Delivery & Last-Mile / Vehicles
GET/delivery/vehicles/:vehicleId?tenant_id=&language=en

Get details for a specific vehicle. Requires view:tenant or manage:operations:tenant permission.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/delivery/vehicles/:vehicleId?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

vehicleIdRequired
path string

uuid

ID of the vehicle to retrieve

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK

Create Vehicle

Delivery & Last-Mile / Vehicles
POST/delivery/vehicles?tenant_id=&language=en

Create a new vehicle type. Requires manage:operations:tenant permission.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/delivery/vehicles?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "name": "Delivery Van - Medium",7  "code": "DVM-001",8  "description": "Standard medium-sized delivery van for urban deliveries",9  "capacity_unit": 3,10  "vehicle_requirements": {11    "license_requirements": [12      "standard"13    ],14    "special_features": [15      "lift_gate"16    ],17    "fuel_type": "diesel"18  },19  "image_url": "https://example.com/images/delivery-van.jpg",20  "active": true21}'
Request body
json
1{2  "name": "Delivery Van - Medium",3  "code": "DVM-001",4  "description": "Standard medium-sized delivery van for urban deliveries",5  "capacity_unit": 3,6  "vehicle_requirements": {7    "license_requirements": [8      "standard"9    ],10    "special_features": [11      "lift_gate"12    ],13    "fuel_type": "diesel"14  },15  "image_url": "https://example.com/images/delivery-van.jpg",16  "active": true17}

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Request body fields

nameExample
string

Example field from the request body.

codeExample
string

Example field from the request body.

descriptionExample
string

Example field from the request body.

capacity_unitExample
number

Example field from the request body.

vehicle_requirementsExample
object

Example field from the request body.

vehicle_requirements.license_requirementsExample
array<string>

Example field from the request body.

vehicle_requirements.special_featuresExample
array<string>

Example field from the request body.

vehicle_requirements.fuel_typeExample
string

Example field from the request body.

image_urlExample
string

Example field from the request body.

activeExample
boolean

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201Created

Update Vehicle

Delivery & Last-Mile / Vehicles
PUT/delivery/vehicles/:vehicleId?tenant_id=&language=en

Update an existing vehicle. Only the fields provided in the request will be updated. Requires manage:operations:tenant permission.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/delivery/vehicles/:vehicleId?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "name": "Delivery Van - Medium Plus",7  "description": "Updated medium-sized delivery van for urban deliveries",8  "capacity_unit": 5,9  "vehicle_requirements": {10    "special_features": [11      "lift_gate",12      "refrigeration"13    ],14    "fuel_type": "hybrid"15  },16  "image_url": "https://example.com/images/delivery-van-plus.jpg",17  "active": true18}'
Request body
json
1{2  "name": "Delivery Van - Medium Plus",3  "description": "Updated medium-sized delivery van for urban deliveries",4  "capacity_unit": 5,5  "vehicle_requirements": {6    "special_features": [7      "lift_gate",8      "refrigeration"9    ],10    "fuel_type": "hybrid"11  },12  "image_url": "https://example.com/images/delivery-van-plus.jpg",13  "active": true14}

Path parameters

vehicleIdRequired
path string

uuid

ID of the vehicle to update

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Request body fields

nameExample
string

Example field from the request body.

descriptionExample
string

Example field from the request body.

capacity_unitExample
number

Example field from the request body.

vehicle_requirementsExample
object

Example field from the request body.

vehicle_requirements.special_featuresExample
array<string>

Example field from the request body.

vehicle_requirements.fuel_typeExample
string

Example field from the request body.

image_urlExample
string

Example field from the request body.

activeExample
boolean

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK

Delete Vehicle

Delivery & Last-Mile / Vehicles
DELETE/delivery/vehicles/:vehicleId?tenant_id=&language=en

Soft delete a vehicle (sets active = false). Requires manage:operations:tenant permission.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request DELETE "$ONDI_BASE_URL/delivery/vehicles/:vehicleId?tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Path parameters

vehicleIdRequired
path string

uuid

ID of the vehicle to delete

Query parameters

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Preferred language for response messages

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK