DeveloperSkip to main content

  1. Fleet API
  2. Charging

Partner Tokens

POST https://auth.tesla.com/oauth2/v3/token

Generates a token to be used for managing a partner's account or devices they own.

Parameters

NameRequiredExampleDescription
grant_typeYesclient_credentialsGrant type must be client_credentials.
client_idYesabc-123Partner application client ID.
client_secretYessecret-passwordPartner application client secret.
audienceYeshttps://fleet-api.prd.na.vn.cloud.tesla.comAudience for the generated token. Must be a Fleet API base URL
scopeNoopenid user_data vehicle_device_data vehicle_cmds vehicle_charging_cmdsSpace-delimited list of scopes.

Example Request

CLIENT_ID=<command to obtain a client_id>
CLIENT_SECRET=<secure command to obtain a client_secret>
AUDIENCE="https://fleet-api.prd.na.vn.cloud.tesla.com"
# Partner authentication 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 'scope=openid vehicle_device_data vehicle_cmds vehicle_charging_cmds' \
  --data-urlencode "audience=$AUDIENCE" \
  'https://auth.tesla.com/oauth2/v3/token'