Skip to main content
POST
/
vehicles
/
{vehicle}
/
attach
Attach a Vehicle
curl --request POST \
  --url https://api.chargeapi.co/v1/vehicles/{vehicle}/attach \
  --header 'Content-Type: application/json' \
  --data '{
  "driver": "<string>",
  "fleet": "<string>"
}'
{
  "id": null,
  "object": null,
  "battery_capacity": null,
  "charging_standard": null,
  "created": null,
  "drivers": null,
  "fleet": null,
  "information": {
    "make": null,
    "model": null,
    "year": null
  },
  "metadata": null,
  "registration_plate": null,
  "status": null,
  "telemetry": null,
  "updated": null,
  "vin": null
}

Path Parameters

vehicle
string
required

The unique identifier for the Vehicle to attach.

Body

application/json
driver
string

ID of the driver to attach the Vehicle to. Cannot be combined with fleet.

fleet
string

ID of the fleet to attach the Vehicle to. Cannot be combined with driver.

Response

Returns the updated Vehicle object with the new attachment. If the Vehicle or target driver or fleet does not exist, an error is returned.

id
string

Unique identifier for the vehicle object.

Example:

null

object
string

String representing the object’s type. Always vehicle.

Example:

null

battery_capacity
integer

Total battery capacity of the vehicle in watt-hours (Wh).

Example:

null

charging_standard
string

Standard used for charging the vehicle (e.g., CCS, CHAdeMO, Type2).

Example:

null

created
integer

Time at which the vehicle was registered (UNIX timestamp).

Example:

null

drivers
string[]

List of driver IDs currently linked to the vehicle.

Example:

null

fleet
string | null

ID of the fleet this Vehicle is attached to, if any.

Example:

null

information
object

Manufacturer details for the vehicle.

metadata
object

Set of key-value pairs for storing custom structured data about the vehicle.

Example:

null

registration_plate
string

License plate or vehicle registration number.

Example:

null

status
enum<string>

Current lifecycle status of the vehicle.

Available options:
active,
inactive,
retired
Example:

null

telemetry
string

ID of the telemetry object linked to this vehicle (if any).

Example:

null

updated
integer

Time at which the vehicle object was last updated.

Example:

null

vin
string

Vehicle Identification Number (VIN), used to uniquely identify the vehicle.

Example:

null