Skip to content

Create a custom vehicle trim

Request

Creates a new trim for the specified model that can be used if we are missing a trim. These trims will not be available in the list trims api call

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

Specify the version of this endpoint to use.

Value:2
Bodyapplication/json
namestringrequired

The name of the vehicle trim.

Example:"Custom Trim"
modelstring, (uri)required

URL reference to the vehicle model this trim belongs to.

Example:"https://api.ev.energy/v2/vehicle_models/vmod01HSBR8Z36GD7A46K7M4R12VG0"
battery_size_watt_hoursinteger, [ 1000 .. 300000 ]required

Battery size in watt hours. Must be between 1000 and 300000.

Example:75500
curl -i -X POST \
  https://developers.ev.energy/_mock/ev.energy-api-v2/vehicle_trims \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'EvEnergy-Version: 2' \
  -d '{
    "name": "Custom Trim",
    "model": "https://api.ev.energy/v2/vehicle_models/vmod01HSBR8Z36GD7A46K7M4R12VG0",
    "battery_size_watt_hours": 75500
  }'

Responses

Returns the newly created vehicle trim 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
idstringtrim[A-Z\d]{26}read-onlyrequired

Unique identifier for the given Vehicle Trim.

Example:"trim01HRFHBCM7VBSWRPVYFBQMH2BR"
urlstring, (uri)read-onlyrequired
Example:"https://api.ev.energy/v2/vehicle_trim/trim01HRFHBCM7VBSWRPVYFBQMH2BR"
namestringread-onlyrequired
Example:"Recharge Core (69 kWh)"
modelstring or VehicleModel (object)
One of:
string (uri)
battery_size_watt_hoursinteger or nullread-only

Battery size in watt-hours. null if not known for this trim.

Example:75500
onboarding_urlstring or null, (uri)read-onlyrequired

A pre-constructed link to initiate onboarding for a vehicle with this trim. If it is null, then we do not support intergrating with this vehicle and you should POST the trim to /vehicles to create an unintegrated vehicle.

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?trim_id=trim01HN2NZ1040Y8E77CQGXADC2TZ&user_id=user01HN2NJ9NMRZBXT1H6FT9N7735&client_id=your_client_id"
Response
{ "id": "trim01HRFHBCM7VBSWRPVYFBQMH2BR", "url": "https://api.ev.energy/v2/vehicle_trim/trim01HRFHBCM7VBSWRPVYFBQMH2BR", "name": "Recharge Core (69 kWh)", "model": "http://example.com", "battery_size_watt_hours": 75500, "onboarding_url": "https://api.ev.energy/v2/vehicle_onboarding?trim_id=trim01HN2NZ1040Y8E77CQGXADC2TZ&user_id=user01HN2NJ9NMRZBXT1H6FT9N7735&client_id=your_client_id" }