Tesla homepageDeveloperSkip to main content

NAV

Overview

FleetAPI is a RESTful data and command service providing access to Tesla vehicles and energy devices. Partners can interact with their own devices, or devices for which they have been granted access by a customer.

Setup

  1. Set up a third-party account at https://developer.tesla.com.
  2. Complete registration of your account:
    1. Generate a public/private key pair for signing commands and host your public key in the /.well-known section of your website. See details here.
    2. Generate a partner authentication token.
    3. Make a POST call to /api/1/partner_accounts with your partner token.
  3. Request authorization permissions from a customer and generate a third-party token on their behalf. See the authentication section for examples.


Regional requirements

FleetAPI is available regionally. Use the appropriate region for each user.

Authentication

API endpoints require an authentication token. There are two types of tokens:

  1. Partner authentication token - The subject of this token will be an application or business client_id, and will be generated using the client_credentials grant type. This can be used for calls related to modifying an application like register, or for accessing business-owned devices.
  2. Third-party token - The subject of this token will be the ID of a customer's account, and will be generated using the authorization_code grant type. This token is generated by a third-party application on behalf of a customer, and can be used for most endpoints.

Generating a partner authentication token

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

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

CLIENT_ID=<command to obtain your client_id>
CLIENT_SECRET=<secure command to obtain your 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'

Generating a third-party token on behalf of a customer

Use this Authorization Code Grant flow to generate a token on behalf of a customer. This allows you to make API calls using the scopes granted by the customer.


1. To initiate the authorization code flow, direct the customer to an /authorize request.

https://auth.tesla.com/oauth2/v3/authorize?&client_id=$CLIENT_ID&locale=en-US&prompt=login&redirect_uri=$REDIRECT_URI&response_type=code&scope=openid%20vehicle_device_data%20offline_access&state=$STATE`

https://auth.tesla.com/oauth2/v3/authorize

Parameters

Name Required Example Description
response_type Yes code A string, always use the value "code"
client_id Yes abc-123 Partner app client_id
redirect_uri Yes https://example.com/auth/callback Partner app callback url, spec: rfc6749
scope Yes openid offline_access vehicle_device_data vehicle_cmds vehicle_charging_cmds Space delimited list of scopes, include openid and office_access to obtain a refresh token
state Yes db4af3f87... Random value used for validation
nonce No 7baf90cda... Random value used for replay prevention

2. Extract the code URL parameter from the callback.

3. Execute a code exchange call to generate a token. Save the refresh_token to generate tokens in the future. The access_token can be used as the Bearer token in the Authorization header when making API requests.

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

# Authorization code token request
CODE=<extract from callback>
curl --request POST \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=authorization_code' \
  --data-urlencode "client_id=$CLIENT_ID" \
  --data-urlencode "client_secret=$CLIENT_SECRET" \
  --data-urlencode "code=$CODE" \
  --data-urlencode "audience=$AUDIENCE" \
  --data-urlencode "redirect_uri=$CALLBACK" \
  'https://auth.tesla.com/oauth2/v3/token'
# Extract access_token and refresh_token from this response

Parameters

Name Required Example Description
grant_type Yes authorization_code Grant type, authorization_code, refresh_token, client_credentials
client_id Yes abc-123 Partner app client_id
client_secret Yes secret-password Partner app client_secret
code Yes a90869e9d... Code from authorize request callback
redirect_uri Yes https://example.com/auth/callback Partner app callback url, spec: rfc6749
scope No openid 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 generated token

4. Use the refresh_token to generate new tokens and obtain refresh tokens.

# Refresh token request
REFRESH_TOKEN=<extract from authorization code token request>
curl --request POST \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=refresh_token' \
  --data-urlencode "client_id=$CLIENT_ID" \
  --data-urlencode "refresh_token=$REFRESH_TOKEN" \
  'https://auth.tesla.com/oauth2/v3/token'

Authorization Scopes

Name Scope Description
Profile Information user_data Contact information, home address, profile picture, and referral information
Vehicle Information vehicle_device_data Vehicle live data, location, eligible upgrades, nearby superchargers, ownership, and service scheduling data
Vehicle Commands vehicle_cmds Commands like add/remove driver, access Live Camera, unlock, wake up, remote start, and schedule software updates
Vehicle Charging Management vehicle_charging_cmds Vehicle charging history, billed amount, charging location, commands to schedule, and start/stop charging
Energy Product Information energy_device_data Energy flow history, saving forecast, tariff rates, grid import, calendar, site status, time of use, and ownership
Energy Product Commands energy_cmds Commands like update storm mode



Membership Tiers

These are the currently active membership tiers to access Tesla's Fleet API.

Discovery Tier

Subscription plan Discovery Tier
Device data limits 1 API request / car / 5 min
And
1M API requests / day
Commands limits 50 API requests / car / day
And
500k API requests / day
Wake limits 5 API requests / car / hour
Capabilities API access
Login with Tesla
Tesla for Business access
Enterprise charging API
Invoices
Limited Fleet Telemetry streaming
Price $0/week
Subscription duration Weekly, auto-renewing until canceled
Availability This subscription plan is a temporary plan that will be replaced with different options in 2024



Conventions

Request Format

Requests require the HTTP header 'Content-Type' with the value 'application/json'. In addition, all authenticated endpoints require the standard Bearer Authorization header and a valid token.

  Content-Type: application/json
  Authorization: Bearer 8s2wfclhyp5iiikowm3ocnfalt7qfl7es8xhuda3ttusslssx6c14hq7yocp62c5

POST request parameters are expected to be a JSON object in the body.

Response Format

Responses are returned as a JSON object with the following common fields:

Field Description
response: <json> JSON representing the response. May be a scalar, an array or a object depending on the specific request
error: short-string Short error "enum" like "not_found", "invalid_resource", "invalid_password"
error_description: long-string Additional error information
messages: {"field1":["problem1","problem2"],...} Data validation issues, especially on a 422 responses

Request Parameters

The {id} path parameter for device/entity/vehicle endpoints is expected to be the integer id of the record returned from the list endpoint. Example: vehicles list. For vehicle endpoints and vehicle commands, a valid VIN can be used instead of an integer id.

Response Codes

Not all possible response codes are covered in Endpoint examples. The following are common meanings of status codes. The response body is typically JSON-encoded with details in the "error" field.

Successes

Status Code Description Detail
200 Ok The request was handled successfully
201 Created The record was created successfully

Client errors

Status Code Description Detail
400 Bad Request
• error:invalid_command if the data_request or command is unknown
• error:invalid_field if the new_field data isn't valid
401 Unauthorized
• no response body - OAuth token has expired
• error:mobile_access_disabled if the vehicle has turned off remote access
• error:login_failed if the current_password is incorrect on change_password
• error:password_changed if the password has changed since the last token was acquired
402 Payment Required You need to make a payment in order to use the API (non-free account only)
403 Forbidden You do not have access to this resource, do you have the required scopes?
404 Not Found The requested resource does not exist
405 Not Allowed The operation is not allowed
406 Not Acceptable error:not_a_JSON_request if the HTTP request does not have Content-Type set to application/json
408 Device Not Available If the vehicle is not "online" when a request is made.
412 Precondition Failed A condition has not been met to process the request
• Unregistered account - you must first call the partner account register endpoint
418 Client Too Old (Not supported)
422 Invalid Resource error:invalid_resource if there is a semantic problem with the data, e.g. missing or invalid data
• Vehicle does not yet support signed commands
423 Locked Account is locked, and must be unlocked by Tesla. No response body
429 Rate limited Account or server is rate limited, this happens when too many requests are made by an account
• Check the 'Retry-After' request header (in seconds) to determine when to make the next request
451 Resource Unavailable For Legal Reasons Querying for a user/vehicle without proper privacy settings (e.g. wrong region)
499 Client Closed Request Client has closed the request before the server could send a response

