Skip to main content
POST
Create Cargo Vehicle

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer <key>. Create one in the SWITCH Copilot under Settings → API keys (needs the API keys permission in your company), or with POST /auth/api-keys. The key is shown once, at creation.

Body

application/json

Schema for creating a new cargo vehicle.

All required fields must be provided. Capacities default to an empty dict when omitted.

name
string
required

Vehicle name.

Example:

"Cargo Van 01"

icon
string
required

Name of the icon shown for the vehicle, e.g. Truck.

Example:

"Truck"

company_slug
string
required

Slug of the company that owns the vehicle: yours or another company you can manage.

Example:

"acme-mobility"

capacities
Capacities · object

How many items of each kind the vehicle carries, e.g. batteries, scooters, bikes, vehicles. Defaults to empty.

Example:

Response

Cargo vehicle created successfully. Returns the complete vehicle profile including capacity specs and company ownership.

Public schema for a cargo vehicle resource.

Exposes cargo vehicle details to API consumers, including capacity specs and company ownership.

id
integer
required

Unique ID.

Example:

1

name
string
required

Vehicle display name.

Example:

"Cargo Van 01"

icon
string
required

Name of the icon shown for the vehicle, e.g. Truck.

Example:

"Truck"

capacities
Capacities · object
required

How many items of each kind the vehicle carries, e.g. batteries, scooters, bikes, vehicles.

Example:
company_slug
string
required

Owning company slug.

Example:

"acme-mobility"

created_at
string<date-time>
required

Datetime when the record was created.

updated_at
string<date-time> | null

Datetime when the record was last updated, if ever.