What’s changing for my integration?

For new developers

If you’re on an Enterprise or Scale plan, please reach out to your Account Manager or Solutions Architect for information on setting up your own Virtual Key.

Free and Build customers can get started with the default Virtual Key and no additional configuration.

For existing developers

Please see the section that applies to your situation here.

What is a Virutal Key?

A virtual key is a digital access method required by Tesla for third-party applications to receive vehicle data and issue commands to Tesla vehicles. Please see this section for more information.

Where can I find my Virtual Key?

The Virtual Key URL for your application will be sent back along with the authorization code after a user completes the Connect flow.

Handling the new redirect parameter

After going through the new Connect flow, we’ll send back a URL pointing to a Virtual Key along with the code:

Success
HTTP/1.1 302 Found
Location: https://example.com/home?
code=90abecb6-e7ab-4b85-864a-e1c8bf67f2ad
&virtual_key_url=https://www.tesla.com/_ak/smartcar.com

This new param will not break existing HTTP client integrations or older SDK versions. Update to the latest version to receive the URL in the Connect onComplete for our Frontend SDKs.

handleResponse(SmartcarResponse smartcarResponse) {
    // handle code
    // retrieve virtualKeyUrl
    String virtualKeyUrl = smartcarResponse.getVirtualKeyUrl()
} 

Adding a Virtual Key

This process should take place after the Connect flow when a user has returned to your application.

The Virtual Key is a URL in the form:

https://www.tesla.com/_ak/smartcar.com

After prompting your your users to open the link, depending on their device, they will need to do the following:

Adding a Virtual Key will need to be done after a user has granted your application access to their Tesla account in the Connect flow.

Please see our FAQs for details on adding a virtual key for accounts with multiple vehicles and different account types.

On mobile devices, they will be redirected to the Tesla app and prompted to add the Virtual Key

Opening the link on a mobile device with the Tesla app installed

Do all vehicles need a Virtual Key?

2020 and earlier Model S and X will not require a Virtual Key to keep working at this time. However, you may not always receive the latest data from the vehicle when you make an API request to Smartcar.

Updating access with Tesla

You can use either of the following URLs to prompt users for more Tesla permissions in the event you need additional access from the vehicle owner due to:

If one or more of the Smartcar scopes you pass map to a new Tesla permission(s) for the account, the user will be prompted to update access after they log in with Tesla.

This flow sends a new authorization code to your callback URI in order to fetch a new access and refresh token.

    https://connect.smartcar.com/oauth/{path}?
    response_type=code
    &make=TESLA
    &update_access=true
    &client_id=8229df9f-91a0-4ff0-a1ae-a1f38ee24d07
    &scope=read_odometer control_security
    &redirect_uri=https://example.com
nametyperequireddescription
response_typestringtrueThis should be set to code.
makestringtrueSpecifies the brand to update access to. Currently, the only make available for this flow is TESLA.
client_idstringtrueThe application’s unique identifier. This is available on the credentials tab of the Smartcar Dashboard.
scope[permissions]trueA space-separated list of permissions that your application is requesting access to. The valid permission names can be found in the permissions section. When reauthenticating, the user will be required to grant the corresponding OEM permissions before being able to exit the flow.
redirect_uristringtrueRequired if using the /authorize route for Smartcar to return an authorization code.

Requiring Tesla Permissions

To ensure users select the necessary permissions with Tesla before being able to connect their vehicle via Smartcar, please append the required: prefix to Smartcar scopes in your Connet URL e.g. required:read_location.

As a result if they do not select the necessary permissions with Tesla, they will see the following screen and be prompted to return to Tesla to update their permissions.

Permission Mappings

Smartcar PermissionTesla Permission
control_chargeVehicle Charge Management
control_climateVehicle Commands
control_navigationVehicle Commands
control_pinVehicle Commands
control_securityVehicle Commands
control_trunkVehicle Commands
read_batteryVehicle Information
read_charge_recordsVehicle Charge Management
read_chargeVehicle Information
read_climateVehicle Information
read_compassVehicle Information
read_engine_oilVehicle Information
read_extended_vehicle_infoVehicle Information
read_fuelVehicle Information
read_locationVehicle Location
read_odometerVehicle Information
read_securityVehicle Information
read_speedometerVehicle Information
read_thermometerVehicle Information
read_tiresVehicle Information
read_user_profileProfile Information
read_vehicle_infoVehicle Information
read_vinVehicle Information

Was this page helpful?