Server errors

Status Code Description Detail
500 Internal server error An error occurred while processing the request
503 Service Unavailable Either an internal service or a vehicle did not respond (timeout)
504 Gateway Timeout Server did not receive a response

Device errors

Status Code Description Detail
540 Device Unexpected response Vehicle responded with an error - might need a reboot, OTA update, or service


API Status

GET /status

curl 'https://fleet-api.prd.na.vn.cloud.tesla.com/status' 

This endpoint returns the string "ok" if the API is operating normally. No HTTP headers are required.

Charging Endpoints

charging_history

GET /api/1/dx/charging/history

scopes: vehicle_charging_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/charging/history' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/charging/history", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/charging/history")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/dx/charging/history", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the paginated charging history.

Parameters

Name In Type Required Description
vin query string No VIN
startTime query string No StartTime
endTime query string No EndTime
pageNo query integer No pageNo
pageSize query integer No pageSize
sortBy query string No sortBy
sortOrder query string No sortOrder
Click to view successful response{ "data": [ { "sessionId": 1234567, "vin": "TEST00000000VIN01", "siteLocationName": "Truckee, CA - Soaring Way", "chargeStartDateTime": "2023-07-27T11:43:45-07:00", "chargeStopDateTime": "2023-07-27T12:08:35-07:00", "unlatchDateTime": "2023-07-27T12:25:31-07:00", "countryCode": "US", "fees": [ { "sessionFeeId": 7654321, "feeType": "CHARGING", "currencyCode": "USD", "pricingType": "PAYMENT", "rateBase": 0.46, "rateTier1": 0, "rateTier2": 0, "rateTier3": null, "rateTier4": null, "usageBase": 40, "usageTier1": 0, "usageTier2": 24, "usageTier3": null, "usageTier4": null, "totalBase": 18.4, "totalTier1": 0, "totalTier2": 0, "totalTier3": 0, "totalTier4": 0, "totalDue": 18.4, "netDue": 18.4, "uom": "kwh", "isPaid": true, "status": "PAID" }, { "sessionFeeId": 87654321, "feeType": "PARKING", "currencyCode": "USD", "pricingType": "NO_CHARGE", "rateBase": 0, "rateTier1": 0, "rateTier2": 0, "rateTier3": null, "rateTier4": null, "usageBase": 0, "usageTier1": 0, "usageTier2": 0, "usageTier3": null, "usageTier4": null, "totalBase": 0, "totalTier1": 0, "totalTier2": 0, "totalTier3": 0, "totalTier4": 0, "totalDue": 0, "netDue": 0, "uom": "min", "isPaid": true, "status": "PAID" } ], "billingType": "IMMEDIATE", "invoices": [ { "fileName": "ABC-123NN-US.pdf", "contentId": "abc-123-efg", "invoiceType": "IMMEDIATE" } ], "vehicleMakeType": "TSLA" } ] }

charging_sessions (only for business fleet owners)

GET /api/1/dx/charging/sessions

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/charging/sessions' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/charging/sessions", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/charging/sessions")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/dx/charging/sessions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the charging session information including pricing and energy data. This endpoint is only available for business accounts that own a fleet of vehicles.

Parameters

Name In Type Required Description
vin query string No VIN
date_from query string No date from
date_to query string No date to
limit query integer No limit
offset query integer No offset
Click to view successful response{ "data": [ { "charging_periods": [ { "dimensions": [ { "type": "ENERGY", "volume": 0 } ], "start_date_time": "string" } ], "id": "string", "location": { "country": "string", "name": "string" }, "model": "string", "start_date_time": "string", "stop_date_time": "string", "tariffs": { "currency": "string", "elements": [ { "price_components": [ { "price": 0, "step_size": 0, "type": "ENERGY" } ], "restrictions": { "additionalProp1": {} } } ] }, "total_cost": { "excl_vat": 0, "incl_vat": 0, "vat": 0 }, "total_energy": 0, "total_time": 0, "vin": "string" } ], "status_code": 0, "status_message": "string", "timestamp": { "time.Time": "string" } }

Partner Endpoints

public_key

GET /api/1/partner_accounts/public_key

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/partner_accounts/public_key' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/partner_accounts/public_key", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/partner_accounts/public_key")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/partner_accounts/public_key", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the public key associated with a domain. It can be used to ensure the registration was successful.

Parameters

Name In Type Required Description
domain query string No Partner domain
Click to view successful response{ "public_key": "04b3ba29bfed422f4a641630333458428cbd681ae1456f1d50521852577c3a84b22c7290087af38d8c4cd7b310dbfd79f164405d72a6cfac875ca37a7f09317891" }

register

POST /api/1/partner_accounts

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"domain":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/partner_accounts' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "domain": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/partner_accounts", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/partner_accounts")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "domain": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "domain": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/partner_accounts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Registers an existing account before it can be used for general API access. Each application from developer.tesla.com must complete this step.

  • The domain for this endpoint must match the root domain from the allowed_origins on developer.tesla.com. Ex.: 123.abc.com can be used for an allowed_origin of www.abc.com.
  • The Bearer token for this request must be a partner authentication token.
  • A PEM-encoded EC public key using the secp256r1 curve (prime256v1) must be hosted at https://<your domain>/.well-known/appspecific/com.tesla.3p.public-key.pem. This public key will be registered on devices and used to validate commands that are generated by the vehicle-command proxy.
  • The domain will be displayed to users as part of the mobile-app-based vehicle key-pairing process.

Parameters

Name In Type Required Description
domain body string Yes Your domain. You must host a PEM-encoded EC public key at https:///.well-known/appspecific/com.tesla.3p.public-key.pem. Domains must be lowercase and have the same root as a domain from your application's allowed_origins on developer.tesla.com.
Click to view successful response{ "client_id": "client-id", "name": "The Best Tesla Partner", "description": "The very best Tesla partner", "domain": "the-best-partner.com", "ca": null, "created_at": "2023-06-28T00:42:00.000Z", "updated_at": "2023-06-28T00:42:00.000Z", "enterprise_tier": "free", "public_key": "04b3ba29bfed422f4a641630333458428cbd681ae1456f1d50521852577c3a84b22c7290087af38d8c4cd7b310dbfd79f164405d72a6cfac875ca37a7f09317891" }

User Endpoints

backup_key

GET /api/1/users/backup_key

scopes: user_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/backup_key' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/backup_key", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/backup_key")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/users/backup_key", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the public key associated with the user.

Parameters

Click to view successful response{ "backup_key": null }

feature_config

GET /api/1/users/feature_config

scopes: user_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/feature_config' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/feature_config", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/feature_config")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/users/feature_config", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns any custom feature flag applied to a user.

Parameters

Click to view successful response{ "signaling": { "enabled": true, "subscribe_connectivity": false } }

me

GET /api/1/users/me

scopes: user_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/me' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/me", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/me")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/users/me", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns a summary of a user's account.

Parameters

Click to view successful response{ "email": "test-user@tesla.com", "full_name": "Testy McTesterson", "profile_image_url": "https://vehicle-files.prd.usw2.vn.cloud.tesla.com/profile_images/f98c87cd7bebc06069b89b33f9ec634c195520f75b6e63ea89f0b7c61449c689.jpg" }

orders

GET /api/1/users/orders

scopes: user_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/orders' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/orders", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/orders")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/users/orders", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the active orders for a user.

Parameters

