Third Party Business Tokens
Generate a token on behalf of a business. This allows API calls using the scopes granted by the business.
Step 1: Navigate to Consent Management
Developer administrator navigates to Tesla for Business.
Select "Account" Tab.
Select "Consent Management" under Access Management in the sidemenu.
Step 2: Generate Invitation
Click on the "Request Consent" button.
Select a developer application from the dropdown menu.
Enter email of a business admin and submit.
An email will be sent to the business contact to approve the request from 'noreply@tesla.com' with the following subject "Access Request from application_name".
Step 3: Authorize Application
Business contact opens the approval email and signs in with their admin credentials.
They will be prompted to select a business account and grant application scopes.
Step 4: Obtain Authorization Code
After access has been granted, a developer administrator can obtain the authorization code from consent management page within Tesla for Business.
Step 5: Generate Third Party Business Token
Execute the following request to generate a token.
POST https://auth.tesla.com/oauth2/v3/token
Parameters
Name | Required | Example | Description |
---|---|---|---|
grant_type | Yes | client_credentials | Grant type must be client_credentials. |
client_id | Yes | abc-123 | Partner application client ID that was granted access |
client_secret | Yes | secret-password | Partner application client secret. |
scope | Yes | user_data vehicle_device_data vehicle_cmds vehicle_charging_cmds | Space delimited list of scopes |
audience | Yes | https://fleet-api.prd.na.vn.cloud.tesla.com | Audience for the generated token. Must be a Fleet API base URL. |
auth_code | Yes | 7baf90cda... | Authorization code obtained from Step 4 |
Example Request
# Third party business token request
curl --request POST \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode "client_id=$CLIENT_ID" \
--data-urlencode "client_secret=$CLIENT_SECRET" \
--data-urlencode "auth_code=$AUTHCODE" \
--data-urlencode "audience=$AUDIENCE" \
--data-urlencode "scope=$SCOPE" \
'https://auth.tesla.com/oauth2/v3/token'
# Extract access_token from this response