Skip to content

Create vehicle model

Request

Create a new vehicle model in the ev.energy system.

Newly created models are hidden by default and must be reviewed before becoming visible.

Security
oauth2(Required scopes: vehicle:write)
Headers
EvEnergy-Versionnumber

Specify the version of this endpoint to use.

Value:2
EvEnergy-Userstringuser[A-Z\d]{26}

If the client is authenticated using Client Credentials, setting EvEnergy-User to a valid user ID allows requests to be made as if you were directly authenticated as that user.

Example:user01HN2NJ9NMRZBXT1H6FT9N7735
Bodyapplication/json
namestringrequired

The name of the vehicle model.

Example:"Model 3"
makestring, (uri)required

URL reference to the vehicle make.

Example:"https://api.ev.energy/v2/vehicle_makes/vmak01HRFHBCM7VBSWRPVYFBQMH2BR"
curl -i -X POST \
  https://developers.ev.energy/_mock/ev.energy-api-v2/vehicle_models \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'EvEnergy-User: user01HN2NJ9NMRZBXT1H6FT9N7735' \
  -H 'EvEnergy-Version: 2' \
  -d '{
    "name": "Model 3",
    "make": "https://api.ev.energy/v2/vehicle_makes/vmak01HRFHBCM7VBSWRPVYFBQMH2BR"
  }'

Responses

Returns the newly created vehicle model resource.

Headers
EvEnergy-Versionnumber

Indicates the version of the API that generated this response. If EvEnergy-Version was not specified in the request, this will be your OAuth application's default version.

Value:2
X-RateLimit-Limitnumber

The maximum number of requests that can be made to this endpoint per hour. Defaults to 1000 but may vary per client.

Default:1000
X-RateLimit-Remainingnumber

The number of requests remaining until this client's rate limit is reached.

Default:999
RetryAfternumber

The number of seconds until this client's requests will not be rate limited.

Default:3600
Bodyapplication/json
idstringvmod[A-Z\d]{26}read-onlyrequired

Unique identifier for the given Vehicle Model.

Example:"vmod01HSBR8Z36GD7A46K7M4R12VG0"
urlstring, (uri)read-onlyrequired
Example:"https://api.ev.energy/vehicle_models/vmod01HSBR8Z36GD7A46K7M4R12VG0"
namestringread-onlyrequired
Example:"C40"
makestring or VehicleMake (object)
One of:
string (uri)
onboarding_urlstring or null, (uri)

A pre-constructed link to initiate onboarding for a vehicle of this model. If it is null, then it cannot be onboarded with model alone. You should filter the list of vehicle trims by this model and then have the user select their trim.

Your client_id and the user's user_id are automatically included based on your authentication token. If you are using client credentials authentication, the user ID will not be automatically included unless you set the EvEnergy-User header on your request.

Example:"https://api.ev.energy/v2/vehicle_onboarding?model_id=vmod01HN2P436099PEQ20B7TKPGTEJ&user_id=user01HN2NJ9NMRZBXT1H6FT9N7735&client_id=your_client_id"
vehicle_trimsstring, (uri)read-only

A pre-constructed link to a list of vehicle trims filtered for this model.

Example:"https://api.ev.energy/v2/vehicle_trims?model_id=vmod01HN2P436099PEQ20B7TKPGTEJ"
default_battery_size_watt_hoursintegerread-onlyrequired

Default battery size in watt-hours for this model, derived from the most common battery size across trims. Falls back to 45000 Wh if no trim data exists.

Example:79000
Response
{ "id": "vmod01HSBR8Z36GD7A46K7M4R12VG0", "url": "https://api.ev.energy/vehicle_models/vmod01HSBR8Z36GD7A46K7M4R12VG0", "name": "C40", "make": "https://api.ev.energy/v2/vehicle_makes/vmak01HRFHBCM7VBSWRPVYFBQMH2BR", "onboarding_url": "https://api.ev.energy/v2/vehicle_onboarding?model_id=vmod01HN2P436099PEQ20B7TKPGTEJ&user_id=user01HN2NJ9NMRZBXT1H6FT9N7735&client_id=your_client_id", "vehicle_trims": "https://api.ev.energy/v2/vehicle_trims?model_id=vmod01HN2P436099PEQ20B7TKPGTEJ", "default_battery_size_watt_hours": 79000 }