Click to view successful response[ { "vehicleMapId": 1234466, "referenceNumber": "RN00000001", "vin": "5YJ30000000000001", "orderStatus": "BOOKED", "orderSubstatus": "_Z", "modelCode": "m3", "countryCode": "US", "locale": "en_US", "mktOptions": "APBS,DV2W,IBB1,PMNG,PRM30,SC04,MDL3,W41B,MT322,CPF0,RSF1,CW03", "isB2b": false } ]

region

GET /api/1/users/region

scopes: user_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/region' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/region", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/users/region")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/users/region", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns a user's region and appropriate fleet-api base URL. Accepts no parameters, response is based on the authentication token subject.

Parameters

Click to view successful response{ "region": "eu", "fleet_api_base_url": "https://fleet-api.prd.eu.vn.cloud.tesla.com" }

Vehicle Commands

actuate_trunk

POST /api/1/vehicles/{id}/command/actuate_trunk

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"which_trunk":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/actuate_trunk' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "which_trunk": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/actuate_trunk", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/actuate_trunk")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "which_trunk": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "which_trunk": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/actuate_trunk", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Controls the front (which_trunk: "front") or rear (which_trunk: "rear") trunk.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
which_trunk body string Yes
Click to view successful response{ "result": true, "reason": "" }

adjust_volume

POST /api/1/vehicles/{id}/command/adjust_volume

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"volume":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/adjust_volume' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "volume": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/adjust_volume", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/adjust_volume")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "volume": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "volume": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/adjust_volume", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Adjusts vehicle media playback volume.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
volume body integer Yes
Click to view successful response{ "result": true, "reason": "" }

auto_conditioning_start

POST /api/1/vehicles/{id}/command/auto_conditioning_start

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/auto_conditioning_start' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/auto_conditioning_start", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/auto_conditioning_start")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/auto_conditioning_start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Starts climate preconditioning.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

auto_conditioning_stop

POST /api/1/vehicles/{id}/command/auto_conditioning_stop

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/auto_conditioning_stop' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/auto_conditioning_stop", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/auto_conditioning_stop")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/auto_conditioning_stop", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Stops climate preconditioning.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

cancel_software_update

POST /api/1/vehicles/{id}/command/cancel_software_update

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/cancel_software_update' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/cancel_software_update", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/cancel_software_update")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/cancel_software_update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Cancels the countdown to install the vehicle software update. This operation will no longer work after the vehicle begins the software installation.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

charge_max_range

POST /api/1/vehicles/{id}/command/charge_max_range

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_max_range' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_max_range", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_max_range")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/charge_max_range", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Charges in max range mode -- we recommend limiting the use of this mode to long trips.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

charge_port_door_close

POST /api/1/vehicles/{id}/command/charge_port_door_close

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_port_door_close' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_port_door_close", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_port_door_close")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/charge_port_door_close", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Closes the charge port door.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

charge_port_door_open

POST /api/1/vehicles/{id}/command/charge_port_door_open

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_port_door_open' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_port_door_open", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_port_door_open")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/charge_port_door_open", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Opens the charge port door.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

charge_standard

POST /api/1/vehicles/{id}/command/charge_standard

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_standard' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_standard", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_standard")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/charge_standard", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Charges in Standard mode.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

charge_start

POST /api/1/vehicles/{id}/command/charge_start

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_start' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_start", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_start")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/charge_start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Starts charging the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

charge_stop

POST /api/1/vehicles/{id}/command/charge_stop

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_stop' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_stop", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/charge_stop")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/charge_stop", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Stops charging the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

door_lock

POST /api/1/vehicles/{id}/command/door_lock

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/door_lock' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/door_lock", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/door_lock")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/door_lock", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Locks the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

door_unlock

POST /api/1/vehicles/{id}/command/door_unlock

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/door_unlock' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/door_unlock", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/door_unlock")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/door_unlock", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Unlocks the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

erase_user_data

POST /api/1/vehicles/{id}/command/erase_user_data

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/erase_user_data' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/erase_user_data", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/erase_user_data")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/erase_user_data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Erases user's data from the user interface. Requires the vehicle to be in park.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

flash_lights

POST /api/1/vehicles/{id}/command/flash_lights

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/flash_lights' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/flash_lights", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/flash_lights")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/flash_lights", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Briefly flashes the vehicle headlights. Requires the vehicle to be in park.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

guest_mode

