DeveloperSkip to main content

  1. Fleet API
  2. Charging

Third Party Business Tokens

Generate a token on behalf of a business. This allows API calls using the scopes granted by the business.

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

NameRequiredExampleDescription
grant_typeYesclient_credentialsGrant type must be client_credentials.
client_idYesabc-123Partner application client ID that was granted access
client_secretYessecret-passwordPartner application client secret.
scopeYesuser_data vehicle_device_data vehicle_cmds vehicle_charging_cmdsSpace delimited list of scopes
audienceYeshttps://fleet-api.prd.na.vn.cloud.tesla.comAudience for the generated token. Must be a Fleet API base URL.
auth_codeYes7baf90cda...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