Skip to content

Update a saved route

Request

Partially update a saved route: rename it, toggle favourite, bump last_used_at after a re-plan, or edit the endpoints. Only the fields supplied are changed.

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

The ID of the specific user to retrieve.

saved_route_idstringsavr[A-Z\d]{26}required

The ID of the specific saved route.

Example:savr01HRFF3SEVSCRAV9B3CHVDFN0H
Headers
EvEnergy-Versionnumber

Specify the version of this endpoint to use.

Value:2
Bodyapplication/json
namestring, <= 200 characters
favouriteboolean
originobject(RoutePoint)

A single geographic point on a saved route.

destinationobject(RoutePoint)

A single geographic point on a saved route.

waypointsArray of objects, <= 25 items(RoutePoint)
arrive_with_min_percentinteger, [ 0 .. 100 ]
preferred_departure_minutesinteger or null, [ 0 .. 1439 ]
last_used_atstring, (date-time)
curl -i -X PATCH \
  'https://developers.ev.energy/_mock/ev.energy-api-v2/users/{user_id}/saved_routes/savr01HRFF3SEVSCRAV9B3CHVDFN0H' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'EvEnergy-Version: 2' \
  -d '{
    "name": "string",
    "favourite": true,
    "origin": {
      "latitude": -90,
      "longitude": -180,
      "name": "string"
    },
    "destination": {
      "latitude": -90,
      "longitude": -180,
      "name": "string"
    },
    "waypoints": [
      {
        "latitude": -90,
        "longitude": -180,
        "name": "string"
      }
    ],
    "arrive_with_min_percent": 0,
    "preferred_departure_minutes": 0,
    "last_used_at": "2019-08-24T14:15:22Z"
  }'

Responses

The saved route was updated.

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
idstringsavr[A-Z\d]{26}read-onlyrequired
Example:"savr01HRFF3SEVSCRAV9B3CHVDFN0H"
urlstring, (uri)read-onlyrequired
Example:"https://api.ev.energy/v2/users/user01HN2NJ9NMRZBXT1H6FT9N7735/saved_routes/savr01HRFF3SEVSCRAV9B3CHVDFN0H"
userstring, (uri)read-onlyrequired

Link to the user who owns this route.

Example:"https://api.ev.energy/v2/users/user01HN2NJ9NMRZBXT1H6FT9N7735"
namestring, <= 200 charactersrequired

User-supplied name for the route.

favouritebooleanrequired
originobject(RoutePoint)required

A single geographic point on a saved route.

destinationobject(RoutePoint)required

A single geographic point on a saved route.

waypointsArray of objects, <= 25 items(RoutePoint)required

Ordered intermediate stops. Empty when the route is direct.

arrive_with_min_percentinteger, [ 0 .. 100 ]required

Target battery floor on arrival.

preferred_departure_minutesinteger or null, [ 0 .. 1439 ]required

Preferred departure hint as an offset in minutes from midnight of the day the route is re-planned. Null means "leave now".

created_atstring, (date-time)read-onlyrequired
last_used_atstring, (date-time)required

Bumped each time the route is re-planned.

Response
{ "id": "savr01HRFF3SEVSCRAV9B3CHVDFN0H", "url": "https://api.ev.energy/v2/users/user01HN2NJ9NMRZBXT1H6FT9N7735/saved_routes/savr01HRFF3SEVSCRAV9B3CHVDFN0H", "user": "https://api.ev.energy/v2/users/user01HN2NJ9NMRZBXT1H6FT9N7735", "name": "string", "favourite": true, "origin": { "latitude": -90, "longitude": -180, "name": "string" }, "destination": { "latitude": -90, "longitude": -180, "name": "string" }, "waypoints": [ {} ], "arrive_with_min_percent": 0, "preferred_departure_minutes": 0, "created_at": "2019-08-24T14:15:22Z", "last_used_at": "2019-08-24T14:15:22Z" }