POST /api/1/vehicles/{id}/command/guest_mode

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"enable":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/guest_mode' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "enable": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/guest_mode", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/guest_mode")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "enable": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "enable": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/guest_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
  • Restricts certain vehicle UI functionality from guest users:
    • PIN to Drive
    • Speed Limit Mode
    • Glovebox PIN
    • Add/Remove keys
    • Change vehicle name
  • Enables erase_user_data API on the vehicle to clear user data.
  • Allows a user to set up Tesla mobile app access with the vehicle key card:
    • If a user unlocks a vehicle or authenticates it for driving while in Guest Mode, they will receive a prompt to set up a phone key by scanning a QR code on the vehicle touchscreen.
      • Requires vehicle to be online.
      • Does not show a QR code if a phone key is already connected.
      • Revokes any existing guest access if a QR code is shown.
    • Any account that scans the QR code will gain Tesla app access to the vehicle. This allows that account to view live vehicle location and issue remote commands, and download that account's Tesla profile to the vehicle.        
      • The QR code is single-use and expires after 10 minutes.
      • Use the revoke API to remove access.
    • The vehicle needs to be online to use this API (wake if vehicle unavailable).
    • The app access is GUEST access, it does not have access to all the features an owner or driver does.
    • Only one guest is allowed access at a time.
    • If a user does not have the app installed, they will see this webpage (https://www.tesla.com/_gs/test) to guide them through the process.
    • A user can set up their phone as key with the Tesla app when in proximity of the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
enable body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

honk_horn

POST /api/1/vehicles/{id}/command/honk_horn

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/honk_horn' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/honk_horn", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/honk_horn")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/honk_horn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Honks the vehicle horn. Requires the vehicle to be in park.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

media_next_fav

POST /api/1/vehicles/{id}/command/media_next_fav

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_next_fav' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_next_fav", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_next_fav")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/media_next_fav", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Advances media player to next favorite track.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

media_next_track

POST /api/1/vehicles/{id}/command/media_next_track

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_next_track' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_next_track", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_next_track")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/media_next_track", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Advances media player to next track.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

media_prev_fav

POST /api/1/vehicles/{id}/command/media_prev_fav

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_prev_fav' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_prev_fav", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_prev_fav")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/media_prev_fav", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Advances media player to previous favorite track.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

media_prev_track

POST /api/1/vehicles/{id}/command/media_prev_track

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_prev_track' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_prev_track", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_prev_track")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/media_prev_track", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Advances media player to previous track.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

media_toggle_playback

POST /api/1/vehicles/{id}/command/media_toggle_playback

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_toggle_playback' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_toggle_playback", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_toggle_playback")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/media_toggle_playback", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Toggles current play/pause state.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

media_volume_down

POST /api/1/vehicles/{id}/command/media_volume_down

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_volume_down' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_volume_down", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/media_volume_down")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/media_volume_down", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Turns the volume down by one.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

POST /api/1/vehicles/{id}/command/navigation_gps_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"lat":null,"lon":null,"order":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_gps_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "lat": null,
   "lon": null,
   "order": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_gps_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_gps_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "lat": nil,
   "lon": nil,
   "order": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "lat": None,
   "lon": None,
   "order": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/navigation_gps_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Start navigation to given coordinates. Order can be used to specify order of multiple stops.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
lat body Unknown Yes
lon body Unknown Yes
order body integer Yes
Click to view successful response{ "result": true, "reason": "" }

POST /api/1/vehicles/{id}/command/navigation_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"type":"string","value":null,"locale":"string","timestamp_ms":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "type": "string",
   "value": null,
   "locale": "string",
   "timestamp_ms": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "type": "string",
   "value": nil,
   "locale": "string",
   "timestamp_ms": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "type": "string",
   "value": None,
   "locale": "string",
   "timestamp_ms": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/navigation_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sends a location to the in-vehicle navigation system.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
type body string Yes
value body Unknown Yes
locale body string Yes
timestamp_ms body string Yes
Click to view successful response{ "result": true, "queued": true }

POST /api/1/vehicles/{id}/command/navigation_sc_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"id":"integer","order":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_sc_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "id": "integer",
   "order": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_sc_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/navigation_sc_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "id": "integer",
   "order": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "id": "integer",
   "order": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/navigation_sc_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Start navigation to a supercharger.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
id body integer Yes
order body integer Yes
Click to view successful response{ "result": true, "reason": "" }

remote_auto_seat_climate_request

POST /api/1/vehicles/{id}/command/remote_auto_seat_climate_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"auto_seat_position":"integer","auto_climate_on":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_auto_seat_climate_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "auto_seat_position": "integer",
   "auto_climate_on": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_auto_seat_climate_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_auto_seat_climate_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "auto_seat_position": "integer",
   "auto_climate_on": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "auto_seat_position": "integer",
   "auto_climate_on": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_auto_seat_climate_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets automatic seat heating and cooling.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
auto_seat_position body integer Yes
auto_climate_on body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

remote_auto_steering_wheel_heat_climate_request

POST /api/1/vehicles/{id}/command/remote_auto_steering_wheel_heat_climate_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_auto_steering_wheel_heat_climate_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_auto_steering_wheel_heat_climate_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_auto_steering_wheel_heat_climate_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_auto_steering_wheel_heat_climate_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets automatic steering wheel heating on/off.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

remote_boombox

POST /api/1/vehicles/{id}/command/remote_boombox

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"sound":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_boombox' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "sound": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_boombox", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_boombox")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "sound": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "sound": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_boombox", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Plays a sound through the vehicle external speaker.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
sound body integer Yes
Click to view successful response{ "result": true, "reason": "" }

remote_seat_cooler_request

POST /api/1/vehicles/{id}/command/remote_seat_cooler_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"seat_position":"integer","seat_cooler_level":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_seat_cooler_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "seat_position": "integer",
   "seat_cooler_level": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_seat_cooler_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_seat_cooler_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "seat_position": "integer",
   "seat_cooler_level": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "seat_position": "integer",
   "seat_cooler_level": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_seat_cooler_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets seat cooling.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
seat_position body integer Yes
seat_cooler_level body integer Yes
Click to view successful response{ "result": true, "reason": "" }

remote_seat_heater_request

POST /api/1/vehicles/{id}/command/remote_seat_heater_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_seat_heater_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_seat_heater_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_seat_heater_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_seat_heater_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets seat heating.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

remote_start_drive

POST /api/1/vehicles/{id}/command/remote_start_drive

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_start_drive' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_start_drive", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_start_drive")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_start_drive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Starts the vehicle remotely. Requires keyless driving to be enabled.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

remote_steering_wheel_heat_level_request

POST /api/1/vehicles/{id}/command/remote_steering_wheel_heat_level_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"level":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_steering_wheel_heat_level_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "level": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_steering_wheel_heat_level_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_steering_wheel_heat_level_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "level": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "level": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_steering_wheel_heat_level_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets steering wheel heat level.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
level body integer Yes
Click to view successful response{ "result": true, "reason": "" }

remote_steering_wheel_heater_request

POST /api/1/vehicles/{id}/command/remote_steering_wheel_heater_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_steering_wheel_heater_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_steering_wheel_heater_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/remote_steering_wheel_heater_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/remote_steering_wheel_heater_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets steering wheel heating on/off. For vehicles that do not support auto steering wheel heat.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

reset_pin_to_drive_pin

POST /api/1/vehicles/{id}/command/reset_pin_to_drive_pin

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/reset_pin_to_drive_pin' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/reset_pin_to_drive_pin", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/reset_pin_to_drive_pin")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/reset_pin_to_drive_pin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Removes PIN to Drive. Requires the car to be in pin to drive mode and not in valet mode.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

reset_valet_pin

POST /api/1/vehicles/{id}/command/reset_valet_pin

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/reset_valet_pin' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/reset_valet_pin", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/reset_valet_pin")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/reset_valet_pin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Removes PIN for Valet Mode.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

schedule_software_update

POST /api/1/vehicles/{id}/command/schedule_software_update

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"offset_sec":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/schedule_software_update' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "offset_sec": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/schedule_software_update", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/schedule_software_update")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "offset_sec": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "offset_sec": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/schedule_software_update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Schedules a vehicle software update (over the air "OTA") to be installed in the future.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
offset_sec body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_bioweapon_mode

POST /api/1/vehicles/{id}/command/set_bioweapon_mode

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean","manual_override":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_bioweapon_mode' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean",
   "manual_override": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_bioweapon_mode", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_bioweapon_mode")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean",
   "manual_override": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean",
   "manual_override": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_bioweapon_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Turns Bioweapon Defense Mode on and off.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
manual_override body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

set_cabin_overheat_protection

POST /api/1/vehicles/{id}/command/set_cabin_overheat_protection

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean","fan_only":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_cabin_overheat_protection' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean",
   "fan_only": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_cabin_overheat_protection", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_cabin_overheat_protection")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean",
   "fan_only": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean",
   "fan_only": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_cabin_overheat_protection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets the vehicle overheat protection.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
fan_only body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

set_charge_limit

POST /api/1/vehicles/{id}/command/set_charge_limit

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"percent":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_charge_limit' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "percent": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_charge_limit", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_charge_limit")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "percent": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "percent": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_charge_limit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets the vehicle charge limit.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
percent body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_charging_amps

POST /api/1/vehicles/{id}/command/set_charging_amps

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"charging_amps":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_charging_amps' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "charging_amps": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_charging_amps", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_charging_amps")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "charging_amps": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "charging_amps": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_charging_amps", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets the vehicle charging amps.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
charging_amps body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_climate_keeper_mode

POST /api/1/vehicles/{id}/command/set_climate_keeper_mode

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"climate_keeper_mode":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_climate_keeper_mode' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "climate_keeper_mode": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_climate_keeper_mode", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_climate_keeper_mode")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "climate_keeper_mode": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "climate_keeper_mode": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_climate_keeper_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Enables climate keeper mode.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
climate_keeper_mode body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_cop_temp

POST /api/1/vehicles/{id}/command/set_cop_temp

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"cop_temp":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_cop_temp' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "cop_temp": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_cop_temp", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_cop_temp")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "cop_temp": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "cop_temp": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_cop_temp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Adjusts the Cabin Overheat Protection temperature.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
cop_temp body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_managed_charge_current_request

POST /api/1/vehicles/{id}/command/set_managed_charge_current_request

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_charge_current_request' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_charge_current_request", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_charge_current_request")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_managed_charge_current_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets the desired managed AC charging current (in amps).

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

set_managed_charger_location

POST /api/1/vehicles/{id}/command/set_managed_charger_location

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_charger_location' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_charger_location", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_charger_location")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_managed_charger_location", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets the latitude and longitude coordinates of the location where managed AC charging should be active.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

set_managed_scheduled_charging_time

