v1

latestOpenAPI 3.0.12026-07-243686491.1 MB
Vehicles

Create a vehicle authorization link

Required scope: vehicles:write. Returns the link an application user follows to authorize their vehicle account (e.g. Enode or Smartcar) so it can be connected to Monta.

post/api/v1/vehicles/integrations/authorization-link

Request body

userIdinteger required

Id of the application user the authorization link is created for

redirectUristring required

URI the user is redirected to after authorizing their vehicle account. Must be an https:// URL.

provider'enode' | 'smartcar' nullable

Vehicle integration provider. Defaults to enode when omitted.

brandIdinteger nullable

Vehicle brand id used to pick a provider-specific authorization flow

scopesstring[] nullable

Scopes requested from the vehicle account. Defaults to charge-state and control-charging.

Example request

{
  "userId": 10000,
  "redirectUri": "https://example.com/vehicle/callback",
  "provider": "enode",
  "brandId": 1234,
  "scopes": [
    "charge-state",
    "control-charging"
  ]
}

Response

Authorization link created

authorizeLinkstring required

Link the user follows to authorize their vehicle account

tokenstring nullable

Token identifying the authorization session

providerstring required

Vehicle integration provider that issued the link

authFlowstring required

Authorization flow the client should use to complete linking

Example response

{
  "authorizeLink": "https://link.enode.com/abc123",
  "token": "8c3f0b2e-1a4d-4f7e-9c2b-1d2e3f4a5b6c",
  "provider": "enode",
  "authFlow": "enode-sdk"
}