Skip to content

Update route planner preferences

Request

Update the user's EV Route Planner preferences.

The body is treated as a partial map: only the keys you include are modified, omitted keys are left untouched. PATCH {} is a valid no-op. preferred_vehicle accepts a vehicle URL or null; min_charger_power_watts accepts one of 22000, 50000, 100000, 150000, 250000 or null. distance_unit accepts AUTO, MILES or KILOMETRES, and temperature_unit accepts AUTO, CELSIUS or FAHRENHEIT; neither can be set back to null.

Security
oauth2(Required scopes: route_planner_preferences:write)
Path
user_idstring^(user[A-Z\d]{26})$required

The ID of the specific user to retrieve.

Example:user01HN2NJ9NMRZBXT1H6FT9N7735
Headers
EvEnergy-Versionnumber

Specify the version of this endpoint to use.

Value:2
Bodyapplication/json
preferred_vehiclestring or null, (uri)

Vehicle URL to set as default, or null to clear.

min_charger_power_wattsinteger or null
Enum:2200050000100000150000250000null
arrive_with_min_percentinteger, [ 0 .. 100 ]
distance_unitstring

Unit used to display distances. Cannot be set to null.

Enum:"AUTO""MILES""KILOMETRES"
temperature_unitstring

Unit used to display temperatures. Cannot be set to null.

Enum:"AUTO""CELSIUS""FAHRENHEIT"
battery_displaystring

How battery figures read. Cannot be set to null.

Enum:"PERCENT""DISTANCE"
break_every_minutesinteger
Any of:

Driving minutes between breaks; 0 for no breaks. Cannot be set to null.

integer
Value:0
break_minutesinteger, [ 5 .. 120 ]

Length of each break, in minutes. Cannot be set to null.

network_preferencesobject, <= 100 properties

Replaces the whole map; {} clears every preference. Cannot be set to null.

curl -i -X PATCH \
  'https://developers.ev.energy/_mock/ev.energy-api-v2/users/{user_id}/route_planner_preferences' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'EvEnergy-Version: 2' \
  -d '{
    "preferred_vehicle": "http://example.com",
    "min_charger_power_watts": 22000,
    "arrive_with_min_percent": 0,
    "distance_unit": "AUTO",
    "temperature_unit": "AUTO",
    "battery_display": "PERCENT",
    "break_every_minutes": 0,
    "break_minutes": 5,
    "network_preferences": {
      "property1": "PREFER",
      "property2": "PREFER"
    }
  }'

Responses

Route planner preferences updated successfully.

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
Bodyapplication/json
urlstring, (uri)read-onlyrequired
Example:"https://api.ev.energy/v2/users/user01HN2NJ9NMRZBXT1H6FT9N7735/route_planner_preferences"
preferred_vehiclestring or null, (uri)required

Link to the vehicle selected by default, or null if none is set.

Example:"https://api.ev.energy/v2/vehicles/vhcl01HRFF3SEVSCRAV9B3CHVDFN0H"
min_charger_power_wattsinteger or nullrequired

Soft minimum charger power (watts) for en-route charger search. Null means all chargers.

Enum:2200050000100000150000250000null
arrive_with_min_percentinteger, [ 0 .. 100 ]required

Default arrival battery floor seeded into new route plans.

distance_unitstring or nullrequired

Unit used to display distances. AUTO means the user chose to derive the unit from their locale; null means the user has never set it.

Enum:"AUTO""MILES""KILOMETRES"null
Example:"MILES"
temperature_unitstring or nullrequired

Unit used to display temperatures. AUTO means the user chose to derive the unit from their locale; null means the user has never set it.

Enum:"AUTO""CELSIUS""FAHRENHEIT"null
Example:"AUTO"
battery_displaystring or nullrequired

Whether battery figures read as a percentage or as distance left. null means the user has never set it.

Enum:"PERCENT""DISTANCE"null
Example:"PERCENT"
break_every_minutesinteger or nullrequired
Example:120
Any of:

Driving minutes between breaks. 0 means no breaks; null means the user has never set it.

integer
Value:0
break_minutesinteger or null, [ 5 .. 120 ]required

Length of each break, in minutes. null means the user has never set it.

Example:20
network_preferencesobject or null, <= 100 propertiesrequired

Charging networks the user prefers or avoids, by the network's name. A network not listed is neutral. null means the user has never set it.

Example:
{ "IONNA": "PREFER", "EVgo": "AVOID" }
updated_atstring, (date-time)read-onlyrequired
Response
{ "url": "https://api.ev.energy/v2/users/user01HN2NJ9NMRZBXT1H6FT9N7735/route_planner_preferences", "preferred_vehicle": "https://api.ev.energy/v2/vehicles/vhcl01HRFF3SEVSCRAV9B3CHVDFN0H", "min_charger_power_watts": 22000, "arrive_with_min_percent": 0, "distance_unit": "MILES", "temperature_unit": "AUTO", "battery_display": "PERCENT", "break_every_minutes": 120, "break_minutes": 20, "network_preferences": { "IONNA": "PREFER", "EVgo": "AVOID" }, "updated_at": "2019-08-24T14:15:22Z" }