POST /api/1/vehicles/{id}/command/set_managed_scheduled_charging_time

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_scheduled_charging_time' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_scheduled_charging_time", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_managed_scheduled_charging_time")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_managed_scheduled_charging_time", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets a time at which managed AC charging should start.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "result": true, "reason": "" }

set_pin_to_drive

POST /api/1/vehicles/{id}/command/set_pin_to_drive

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean","password":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_pin_to_drive' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean",
   "password": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_pin_to_drive", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_pin_to_drive")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean",
   "password": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean",
   "password": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_pin_to_drive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets a four-digit passcode for PIN to Drive. This PIN must then be entered before the vehicle can be driven.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
password body string Yes
Click to view successful response{ "result": true, "reason": "" }

set_preconditioning_max

POST /api/1/vehicles/{id}/command/set_preconditioning_max

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean","manual_override":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_preconditioning_max' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean",
   "manual_override": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_preconditioning_max", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_preconditioning_max")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean",
   "manual_override": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean",
   "manual_override": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_preconditioning_max", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets an override for preconditioning — it should default to empty if no override is used.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
manual_override body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

set_scheduled_charging

POST /api/1/vehicles/{id}/command/set_scheduled_charging

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"enable":"boolean","time":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_scheduled_charging' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "enable": "boolean",
   "time": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_scheduled_charging", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_scheduled_charging")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "enable": "boolean",
   "time": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "enable": "boolean",
   "time": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_scheduled_charging", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets a time at which managed AC charging should start.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
enable body boolean Yes
time body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_scheduled_departure

POST /api/1/vehicles/{id}/command/set_scheduled_departure

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"enable":"boolean","time":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_scheduled_departure' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "enable": "boolean",
   "time": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_scheduled_departure", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_scheduled_departure")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "enable": "boolean",
   "time": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "enable": "boolean",
   "time": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_scheduled_departure", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets a time at which charging should be completed.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
enable body boolean Yes
time body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_sentry_mode

POST /api/1/vehicles/{id}/command/set_sentry_mode

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_sentry_mode' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_sentry_mode", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_sentry_mode")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_sentry_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Enables and disables Sentry Mode. Sentry Mode allows customers to watch the vehicle cameras live from the mobile app, as well as record sentry events.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
Click to view successful response{ "result": true, "reason": "" }

set_temps

POST /api/1/vehicles/{id}/command/set_temps

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"driver_temp":"integer","passenger_temp":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_temps' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "driver_temp": "integer",
   "passenger_temp": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_temps", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_temps")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "driver_temp": "integer",
   "passenger_temp": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "driver_temp": "integer",
   "passenger_temp": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_temps", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets the driver and/or passenger-side cabin temperature (and other zones if sync is enabled).

Parameters

Name In Type Required Description
id path integer Yes vehicle id
driver_temp body integer Yes
passenger_temp body integer Yes
Click to view successful response{ "result": true, "reason": "" }

set_valet_mode

POST /api/1/vehicles/{id}/command/set_valet_mode

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"on":"boolean","password":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_valet_mode' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "on": "boolean",
   "password": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_valet_mode", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_valet_mode")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "on": "boolean",
   "password": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "on": "boolean",
   "password": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_valet_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Turns on Valet Mode and sets a four-digit passcode that must then be entered to disable Valet Mode.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
on body boolean Yes
password body string Yes
Click to view successful response{ "result": true, "reason": "" }

set_vehicle_name

POST /api/1/vehicles/{id}/command/set_vehicle_name

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"vehicle_name":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_vehicle_name' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "vehicle_name": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_vehicle_name", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/set_vehicle_name")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "vehicle_name": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "vehicle_name": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/set_vehicle_name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Changes the name of a vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
vehicle_name body string Yes
Click to view successful response{ "result": true, "reason": "" }

speed_limit_activate

POST /api/1/vehicles/{id}/command/speed_limit_activate

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"pin":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_activate' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "pin": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_activate", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_activate")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "pin": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "pin": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/speed_limit_activate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Activates Speed Limit Mode with a four-digit PIN.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
pin body string Yes
Click to view successful response{ "result": true, "reason": "" }

speed_limit_clear_pin

POST /api/1/vehicles/{id}/command/speed_limit_clear_pin

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"pin":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_clear_pin' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "pin": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_clear_pin", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_clear_pin")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "pin": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "pin": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/speed_limit_clear_pin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Deactivates Speed Limit Mode and resets the associated PIN.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
pin body string Yes
Click to view successful response{ "result": true, "reason": "" }

speed_limit_deactivate

POST /api/1/vehicles/{id}/command/speed_limit_deactivate

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"pin":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_deactivate' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "pin": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_deactivate", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_deactivate")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "pin": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "pin": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/speed_limit_deactivate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Deactivates Speed Limit Mode.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
pin body string Yes
Click to view successful response{ "result": true, "reason": "" }

speed_limit_set_limit

POST /api/1/vehicles/{id}/command/speed_limit_set_limit

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"limit_mph":"integer"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_set_limit' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "limit_mph": "integer"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_set_limit", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/speed_limit_set_limit")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "limit_mph": "integer"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "limit_mph": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/speed_limit_set_limit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Sets the maximum speed (in miles per hours) for Speed Limit Mode.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
limit_mph body integer Yes
Click to view successful response{ "result": true, "reason": "" }

sun_roof_control

POST /api/1/vehicles/{id}/command/sun_roof_control

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"state":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/sun_roof_control' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "state": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/sun_roof_control", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/sun_roof_control")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "state": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "state": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/sun_roof_control", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Control the sunroof on sunroof-enabled vehicles.\n\nSupported states: stop, close, and vent.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
state body string Yes
Click to view successful response{ "result": true, "reason": "" }

take_drivenote

POST /api/1/vehicles/{id}/command/take_drivenote

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"note":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/take_drivenote' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "note": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/take_drivenote", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/take_drivenote")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "note": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "note": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/take_drivenote", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Records a drive note. The note parameter is truncated to 80 characters in length.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
note body string Yes
Click to view successful response{ "result": true, "reason": "" }

POST /api/1/vehicles/{id}/command/trigger_homelink

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"lat":null,"lon":null,"token":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/trigger_homelink' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "lat": null,
   "lon": null,
   "token": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/trigger_homelink", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/trigger_homelink")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "lat": nil,
   "lon": nil,
   "token": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "lat": None,
   "lon": None,
   "token": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/trigger_homelink", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Turns on HomeLink (used to open and close garage doors).

Parameters

Name In Type Required Description
id path integer Yes vehicle id
lat body Unknown Yes
lon body Unknown Yes
token body string Yes
Click to view successful response{ "result": true, "reason": "" }

update_calendar_entries

POST /api/1/vehicles/{id}/command/update_calendar_entries

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"calendar_data":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/update_calendar_entries' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "calendar_data": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/update_calendar_entries", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/update_calendar_entries")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "calendar_data": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "calendar_data": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/update_calendar_entries", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Update the calendar entries stored on the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
calendar_data body string Yes
Click to view successful response{ "result": true, "reason": "" }

window_control

