Creating vehicles and drivers

Create a vehicle with a driver

HTTP Request

POST https://prod-api.spatula.io/v2/graph/role/vehicles?access_token=AUTH_TOKEN

Field

Description

name string

The vehicle's name

driver driver

The driver

POST request body

[
{
"name": "Vehicle Name",
"driver": {
"contact": {
"name": "Driver Name",
"email": "example@spatula.io"
},
"password": "DRIVER_PASSWORD"
}
}
]

Example

shell
curl -X POST -d '[{"notes": [{"contents": "My Vehicle Note"}],"attr": [{"key": "My Vehicle Metadata Key", "value": "My Vehicle Metadata Value"}],"name": "Vehicle Name","plate": "PLATE123","driver": {"contact": {"name": "Driver Name","email": "example@spatula.io"},"password": "DRIVER_PASSWORD"}}]' "https://prod-api.spatula.io/v2/graph/role/vehicles?access_token=AUTH_TOKEN"