POST /api/1/vehicles/{id}/command/window_control

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{"lat":null,"lon":null,"command":"string"}' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/window_control' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "lat": null,
   "lon": null,
   "command": "string"
});

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   body,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/window_control", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/command/window_control")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"
request.body = JSON.dump({
   "lat": nil,
   "lon": nil,
   "command": "string"
})

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = json.dumps({
   "lat": None,
   "lon": None,
   "command": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/command/window_control", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Control the windows of a parked vehicle. Supported commands: vent and close. When closing, specify lat and lon of user to ensure they are within range of vehicle (unless this is an M3 platform vehicle).

Parameters

Name In Type Required Description
id path integer Yes vehicle id
lat body Unknown Yes
lon body Unknown Yes
command body string Yes
Click to view successful response{ "result": true, "reason": "" }

Vehicle Endpoints

list

GET /api/1/vehicles

scopes: vehicle_device_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicles", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Parameters

Name In Type Required Description
page query integer No page number
per_page query integer No quantity per page
Click to view successful response[ { "id": 100021, "vehicle_id": 99999, "vin": "TEST00000000VIN01", "color": null, "access_type": "OWNER", "display_name": "Owned", "option_codes": "TEST0,COUS", "granular_access": { "hide_private": false }, "tokens": [ "4f993c5b9e2b937b", "7a3153b1bbb48a96" ], "state": null, "in_service": false, "id_s": "100021", "calendar_enabled": true, "api_version": null, "backseat_token": null, "backseat_token_updated_at": null } ]

mobile_enabled

GET /api/1/vehicles/{id}/mobile_enabled

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/mobile_enabled' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/mobile_enabled", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/mobile_enabled")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicles/{id}/mobile_enabled", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns whether or not mobile access is enabled for the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "reason": "", "result": true }

nearby_charging_sites

GET /api/1/vehicles/{id}/nearby_charging_sites

scopes: vehicle_device_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/nearby_charging_sites' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/nearby_charging_sites", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/nearby_charging_sites")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicles/{id}/nearby_charging_sites", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the charging sites near the current location of the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
count query integer No return quantity
radius query integer No radius in miles
detail query boolean No include site detail
Click to view successful response{ "congestion_sync_time_utc_secs": 1693588513, "destination_charging": [ { "location": { "lat": 37.409314, "long": -122.123068 }, "name": "Hilton Garden Inn Palo Alto", "type": "destination", "distance_miles": 1.35024, "amenities": "restrooms,wifi,lodging" }, { "location": { "lat": 37.407771, "long": -122.120076 }, "name": "Dinah's Garden Hotel & Poolside Restaurant", "type": "destination", "distance_miles": 1.534213, "amenities": "restrooms,restaurant,wifi,cafe,lodging" } ], "superchargers": [ { "location": { "lat": 37.399071, "long": -122.111216 }, "name": "Los Altos, CA", "type": "supercharger", "distance_miles": 2.202902, "available_stalls": 12, "total_stalls": 16, "site_closed": false, "amenities": "restrooms,restaurant,wifi,cafe,shopping", "billing_info": "" }, { "location": { "lat": 37.441734, "long": -122.170202 }, "name": "Palo Alto, CA - Stanford Shopping Center", "type": "supercharger", "distance_miles": 2.339135, "available_stalls": 11, "total_stalls": 20, "site_closed": false, "amenities": "restrooms,restaurant,wifi,cafe,shopping", "billing_info": "" } ], "timestamp": 1693588576552 }

service_data

GET /api/1/vehicles/{id}/service_data

scopes: vehicle_device_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/service_data' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/service_data", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/service_data")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicles/{id}/service_data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Fetches information about the service status of the vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "service_status": "in_service", "service_etc": "2023-05-02T17:10:53-10:00", "service_visit_number": "SV12345678", "status_id": 8 }

share_invites

GET /api/1/vehicles/{vehicle_id}/invitations

scopes: vehicle_device_data, vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicles/{vehicle_id}/invitations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the active share invites for a vehicle.

Parameters

Name In Type Required Description
vehicle_id path string Yes vehicle_id
Click to view successful response[ { "id": 429509621657, "owner_id": 429511308124, "share_user_id": null, "product_id": "TEST00000000VIN01", "state": "pending", "code": "aqwl4JHU2q4aTeNROz8W9SpngoFvj-ReuDFIJs6-YOhA", "expires_at": "2023-06-29T00:42:00.000Z", "revoked_at": null, "borrowing_device_id": null, "key_id": null, "product_type": "vehicle", "share_type": "customer", "active_pubkeys": [ null ], "id_s": "429509621657", "owner_id_s": "429511308124", "share_user_id_s": "", "borrowing_key_hash": null, "vin": "TEST00000000VIN01", "share_link": "https://www.tesla.com/_rs/1/aqwl4JHU2q4aTeNROz8W9SpngoFvj-ReuDFIJs6-YOhA" } ]

share_invites create

POST /api/1/vehicles/{vehicle_id}/invitations

scopes: vehicle_cmds

curl --request POST \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{vehicle_id}/invitations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
  • Each invite link is for single-use and expires after 24 hours.
  • An account that uses the invite will gain Tesla app access to the vehicle, which allows it to do the following:
    • View the live location of the vehicle.
    • Send remote commands.
    • Download the user's Tesla profile to the vehicle.
  • To remove access, use the revoke API.
  • If a user does not have the Tesla app installed, they will be directed to this webpage for guidance.
  • A user can set up their phone as key with the Tesla app when in proximity of the vehicle.
  • The app access provides DRIVER privileges, which do not encompass all OWNER features.
  • Up to five drivers can be added at a time .
  • This API does not require the car to be online.

Parameters

Name In Type Required Description
vehicle_id path string Yes vehicle_id
Click to view successful response{ "id": 429509621657, "owner_id": 429511308124, "share_user_id": null, "product_id": "TEST00000000VIN01", "state": "pending", "code": "aqwl4JHU2q4aTeNROz8W9SpngoFvj-ReuDFIJs6-YOhA", "expires_at": "2023-06-29T00:42:00.000Z", "revoked_at": null, "borrowing_device_id": null, "key_id": null, "product_type": "vehicle", "share_type": "customer", "active_pubkeys": [ null ], "id_s": "429509621657", "owner_id_s": "429511308124", "share_user_id_s": "", "borrowing_key_hash": null, "vin": "TEST00000000VIN01", "share_link": "https://www.tesla.com/_rs/1/aqwl4JHU2q4aTeNROz8W9SpngoFvj-ReuDFIJs6-YOhA" }

share_invites revoke

POST /api/1/vehicles/{vehicle_id}/invitations/{id}/revoke

scopes: vehicle_cmds

curl --request POST \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations/{id}/revoke' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations/{id}/revoke", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_id}/invitations/{id}/revoke")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{vehicle_id}/invitations/{id}/revoke", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Revokes a share invite. This invalidates the share and makes the link invalid.

Parameters

Name In Type Required Description
vehicle_id path string Yes vehicle_id
id path string Yes id of share_invite to revoke
Click to view successful responsetrue

subscriptions

GET /api/1/subscriptions

scopes: user_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/subscriptions' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/subscriptions", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/subscriptions")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/subscriptions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the list of vehicles for which this mobile device currently subscribes to push notifications

Parameters

Name In Type Required Description
device_token query string No Either an APNS device token or a GCM registration id
device_type query string No One of 'android', 'ios-development', 'ios-enterprise', 'ios-beta', 'ios-production'

subscriptions set

POST /api/1/subscriptions

scopes: user_data

curl --request POST \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/subscriptions' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/subscriptions", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/subscriptions")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/subscriptions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Allows a mobile device to specify which vehicles to receive push notifications from. When calling from a mobile device, it is sufficient to only provide the vehicle IDs to which the mobile device wishes to subscribe to.

Parameters

Name In Type Required Description
device_token query string No Either an APNS device token or a GCM registration id
device_type query string No One of 'android', 'ios-development', 'ios-enterprise', 'ios-beta', 'ios-production'

vehicle

GET /api/1/vehicles/{id}

scopes: vehicle_device_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicles/{id}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns information about a vehicle.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "id": 100021, "vehicle_id": 99999, "vin": "TEST00000000VIN01", "color": null, "access_type": "OWNER", "display_name": "Owned", "option_codes": "TEST0,COUS", "granular_access": { "hide_private": false }, "tokens": [ "4f993c5b9e2b937b", "7a3153b1bbb48a96" ], "state": null, "in_service": false, "id_s": "100021", "calendar_enabled": true, "api_version": null, "backseat_token": null, "backseat_token_updated_at": null }

vehicle_data

GET /api/1/vehicles/{id}/vehicle_data

scopes: vehicle_device_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/vehicle_data' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/vehicle_data", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/vehicle_data")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicles/{id}/vehicle_data", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Makes a live call to the vehicle. This may return cached data if the vehicle is offline.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "id": 100021, "user_id": 800001, "vehicle_id": 99999, "vin": "TEST00000000VIN01", "color": null, "access_type": "OWNER", "granular_access": { "hide_private": false }, "tokens": [ "4f993c5b9e2b937b", "7a3153b1bbb48a96" ], "state": null, "in_service": false, "id_s": "100021", "calendar_enabled": true, "api_version": 54, "backseat_token": null, "backseat_token_updated_at": null, "charge_state": { "battery_heater_on": false, "battery_level": 42, "battery_range": 133.99, "charge_amps": 48, "charge_current_request": 48, "charge_current_request_max": 48, "charge_enable_request": true, "charge_energy_added": 48.45, "charge_limit_soc": 90, "charge_limit_soc_max": 100, "charge_limit_soc_min": 50, "charge_limit_soc_std": 90, "charge_miles_added_ideal": 202, "charge_miles_added_rated": 202, "charge_port_cold_weather_mode": false, "charge_port_color": "<invalid>", "charge_port_door_open": false, "charge_port_latch": "Engaged", "charge_rate": 0, "charger_actual_current": 0, "charger_phases": null, "charger_pilot_current": 48, "charger_power": 0, "charger_voltage": 2, "charging_state": "Disconnected", "conn_charge_cable": "<invalid>", "est_battery_range": 143.88, "fast_charger_brand": "<invalid>", "fast_charger_present": false, "fast_charger_type": "<invalid>", "ideal_battery_range": 133.99, "managed_charging_active": false, "managed_charging_start_time": null, "managed_charging_user_canceled": false, "max_range_charge_counter": 0, "minutes_to_full_charge": 0, "not_enough_power_to_heat": null, "off_peak_charging_enabled": false, "off_peak_charging_times": "all_week", "off_peak_hours_end_time": 360, "preconditioning_enabled": false, "preconditioning_times": "all_week", "scheduled_charging_mode": "Off", "scheduled_charging_pending": false, "scheduled_charging_start_time": null, "scheduled_departure_time": 1634914800, "scheduled_departure_time_minutes": 480, "supercharger_session_trip_planner": false, "time_to_full_charge": 0, "timestamp": 1692141038420, "trip_charging": false, "usable_battery_level": 42, "user_charge_enable_request": null }, "climate_state": { "allow_cabin_overheat_protection": true, "auto_seat_climate_left": false, "auto_seat_climate_right": false, "auto_steering_wheel_heat": false, "battery_heater": false, "battery_heater_no_power": null, "bioweapon_mode": false, "cabin_overheat_protection": "On", "cabin_overheat_protection_actively_cooling": true, "climate_keeper_mode": "off", "cop_activation_temperature": "High", "defrost_mode": 0, "driver_temp_setting": 21, "fan_status": 0, "hvac_auto_request": "On", "inside_temp": 38.4, "is_auto_conditioning_on": true, "is_climate_on": false, "is_front_defroster_on": false, "is_preconditioning": false, "is_rear_defroster_on": false, "left_temp_direction": -293, "max_avail_temp": 28, "min_avail_temp": 15, "outside_temp": 36.5, "passenger_temp_setting": 21, "remote_heater_control_enabled": false, "right_temp_direction": -276, "seat_heater_left": 0, "seat_heater_rear_center": 0, "seat_heater_rear_left": 0, "seat_heater_rear_right": 0, "seat_heater_right": 0, "side_mirror_heaters": false, "steering_wheel_heat_level": 0, "steering_wheel_heater": false, "supports_fan_only_cabin_overheat_protection": true, "timestamp": 1692141038419, "wiper_blade_heater": false }, "drive_state": { "active_route_latitude": 37.7765494, "active_route_longitude": -122.4195418, "active_route_traffic_minutes_delay": 0, "gps_as_of": 1692137422, "heading": 289, "latitude": 37.7765494, "longitude": -122.4195418, "native_latitude": 37.7765494, "native_location_supported": 1, "native_longitude": -122.4195418, "native_type": "wgs", "power": 1, "shift_state": null, "speed": null, "timestamp": 1692141038420 }, "gui_settings": { "gui_24_hour_time": false, "gui_charge_rate_units": "mi/hr", "gui_distance_units": "mi/hr", "gui_range_display": "Rated", "gui_temperature_units": "F", "gui_tirepressure_units": "Psi", "show_range_units": false, "timestamp": 1692141038420 }, "vehicle_config": { "aux_park_lamps": "NaPremium", "badge_version": 0, "can_accept_navigation_requests": true, "can_actuate_trunks": true, "car_special_type": "base", "car_type": "modely", "charge_port_type": "US", "cop_user_set_temp_supported": true, "dashcam_clip_save_supported": true, "default_charge_to_max": false, "driver_assist": "TeslaAP3", "ece_restrictions": false, "efficiency_package": "MY2021", "eu_vehicle": false, "exterior_color": "MidnightSilver", "exterior_trim": "Black", "exterior_trim_override": "", "has_air_suspension": false, "has_ludicrous_mode": false, "has_seat_cooling": false, "headlamp_type": "Premium", "interior_trim_type": "Black2", "key_version": 2, "motorized_charge_port": true, "paint_color_override": "19,20,22,0.8,0.04", "performance_package": "Base", "plg": true, "pws": true, "rear_drive_unit": "PM216MOSFET", "rear_seat_heaters": 1, "rear_seat_type": 0, "rhd": false, "roof_color": "RoofColorGlass", "seat_type": null, "spoiler_type": "None", "sun_roof_installed": null, "supports_qr_pairing": false, "third_row_seats": "None", "timestamp": 1692141038420, "trim_badging": "74d", "use_range_badging": true, "utc_offset": -25200, "webcam_selfie_supported": true, "webcam_supported": true, "wheel_type": "Apollo19" }, "vehicle_state": { "api_version": 54, "autopark_state_v3": "ready", "autopark_style": "dead_man", "calendar_supported": true, "car_version": "2023.7.20 7910d26d5c64", "center_display_state": 0, "dashcam_clip_save_available": false, "dashcam_state": "Unavailable", "df": 0, "dr": 0, "fd_window": 0, "feature_bitmask": "15dffbff,0", "fp_window": 0, "ft": 0, "homelink_device_count": 3, "homelink_nearby": false, "is_user_present": false, "last_autopark_error": "no_error", "locked": true, "media_info": { "a2dp_source_name": "Pixel 6", "audio_volume": 2.6667, "audio_volume_increment": 0.333333, "audio_volume_max": 10.333333, "media_playback_status": "Playing", "now_playing_album": "KQED", "now_playing_artist": "PBS Newshour on KQED FM", "now_playing_duration": 0, "now_playing_elapsed": 0, "now_playing_source": "13", "now_playing_station": "88.5 FM KQED", "now_playing_title": "PBS Newshour" }, "media_state": { "remote_control_enabled": true }, "notifications_supported": true, "odometer": 15720.074889, "parsed_calendar_supported": true, "pf": 0, "pr": 0, "rd_window": 0, "remote_start": false, "remote_start_enabled": true, "remote_start_supported": true, "rp_window": 0, "rt": 0, "santa_mode": 0, "sentry_mode": false, "sentry_mode_available": true, "service_mode": false, "service_mode_plus": false, "smart_summon_available": true, "software_update": { "download_perc": 0, "expected_duration_sec": 2700, "install_perc": 1, "status": "", "version": " " }, "speed_limit_mode": { "active": false, "current_limit_mph": 85, "max_limit_mph": 120, "min_limit_mph": 50, "pin_code_set": false }, "summon_standby_mode_enabled": false, "timestamp": 1692141038419, "tpms_hard_warning_fl": false, "tpms_hard_warning_fr": false, "tpms_hard_warning_rl": false, "tpms_hard_warning_rr": false, "tpms_last_seen_pressure_time_fl": 1692136878, "tpms_last_seen_pressure_time_fr": 1692136878, "tpms_last_seen_pressure_time_rl": 1692136878, "tpms_last_seen_pressure_time_rr": 1692136878, "tpms_pressure_fl": 3.1, "tpms_pressure_fr": 3.1, "tpms_pressure_rl": 3.15, "tpms_pressure_rr": 3, "tpms_rcp_front_value": 2.9, "tpms_rcp_rear_value": 2.9, "tpms_soft_warning_fl": false, "tpms_soft_warning_fr": false, "tpms_soft_warning_rl": false, "tpms_soft_warning_rr": false, "valet_mode": false, "valet_pin_needed": true, "vehicle_name": "grADOFIN", "vehicle_self_test_progress": 0, "vehicle_self_test_requested": false, "webcam_available": true } }

vehicle_subscriptions

GET /api/1/vehicle_subscriptions

scopes: user_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicle_subscriptions' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicle_subscriptions", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicle_subscriptions")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/vehicle_subscriptions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the list of vehicles for which this mobile device currently subscribes to push notifications.

Parameters

Name In Type Required Description
device_token query string No Either an APNS device token or a GCM registration id
device_type query string No One of 'android', 'ios-development', 'ios-enterprise', 'ios-beta', 'ios-production'
Click to view successful response[ 100021 ]

vehicle_subscriptions set

POST /api/1/vehicle_subscriptions

scopes: user_data

curl --request POST \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicle_subscriptions' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicle_subscriptions", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicle_subscriptions")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicle_subscriptions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Allows a mobile device to specify which vehicles to receive push notifications from. It is sufficient to only provide the vehicle IDs to which a mobile device wishes to subscribe to.

Parameters

Name In Type Required Description
device_token query string No Either an APNS device token or a GCM registration id
device_type query string No One of 'android', 'ios-development', 'ios-enterprise', 'ios-beta', 'ios-production'
Click to view successful response[]

wake_up

POST /api/1/vehicles/{id}/wake_up

scopes: vehicle_device_data

curl --request POST \
  --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/wake_up' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'POST',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/wake_up", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{id}/wake_up")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{id}/wake_up", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Wakes the vehicle from sleep, which is a state to minimize idle energy consumption.

Parameters

Name In Type Required Description
id path integer Yes vehicle id
Click to view successful response{ "id": 100021, "user_id": 800001, "vehicle_id": 99999, "vin": "TEST00000000VIN01", "color": null, "access_type": "OWNER", "granular_access": { "hide_private": false }, "tokens": [ "4f993c5b9e2b937b", "7a3153b1bbb48a96" ], "state": null, "in_service": false, "id_s": "100021", "calendar_enabled": true, "api_version": null, "backseat_token": null, "backseat_token_updated_at": null }

warranty_details

GET /api/1/dx/warranty/details

scopes: vehicle_device_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/warranty/details' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const requestOptions = {
   method: 'GET',
   headers: myHeaders,
   redirect: 'follow'
};

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/warranty/details", requestOptions)
   .then(response => response.json())
   .then(result => console.log(result))
   .catch(error => console.log('error', error));
require "uri"
require "json"
require "net/http"

url = URI("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/dx/warranty/details")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer ENV_TESLA_API_TOKEN"

response = https.request(request)
puts response.read_body

import os
import http.client
import json

conn = http.client.HTTPSConnection("fleet-api.prd.na.vn.cloud.tesla.com")
payload = ''
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("GET", "/api/1/dx/warranty/details", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the warranty information for a vehicle.

Parameters

Name In Type Required Description
vin query string No Vehicle vin
Click to view successful response{ "activeWarranty": [ { "warrantyType": "NEW_MFG_WARRANTY", "warrantyDisplayName": "Basic Vehicle Limited Warranty", "expirationDate": "2025-10-21T00:00:00Z", "expirationOdometer": 50000, "odometerUnit": "MI", "warrantyExpiredOn": null, "coverageAgeInYears": 4 }, { "warrantyType": "BATTERY_WARRANTY", "warrantyDisplayName": "Battery Limited Warranty", "expirationDate": "2029-10-21T00:00:00Z", "expirationOdometer": 120000, "odometerUnit": "MI", "warrantyExpiredOn": null, "coverageAgeInYears": 8 }, { "warrantyType": "DRIVEUNIT_WARRANTY", "warrantyDisplayName": "Drive Unit Limited Warranty", "expirationDate": "2029-10-21T00:00:00Z", "expirationOdometer": 120000, "odometerUnit": "MI", "warrantyExpiredOn": null, "coverageAgeInYears": 8 } ], "upcomingWarranty": [], "expiredWarranty": [] }

FAQ

Why do some calls return a 429?

This means the account has reached the request rate limit for the endpoint. Check the 'Retry-After' request header (in seconds) to determine when to make the next request. See more information on response codes.

Why do some calls to vehicles return a 408?

This tends to mean the device is offline. Does the device have internet connectivity? If so, is it asleep (saving energy) in which case might need to wake it up ?

What does it mean when I get an Unauthorized missing scopes 403 error?

The token that is being provided does not have the required scopes for the current resource. Look at the scopes requirements for the endpoint and ensure the token has those scopes. If the token is not created with the required scopes, it means the owner needs to explicity grant the required scope(s) as part of the authorization flow.

Fleet Telemetry

For high data fidelity use cases as well as general efficiency, vehicles can stream directly to your server. See account tier information at https://developer.tesla.com, and the setup steps on the open-source server: https://github.com/teslamotors/fleet-telemetry.

As part of the discovery offering, developers can get limited Fleet Telemetry access to stream up to 10 fields per minute. See compatibility requirements here.

Announcements & API Changelog

2023-10-09: Rest API vehicle commands endpoint - deprecation warning

Following the release of Tesla Vehicle Command SDK support for REST API vehicle command endpoints is now reaching end of life. Starting 2024 most vehicles will require sending commands via Tesla Vehicle Command SDK.

The use of Tesla http proxy is recommended for ease of development and to accelerate the transition to Tesla Vehicle Command (via SDK). When applicable, the proxy will transform Rest API HTTP commands into signed commands. Once configured, developers can simply point their application to the proxy without making any code changes to their application.

2023-10-09: Tesla Vehicle Command SDK

Tesla Vehicle Command SDK provides end-to-end authentication for sending commands to vehicles. This is the recommended way of sending commands to vehicles.

Security experts are encouraged to dive more into the protocol and give feedback on Github. To report a security issue, follow the directions on https://www.tesla.com/legal/security.

Help and Support

Email fleetapisupport@tesla.com for developer support. Please include a description of your use case, and any example logs or curl statements, and include server responses.

Please make sure NOT to share any API token, OauthToken, or any credentials via email. Tesla does not need passwords or tokens to help diagnose a potential issue.