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.
    • In the "Client Details" step, it is recommended to select "Authorization Code and Machine-to-Machine" for most use cases. "Machine-to-Machine" (M2M) should only be selected for business accounts that own vehicles.
    • Note that account creation requests can be automatically rejected for these common reasons:
      • Domain name is invalid
      • Application name already exists
  2. Complete registration of an account:
    1. Generate a public/private key pair for Tesla Vehicle Commands. Host a public key in the /.well-known section of the application website. This public key must remain available at the /.well-known path for vehicles to be paired with the application. See details here.
    2. Generate a partner authentication token.
    3. Make a POST call to /api/1/partner_accounts with a partner authentication token.
  3. Request authorization permissions from a customer and generate a third-party token on their behalf. See the authentication section for examples.
  4. To interact with vehicles, send customers a pairing request, and then use the Tesla Vehicle Command Protocol http proxy to send commands.

Refer to the help section if facing any problems with registration flows or the API.

Endpoints and Regional requirements

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

API Best Practices

Avoid DNS caching

Fleet API high availability is guarenteed by dynamic IPs; addresses behind the DNS can change abruptly during regular operation. Excessive DNS TTL/caching can lead to stale DNS information. This can cause connection issues and errors.

The recommendation is to avoid altering the DNS TTL setting (use the default) to ensure that the DNS resolver is configured to follow the TTL values provided by the authoritative DNS servers.

Avoid frequently polling device data

Fleet API allows developers to get data from devices via API, these are meant to be used infrequently. The majority of these APIs have stringent rate limits in place for protection. To get data at regular interval use Fleet Telemetry which provides a direct and custom data stream in real time.

Ensure authorization tokens are not expired before making API calls

FleetAPI bearer token used for authorization are simple JWT tokens. Before calling the API, renew tokens if they are within a minute of expiration. Securely caching tokens is a viable option for distributed applications.

Respect local privacy laws and data governance

Fleet API is localized in multiple regions in accordance with local regulation (CCPA, GDPR, PIPL, etc.). The API may return some errors to guide developers, but it is the developers responsibility to comply with security, data privacy, data transfer, and data governance regulations.

Secure private keys and secrets at all time

Follow best security practices when manipulating private keys and secrets. Modern cloud providers offer key management services (such as AWS Key Management Service, Azure Key Vault, and Google Cloud Key Management Service) or hardware security module (HSM) solutions to create and manage private keys & secrets securely. It is important to not extract or transmit private keys over the network, particularly if they are not encrypted.

Validate Vehicle state after timeout errors

Timeouts can happen before or after a command is sent and executed in a vehicle, making it difficult to determine the vehicle's state when a timeout occurs. It is the developer's responsibility to ensure the vehicle is in the desired state. Most FleetAPI commands are stateful and can be safely retried, but some commands (such as honk_horn and media_next_track) may result in duplicated actions. Therefore, developers should exercise caution when retrying these commands to avoid unintended consequences.

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.
Energy Device data limits 100k API requests / day.
Energy Settings limits 5 requests / energy site / day.
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 {vehicle_tag} 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
• invalid_command - The data request or command is unknown.
• invalid_field - A field in the input is not valid.
• invalid_request - The request body is not valid, a description giving a more specific error message may be returned.
• invalid_auth_code - The "code" in request body is invalid, generate a new one and try again.
• invalid_redirect_url - Invalid redirect URI/URL. The authorize redirect URI and token redirect URI must match.
• unauthorized_client - We don't recognize this client_id and client_secret combination. Use the client_id and client_secret that has been granted for the application.
401 Unauthorized
• mobile_access_disabled - The vehicle has turned off remote access.
• no response body - The OAuth token has expired.
• login_required - The user has reset their password and a new auth code is required, or the refresh_token has already been used.
402 Payment Required Payment is required in order to use the API (non-free account only)
403 Forbidden
• Access to this resource is not authorized, developers should check required scopes.
Tesla Vehicle Command Protocol required in order to interact with the devices.
404 Not Found The requested resource does not exist.
405 Not Allowed The operation is not allowed.
406 Not Acceptable The HTTP request does not have a Content-Type header 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 - first call the partner account register endpoint.
418 Client Too Old (Not supported) Mobile application needs to be updated (Tesla App only).
421 Incorrect region This user is not present in the current region. See the regional requirements section for more information.
422 Invalid Resource There is a semantic problem with the data, e.g. missing or invalid data.
• Vehicle does not yet support the Tesla Vehicle Command Protocol.
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.

All usage of Fleet API must be in compliance with the Fleet API Agreement. Accounts found in violation will be banned without notice.

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 account 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.

The OAuth server's metadata file can be found at: https://auth.tesla.com/oauth2/v3/thirdparty/.well-known/openid-configuration.

A Postman collection with these requests can be found here.

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.

Parameters

Name Required Example Description
grant_type Yes client_credentials Grant type must be client_credentials.
client_id Yes abc-123 Partner application client ID.
client_secret Yes secret-password Partner application client secret.
audience Yes https://fleet-api.prd.na.vn.cloud.tesla.com Audience for the generated token.
scope No openid user_data vehicle_device_data vehicle_cmds vehicle_charging_cmds Space-delimited list of scopes.
CLIENT_ID=<command to obtain a client_id>
CLIENT_SECRET=<secure command to obtain a client_secret>
AUDIENCE="https://fleet-api.prd.na.vn.cloud.tesla.com"
# Partner authentication token request
curl --request POST \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'grant_type=client_credentials' \
  --data-urlencode "client_id=$CLIENT_ID" \
  --data-urlencode "client_secret=$CLIENT_SECRET" \
  --data-urlencode 'scope=openid vehicle_device_data vehicle_cmds vehicle_charging_cmds' \
  --data-urlencode "audience=$AUDIENCE" \
  'https://auth.tesla.com/oauth2/v3/token'

Third-party token

Use the authorization_code grant flow to generate a token on behalf of a customer. This allows 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 application client ID.
redirect_uri Yes https://example.com/auth/callback Partner application callback url, spec: rfc6749.
scope Yes openid offline_access user_data vehicle_device_data vehicle_cmds vehicle_charging_cmds Space delimited list of scopes, include openid and offline_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. An invalid_auth_code response likely means the code is expired.

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 must be authorization_code.
client_id Yes abc-123 Partner application client ID.
client_secret Yes secret-password Partner application client secret.
code Yes a90869e9d... Code from authorize request callback.
audience Yes https://fleet-api.prd.na.vn.cloud.tesla.com Audience for generated token.
redirect_uri Yes https://example.com/auth/callback Partner application callback url, spec: rfc6749.
scope No openid offline_access user_data vehicle_device_data vehicle_cmds vehicle_charging_cmds Space-delimited list of scopes.

4. Use the refresh_token to generate new tokens and obtain refresh tokens. There are two common failure modes for using a refresh_token that will return a 401 - login_required response: 1. The refresh token has already been used; only the newest refresh token is valid. 2. The user has reset their password.

# 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'

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

Parameters

Name Required Example Description
grant_type Yes refresh_token Grant type must be refresh_token.
client_id Yes abc-123 Partner application client ID.
refresh_token Yes NA_a90869e9d... Refresh token from the code exchange response.

5. Once a user has granted scopes to an application, they can modify scopes or revoke access using the consent management page:

https://auth.tesla.com/user/revoke/consent?revoke_client_id=$CLIENT_ID&back_url=$RETURN_URL

https://auth.tesla.com/user/revoke/consent?revoke_client_id=cb30fbdf81e9-4405-ba59-ddbc042277e8&back_url=https://accounts.tesla.com/account-settings/security?tab=tpty-apps

Scope modifications are compatible with existing refresh tokens and will be applied to new access tokens.



Authorization Scopes

Name Scope Description
Sign in with Tesla openid Allow Tesla customers to sign in to the application with their Tesla credentials.
Refresh Tokens offline_access Allow getting a refresh token without needing user to log in again.
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 live status, site info, backup history, energy history, and charge history.
Energy Product Settings energy_cmds Update settings like backup reserve percent, operation mode, and storm mode.

To view a list of endpoints available by scope, see scopes.json.



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 Vehicle Identification Number (VIN) of the selected vehicle.
startTime query string No Start time of the windows to download charging history for (i,e "2023-07-27T11:43:45-07:00").
endTime query string No End time of the windows to download charging history for (i,e "2023-07-28T11:43:45-07:00").
pageNo query integer No Current page number.
pageSize query integer No Number of records per page.
sortBy query string No Field to sort by.
sortOrder query string No Sort order (ASC or DESC).
Click to view successful response{ "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_invoice

GET /api/1/dx/charging/invoice/{id}

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/invoice/{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/dx/charging/invoice/{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/dx/charging/invoice/{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/dx/charging/invoice/{id}", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns a charging invoice pdf for an event from charging history.

Parameters

Name In Type Required Description
id path string Yes Content ID. This can be obtained from the invoices.contentId of a charging history event.
Click to view successful response{ "response": "raw .pdf document" }

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 Vehicle Identification Number (VIN) of the selected vehicle.
date_from query string No Start date of the windows to download charging sessions.
date_to query string No End date of the windows to download charging sessions.
limit query integer No Number of entities to be returned.
offset query integer No offset.
Click to view successful response{ "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" } } }

Energy Endpoints

backup

POST /api/1/energy_sites/{energy_site_id}/backup

scopes: energy_cmds

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

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

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/energy_sites/{energy_site_id}/backup", 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/energy_sites/{energy_site_id}/backup")

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({
   "backup_reserve_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({
   "backup_reserve_percent": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/energy_sites/{energy_site_id}/backup", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Adjust the site's backup reserve.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
backup_reserve_percent body integer Yes The desired backup reserve percent.
Click to view successful response{ "response": { "response": { "code": 201, "message": "Updated" } } }

backup_history

GET /api/1/energy_sites/{energy_site_id}/calendar_history?kind=backup&

scopes: energy_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/energy_sites/{energy_site_id}/calendar_history?kind={kind}&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}' 
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/energy_sites/{energy_site_id}/calendar_history?kind={kind}&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}", 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/energy_sites/{energy_site_id}/calendar_history?kind={kind}&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}")

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/energy_sites/{energy_site_id}/calendar_history?kind=%7Bkind%7D&start_date=%7Bstart_date%7D&end_date=%7Bend_date%7D&period=%7Bperiod%7D&time_zone=%7Btime_zone%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the backup (off-grid) event history of the site in duration of seconds.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
kind query string Yes The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
start_date query string Yes Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
end_date query string Yes End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
period query string Yes Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
time_zone query string Yes Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
Click to view successful response{ "response": { "response": { "events": [ { "timestamp": "2023-01-01T01:00:00-08:00", "duration": 3600 }, { "timestamp": "2023-01-02T08:00:00-08:00", "duration": 7200 } ], "total_events": 2 } } }

charge_history

GET /api/1/energy_sites/{energy_site_id}/telemetry_history?kind=charge&

scopes: energy_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/energy_sites/{energy_site_id}/telemetry_history?kind={kind}&start_date={start_date}&end_date={end_date}&time_zone={time_zone}' 
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/energy_sites/{energy_site_id}/telemetry_history?kind={kind}&start_date={start_date}&end_date={end_date}&time_zone={time_zone}", 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/energy_sites/{energy_site_id}/telemetry_history?kind={kind}&start_date={start_date}&end_date={end_date}&time_zone={time_zone}")

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/energy_sites/{energy_site_id}/telemetry_history?kind=%7Bkind%7D&start_date=%7Bstart_date%7D&end_date=%7Bend_date%7D&time_zone=%7Btime_zone%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the charging history of a wall connector.

  • Energy values are in watt hours.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
kind query string Yes The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
start_date query string Yes Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
end_date query string Yes End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
time_zone query string Yes Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
Click to view successful response{ "response": { "response": { "charge_history": [ { "charge_start_time": { "seconds": 1672560000 }, "charge_duration": { "seconds": 12000 }, "energy_added_wh": 25000 } ] } } }

energy_history

GET /api/1/energy_sites/{energy_site_id}/calendar_history?kind=energy&

scopes: energy_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/energy_sites/{energy_site_id}/calendar_history?kind={kind}&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}' 
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/energy_sites/{energy_site_id}/calendar_history?kind={kind}&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}", 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/energy_sites/{energy_site_id}/calendar_history?kind={kind}&start_date={start_date}&end_date={end_date}&period={period}&time_zone={time_zone}")

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/energy_sites/{energy_site_id}/calendar_history?kind=%7Bkind%7D&start_date=%7Bstart_date%7D&end_date=%7Bend_date%7D&period=%7Bperiod%7D&time_zone=%7Btime_zone%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the energy measurements of the site, aggregated to the requested period.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
kind query string Yes The kind of history to be requested. 'backup', 'charge', 'energy' are all supported.
start_date query string Yes Start date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
end_date query string Yes End date of the window to retrieve backup events in RFC3339 format. i.e. 2023-01-01T00:00:00-08:00
period query string Yes Period of the window to retrieve backup events. This can be day, week, month, year, lifetime and should align with the window requested.
time_zone query string Yes Timezone of the requested window in IANA name format. i.e. 'America/Los_Angeles'
Click to view successful response{ "response": { "response": { "period": "day", "time_series": [ { "timestamp": "2023-06-01T01:00:00-07:00", "solar_energy_exported": 70940, "generator_energy_exported": 0, "grid_energy_imported": 521, "grid_services_energy_imported": 17.53125, "grid_services_energy_exported": 3.80859375, "grid_energy_exported_from_solar": 43660, "grid_energy_exported_from_generator": 0, "grid_energy_exported_from_battery": 19, "battery_energy_exported": 10030, "battery_energy_imported_from_grid": 80, "battery_energy_imported_from_solar": 16800, "battery_energy_imported_from_generator": 0, "consumer_energy_imported_from_grid": 441, "consumer_energy_imported_from_solar": 10480, "consumer_energy_imported_from_battery": 10011, "consumer_energy_imported_from_generator": 0 } ] } } }

grid_import_export

POST /api/1/energy_sites/{energy_site_id}/grid_import_export

scopes: energy_cmds

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

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

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/energy_sites/{energy_site_id}/grid_import_export", 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/energy_sites/{energy_site_id}/grid_import_export")

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({
   "disallow_charge_from_grid_with_solar_installed": "boolean",
   "customer_preferred_export_rule": "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({
   "disallow_charge_from_grid_with_solar_installed": "boolean",
   "customer_preferred_export_rule": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/energy_sites/{energy_site_id}/grid_import_export", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Allow/disallow charging from the grid and exporting energy to the grid.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
disallow_charge_from_grid_with_solar_installed body boolean No The desired behavior towards importing from the grid. Charging from the grid is disabled when set to true and enabled when set to false.
customer_preferred_export_rule body string No The desired behavior for grid exporting. The available options are battery_ok, pv_only, and never.
Click to view successful response{ "response": { "response": { "code": 204, "message": "Updated" } } }

live_status

GET /api/1/energy_sites/{energy_site_id}/live_status

scopes: energy_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/energy_sites/{energy_site_id}/live_status' 
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/energy_sites/{energy_site_id}/live_status", 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/energy_sites/{energy_site_id}/live_status")

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/energy_sites/{energy_site_id}/live_status", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns the live status of the site (power, state of energy, grid status, storm mode).

  • Power values are in watts.
  • Energy values are in watt hours.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
Click to view successful response{ "response": { "response": { "solar_power": 3102, "energy_left": 18020.894736842107, "total_pack_energy": 39343, "percentage_charged": 45.80457701965307, "backup_capable": true, "battery_power": -3090, "load_power": 2581, "grid_status": "Active", "grid_power": 2569, "island_status": "on_grid", "storm_mode_active": false, "timestamp": "2023-01-01T00:00:00-08:00" } } }

off_grid_vehicle_charging_reserve

POST /api/1/energy_sites/{energy_site_id}/off_grid_vehicle_charging_reserve

scopes: energy_cmds

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

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

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/energy_sites/{energy_site_id}/off_grid_vehicle_charging_reserve", 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/energy_sites/{energy_site_id}/off_grid_vehicle_charging_reserve")

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({
   "off_grid_vehicle_charging_reserve_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({
   "off_grid_vehicle_charging_reserve_percent": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/energy_sites/{energy_site_id}/off_grid_vehicle_charging_reserve", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Adjust the site's off-grid vehicle charging backup reserve.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
off_grid_vehicle_charging_reserve_percent body integer Yes The desired off grid vehicle charging reserve percent.
Click to view successful response{ "response": { "response": { "code": 201, "message": "Updated" } } }

operation

POST /api/1/energy_sites/{energy_site_id}/operation

scopes: energy_cmds

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

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

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/energy_sites/{energy_site_id}/operation", 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/energy_sites/{energy_site_id}/operation")

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({
   "default_real_mode": "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({
   "default_real_mode": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/energy_sites/{energy_site_id}/operation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Set the site's mode.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
default_real_mode body string Yes The desired operation mode. Use autonomous for time-based control and self_consumption for self-powered mode.
Click to view successful response{ "response": { "response": { "code": 201, "message": "Updated" } } }

products

GET /api/1/products

scopes: One of - vehicle_device_data, energy_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/products' 
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/products", 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/products")

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/products", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns products mapped to user.

Click to view successful response{ "response": [ { "id": 100021, "user_id": 429511308124, "vehicle_id": 99999, "vin": "5YJ3000000NEXUS01", "color": null, "access_type": "OWNER", "display_name": "Owned", "option_codes": "TEST0,COUS", "cached_data": null, "granular_access": { "hide_private": false }, "tokens": [ "4f993c5b9e2b937b", "7a3153b1bbb48a96" ], "state": null, "in_service": false, "id_s": "100021", "calendar_enabled": false, "api_version": null, "backseat_token": null, "backseat_token_updated_at": null, "command_signing": "off" }, { "energy_site_id": 429124, "resource_type": "battery", "site_name": "My Home", "id": "STE12345678-12345", "gateway_id": "1112345-00-E--TG0123456789", "energy_left": 35425, "total_pack_energy": 39362, "percentage_charged": 90, "battery_power": 1000 } ], "count": 2 }

site_info

GET /api/1/energy_sites/{energy_site_id}/site_info

scopes: energy_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/energy_sites/{energy_site_id}/site_info' 
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/energy_sites/{energy_site_id}/site_info", 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/energy_sites/{energy_site_id}/site_info")

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/energy_sites/{energy_site_id}/site_info", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns information about the site. Things like assets (has solar, etc), settings (backup reserve, etc), and features (storm_mode_capable, etc).

  • Power values are in watts.
  • Energy values are in watt hours.
  • default_real_mode can be autonomous for time-based control and self_consumption for self-powered mode.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
Click to view successful response{ "response": { "response": { "id": "0000000-00-A--TEST0000000DIN", "site_name": "My Home", "backup_reserve_percent": 20, "default_real_mode": "autonomous", "installation_date": "2023-01-01T00:00:00-08:00", "user_settings": { "storm_mode_enabled": true }, "components": { "solar": true, "solar_type": "pv_panel", "battery": true, "grid": true, "backup": true, "load_meter": true, "storm_mode_capable": true, "off_grid_vehicle_charging_reserve_supported": true, "solar_value_enabled": true, "set_islanding_mode_enabled": true, "battery_type": "ac_powerwall", "configurable": true }, "version": "23.12.11 452c76cb", "battery_count": 3, "nameplate_power": 15000, "nameplate_energy": 40500, "installation_time_zone": "America/Los_Angeles", "max_site_meter_power_ac": 1000000000, "min_site_meter_power_ac": -11.726 } } }

storm_mode

POST /api/1/energy_sites/{energy_site_id}/storm_mode

scopes: energy_cmds

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

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

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/energy_sites/{energy_site_id}/storm_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/energy_sites/{energy_site_id}/storm_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({
   "enabled": "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({
   "enabled": "boolean"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/energy_sites/{energy_site_id}/storm_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Update storm watch participation.

Parameters

Name In Type Required Description
energy_site_id path integer Yes ID field of an energy site from /api/1/products endpoint.
enabled body boolean Yes The storm mode participation value to set.
Click to view successful response{ "response": { "response": { "code": 201, "message": "Updated" } } }

Partner Endpoints

fleet_telemetry_errors

GET /api/1/partner_accounts/fleet_telemetry_errors

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/partner_accounts/fleet_telemetry_errors' 
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/fleet_telemetry_errors", 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/fleet_telemetry_errors")

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/fleet_telemetry_errors", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns recent fleet telemetry errors reported by vehicles after receiving the config.

This endpoint requires a partner authentication token.

Click to view successful response{ "response": { "fleet_telemetry_errors": [ { "name": "client-id", "error": "msg", "vin": "vin" }, { "name": "client-id", "error": "msg2", "vin": "vin" } ] } }

public_key

GET /api/1/partner_accounts/public_key

scopes: One of - 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/partner_accounts/public_key?domain={domain}' 
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?domain={domain}", 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?domain={domain}")

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?domain=%7Bdomain%7D", 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.

This endpoint requires a partner authentication token.

Parameters

Name In Type Required Description
domain query string Yes Partner domain used to validate registration flow.
Click to view successful response{ "response": { "public_key": "0437d832a7a695151f5a671780a276aa4cf2d6be3b2786465397612a342fcf418e98022d3cedf4e9a6f4b3b160472dee4ca022383d9b4cc4001a0f3023caec58fa" } }

register

POST /api/1/partner_accounts

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{
    "domain": "string",
    "csr": "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",
   "csr": "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",
   "csr": "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",
   "csr": "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 and remain hosted at https://<app 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.

This endpoint requires a partner authentication token.

Parameters

Name In Type Required Description
domain body string Yes The application domain. A PEM-encoded EC public key must be hosted at https://<app domain>/.well-known/appspecific/com.tesla.3p.public-key.pem. Domains must be lowercase and have the same root as a domain from the application's allowed_origins on developer.tesla.com.
csr body string No A certificate signing request to be configured for your account. Once uploaded, it may take up to one week to be fully processed.
Click to view successful response{ "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", "account_id": "account-id", "issuer": null, "csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIHZMIGBAgEAMB8xHTAbBgNVBAMMFHRoZS1iZXN0LXBhcnRuZXIuY29tMFkwEwYH\nKoZIzj0CAQYIKoZIzj0DAQcDQgAEN9gyp6aVFR9aZxeAonaqTPLWvjsnhkZTl2Eq\nNC/PQY6YAi087fTppvSzsWBHLe5MoCI4PZtMxAAaDzAjyuxY+qAAMAoGCCqGSM49\nBAMCA0cAMEQCIE7LtTJO/Vrbr97cMz+FyjmzJ5FA+Xck55/QOnPq9AsOAiB77g0W\noEFqpvbpUQ1Y7biEoPa1gT0/nvoB31suLABmMg==\n-----END CERTIFICATE REQUEST-----\n", "csr_updated_at": "2023-06-28T00:42:00.000Z", "public_key": "0437d832a7a695151f5a671780a276aa4cf2d6be3b2786465397612a342fcf418e98022d3cedf4e9a6f4b3b160472dee4ca022383d9b4cc4001a0f3023caec58fa" } }

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.

Click to view successful response{ "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.

Click to view successful response{ "response": { "signaling": { "enabled": true, "subscribe_connectivity": false, "use_auth_token": 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.

Click to view successful response{ "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", "vault_uuid": "b5c443af-a286-49eb-a4ad-35a97963155d" } }

orders

GET /api/1/users/orders

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/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.

Click to view successful response{ "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 } ], "count": 1 }

region

GET /api/1/users/region

scopes: One of - vehicle_device_data, vehicle_cmds, energy_cmds, energy_device_data, 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.

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

Vehicle Commands

actuate_trunk

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/actuate_trunk", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
which_trunk body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

adjust_volume

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

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{
    "volume": "number"
  }' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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": "number"
});

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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": "number"
})

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": "number"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{vehicle_tag}/command/adjust_volume", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Adjusts vehicle media playback volume.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
volume body number Yes A floating point number from 0.0 to 11.0.
Click to view successful response{ "response": { "result": true, "reason": "" } }

auto_conditioning_start

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/auto_conditioning_start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Starts climate preconditioning.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

auto_conditioning_stop

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/auto_conditioning_stop", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Stops climate preconditioning.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

cancel_software_update

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/cancel_software_update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

charge_max_range

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/charge_max_range", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

charge_port_door_close

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/charge_port_door_close", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Closes the charge port door.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

charge_port_door_open

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/charge_port_door_open", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Opens the charge port door.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

charge_standard

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/charge_standard", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Charges in Standard mode.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

charge_start

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/charge_start", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Starts charging the vehicle.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

charge_stop

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/charge_stop", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Stops charging the vehicle.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

clear_pin_to_drive_admin

POST /api/1/vehicles/{vehicle_tag}/command/clear_pin_to_drive_admin

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/{vehicle_tag}/command/clear_pin_to_drive_admin' 
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/{vehicle_tag}/command/clear_pin_to_drive_admin", 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_tag}/command/clear_pin_to_drive_admin")

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/{vehicle_tag}/command/clear_pin_to_drive_admin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Deactivates PIN to Drive and resets the associated PIN for vehicles running firmware versions 2023.44+. This command is only accessible to fleet managers or owners.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

door_lock

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/door_lock", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Locks the vehicle.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

door_unlock

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/door_unlock", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Unlocks the vehicle.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

erase_user_data

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

flash_lights

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/flash_lights", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

guest_mode

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/guest_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

  • 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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
enable body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

honk_horn

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/honk_horn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

media_next_fav

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

media_next_track

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

media_prev_fav

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

media_prev_track

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

media_toggle_playback

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

media_volume_down

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

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

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{
    "lat": "number",
    "lon": "number",
    "order": "integer"
  }' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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": "number",
   "lon": "number",
   "order": "integer"
});

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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": "number",
   "lon": "number",
   "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": "number",
   "lon": "number",
   "order": "integer"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
lat body number Yes
lon body number Yes
order body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

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

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{
    "type": "string",
    "locale": "string",
    "timestamp_ms": "string"
  }' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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",
   "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/{vehicle_tag}/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/{vehicle_tag}/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",
   "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",
   "locale": "string",
   "timestamp_ms": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
type body string Yes
value body Unknown Yes
locale body string Yes
timestamp_ms body string Yes
Click to view successful response{ "response": { "result": true, "queued": true } }

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
id body integer Yes
order body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_auto_seat_climate_request

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/remote_auto_seat_climate_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets automatic seat heating and cooling.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
auto_seat_position body integer Yes
auto_climate_on body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_auto_steering_wheel_heat_climate_request

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_boombox

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/remote_boombox", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Plays a sound through the vehicle external speaker.

Sound IDs:

  • 0: random fart

  • 2000: locate ping

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
sound body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_seat_cooler_request

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/remote_seat_cooler_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets seat cooling.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
seat_position body integer Yes
seat_cooler_level body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_seat_heater_request

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/remote_seat_heater_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets seat heating.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_start_drive

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/remote_start_drive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_steering_wheel_heat_level_request

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/remote_steering_wheel_heat_level_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets steering wheel heat level.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
level body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

remote_steering_wheel_heater_request

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/remote_steering_wheel_heater_request", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

reset_pin_to_drive_pin

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/reset_pin_to_drive_pin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Removes PIN to Drive. Requires the car to be in Pin to Drive mode and not in Valet mode. Note that this only works if PIN to Drive is not active. This command also requires the Tesla Vehicle Command Protocol - for more information, please see refer to the documentation here.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

reset_valet_pin

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/reset_valet_pin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Removes PIN for Valet Mode. To use this command, valet mode must be disabled. See set_valet_mode.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

schedule_software_update

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/schedule_software_update", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
offset_sec body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_bioweapon_mode

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_bioweapon_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Turns Bioweapon Defense Mode on and off.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
manual_override body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_cabin_overheat_protection

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_cabin_overheat_protection", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets the vehicle overheat protection.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
fan_only body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_charge_limit

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_charge_limit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets the vehicle charge limit.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
percent body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_charging_amps

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_charging_amps", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets the vehicle charging amps.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
charging_amps body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_climate_keeper_mode

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_climate_keeper_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Enables climate keeper mode. Accepted values are: 0,1,2,3. Mapping to respectively Off, Keep Mode, Dog Mode, Camp Mode.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
climate_keeper_mode body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_cop_temp

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_cop_temp", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Adjusts the Cabin Overheat Protection temperature (COP). This command will not activate COP. The precise target temperature depends on if the user has selected C or F. Accepted values are: 0,1,2. Mapping to respectively Low (90F/30C), Medium (95F/35C), High (100F/40C).

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
cop_temp body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_pin_to_drive

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_pin_to_drive", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets a four-digit passcode for PIN to Drive. This PIN must then be entered before the vehicle can be driven. Once a PIN is set, the vehicle remembers its value even when PIN to Drive is disabled and it will discard any new PIN provided using this method. To change an existing PIN, first call reset_pin_to_drive_pin. This command also requires the Tesla Vehicle Command Protocol - for more information, please see refer to the documentation here.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
password body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_preconditioning_max

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_preconditioning_max", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
manual_override body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_scheduled_charging

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_scheduled_charging", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets a time at which charging should be completed. The time parameter is minutes after midnight (e.g: time=120 schedules charging for 2:00am vehicle local time).

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
enable body boolean Yes
time body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_scheduled_departure

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

scopes: One of - vehicle_cmds, vehicle_charging_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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_scheduled_departure", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Sets a time at which departure should be completed. The time parameter is minutes after midnight (e.g: time=120 schedules departure for 2:00am vehicle local time).

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
enable body boolean Yes
time body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_sentry_mode

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_sentry_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_temps

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_temps", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
driver_temp body integer Yes
passenger_temp body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_valet_mode

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_valet_mode", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
on body boolean Yes
password body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

set_vehicle_name

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/set_vehicle_name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Changes the name of a vehicle. This command also requires the Tesla Vehicle Command Protocol - for more information, please see refer to the documentation here.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
vehicle_name body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

speed_limit_activate

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/speed_limit_activate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Activates Speed Limit Mode with a four-digit PIN.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
pin body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

speed_limit_clear_pin

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/speed_limit_clear_pin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Deactivates Speed Limit Mode and resets the associated PIN.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
pin body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

speed_limit_clear_pin_admin

POST /api/1/vehicles/{vehicle_tag}/command/speed_limit_clear_pin_admin

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/{vehicle_tag}/command/speed_limit_clear_pin_admin' 
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/{vehicle_tag}/command/speed_limit_clear_pin_admin", 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_tag}/command/speed_limit_clear_pin_admin")

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/{vehicle_tag}/command/speed_limit_clear_pin_admin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Deactivates Speed Limit Mode and resets the associated PIN for vehicles running firmware versions 2023.38+. This command is only accessible to fleet managers or owners.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "result": true, "reason": "" } }

speed_limit_deactivate

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/speed_limit_deactivate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

Deactivates Speed Limit Mode.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
pin body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

speed_limit_set_limit

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/speed_limit_set_limit", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
limit_mph body integer Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

sun_roof_control

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/command/sun_roof_control", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Control the sunroof on sunroof-enabled vehicles.

Supported states: stop, close, and vent.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
state body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

take_drivenote

POST /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
note body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

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

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{
    "lat": "number",
    "lon": "number",
    "token": "string"
  }' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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": "number",
   "lon": "number",
   "token": "string"
});

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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": "number",
   "lon": "number",
   "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": "number",
   "lon": "number",
   "token": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{vehicle_tag}/command/trigger_homelink", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

⚠️ Newest vehicles require Tesla Vehicle Command protocol (see details). ⚠️

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

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
lat body number Yes
lon body number Yes
token body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

upcoming_calendar_entries

POST /api/1/vehicles/{vehicle_tag}/command/upcoming_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/{vehicle_tag}/command/upcoming_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/{vehicle_tag}/command/upcoming_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/{vehicle_tag}/command/upcoming_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/{vehicle_tag}/command/upcoming_calendar_entries", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Upcoming calendar entries stored on the vehicle.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
calendar_data body string Yes
Click to view successful response{ "response": { "reason": "", "result": true } }

window_control

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

scopes: vehicle_cmds

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{
    "lat": "number",
    "lon": "number",
    "command": "string"
  }' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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": "number",
   "lon": "number",
   "command": "string"
});

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/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": "number",
   "lon": "number",
   "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": "number",
   "lon": "number",
   "command": "string"
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/{vehicle_tag}/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
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
lat body number Yes
lon body number Yes
command body string Yes
Click to view successful response{ "response": { "result": true, "reason": "" } }

Vehicle Endpoints

drivers

GET /api/1/vehicles/{vehicle_tag}/drivers

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/{vehicle_tag}/drivers' 
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_tag}/drivers", 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_tag}/drivers")

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_tag}/drivers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns all allowed drivers for a vehicle. This endpoint is only available for the vehicle owner.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": [ { "my_tesla_unique_id": 8888888, "user_id": 800001, "user_id_s": "800001", "vault_uuid": "b5c443af-a286-49eb-a4ad-35a97963155d", "driver_first_name": "Testy", "driver_last_name": "McTesterson", "granular_access": { "hide_private": false }, "active_pubkeys": [], "public_key": "" } ], "count": 1 }

drivers remove

DELETE /api/1/vehicles/{vehicle_tag}/drivers

scopes: vehicle_cmds

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

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/drivers", 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_tag}/drivers")

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

request = Net::HTTP::Delete.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("DELETE", "/api/1/vehicles/{vehicle_tag}/drivers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Removes driver access from a vehicle. Share users can only remove their own access. Owners can remove share access or their own.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
share_user_id query integer No user id from a share
Click to view successful response{ "response": "ok" }

eligible_subscriptions

GET /api/1/dx/vehicles/subscriptions/eligibility

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/vehicles/subscriptions/eligibility?vin={vin}' 
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/vehicles/subscriptions/eligibility?vin={vin}", 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/vehicles/subscriptions/eligibility?vin={vin}")

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/vehicles/subscriptions/eligibility?vin=%7Bvin%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns eligible vehicle subscriptions.

Parameters

Name In Type Required Description
vin query string Yes Vin
Click to view successful response{ "response": { "country": "string", "eligible": [ { "addons": [ { "billingPeriod": "string", "currencyCode": "string", "optionCode": "string", "price": 0, "tax": 0, "total": 0 } ], "billingOptions": [ { "billingPeriod": "string", "currencyCode": "string", "optionCode": "string", "price": 0, "tax": 0, "total": 0 } ], "optionCode": "string", "product": "string", "startDate": "string" } ], "vin": "string" } }

eligible_upgrades

GET /api/1/dx/vehicles/upgrades/eligibility

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/vehicles/upgrades/eligibility?vin={vin}' 
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/vehicles/upgrades/eligibility?vin={vin}", 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/vehicles/upgrades/eligibility?vin={vin}")

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/vehicles/upgrades/eligibility?vin=%7Bvin%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Returns eligibile vehicle upgrades.

Parameters

Name In Type Required Description
vin query string Yes Vin
Click to view successful response{ "response": { "vin": "TEST00000000VIN01", "country": "US", "type": "VEHICLE", "eligible": [ { "optionCode": "$FM3U", "optionGroup": "PERF_FIRMWARE", "currentOptionCode": "$FM3B", "pricing": [ { "price": 2000, "total": 2000, "currencyCode": "USD", "isPrimary": true } ] } ] } }

fleet_status

POST /api/1/vehicles/fleet_status

scopes: vehicle_device_data

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

const body = JSON.stringify({
   "vins": [
      "vin1"
   ]
});

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/fleet_status", 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/fleet_status")

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({
   "vins": [
      "vin1"
   ]
})

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({
   "vins": [
      "vin1"
   ]
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/fleet_status", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Checks whether vehicles can accept Tesla commands protocol for the partner's public key

Parameters

Name In Type Required Description
vins body array Yes list of Vehicle Identification Number (VIN).
Click to view successful response{ "response": { "key_paired_vins": [], "unpaired_vins": [ "5YJ3000000NEXUS01" ], "vehicle_info": { "5YJ3000000NEXUS01": { "firmware_version": "2024.14.30" } } } }

fleet_telemetry_config create

POST /api/1/vehicles/fleet_telemetry_config

scopes: vehicle_device_data

curl --header 'Content-Type: application/json' \
  --header "Authorization: Bearer $TESLA_API_TOKEN" \
  --data '{
    "vins": [
      "vin1",
      "vin2"
    ],
    "config": {
      "hostname": "test-telemetry.com",
      "ca": "-----BEGIN CERTIFICATE-----\ncert\n-----END CERTIFICATE-----\n",
      "fields": {
        "DriveRail": {
          "interval_seconds": 1800
        },
        "BmsFullchargecomplete": {
          "interval_seconds": 1800
        }
      },
      "alert_types": [
        "service"
      ],
      "exp": 1704067200,
      "port": 4443
    }
  }' \
  'https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/fleet_telemetry_config' 
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", `Bearer ${process.env.TESLA_API_TOKEN}`);

const body = JSON.stringify({
   "vins": [
      "vin1",
      "vin2"
   ],
   "config": {
      "hostname": "test-telemetry.com",
      "ca": "-----BEGIN CERTIFICATE-----\ncert\n-----END CERTIFICATE-----\n",
      "fields": {
         "DriveRail": {
            "interval_seconds": 1800
         },
         "BmsFullchargecomplete": {
            "interval_seconds": 1800
         }
      },
      "alert_types": [
         "service"
      ],
      "exp": 1704067200,
      "port": 4443
   }
});

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/fleet_telemetry_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/vehicles/fleet_telemetry_config")

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({
   "vins": [
      "vin1",
      "vin2"
   ],
   "config": {
      "hostname": "test-telemetry.com",
      "ca": "-----BEGIN CERTIFICATE-----\ncert\n-----END CERTIFICATE-----\n",
      "fields": {
         "DriveRail": {
            "interval_seconds": 1800
         },
         "BmsFullchargecomplete": {
            "interval_seconds": 1800
         }
      },
      "alert_types": [
         "service"
      ],
      "exp": 1704067200,
      "port": 4443
   }
})

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({
   "vins": [
      "vin1",
      "vin2"
   ],
   "config": {
      "hostname": "test-telemetry.com",
      "ca": "-----BEGIN CERTIFICATE-----\ncert\n-----END CERTIFICATE-----\n",
      "fields": {
         "DriveRail": {
            "interval_seconds": 1800
         },
         "BmsFullchargecomplete": {
            "interval_seconds": 1800
         }
      },
      "alert_types": [
         "service"
      ],
      "exp": 1704067200,
      "port": 4443
   }
})
headers = {
   'Content-Type': 'application/json',
   'Authorization': 'Bearer ENV_TESLA_API_TOKEN'
}
conn.request("POST", "/api/1/vehicles/fleet_telemetry_config", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Configures vehicles to connect to self-hosted fleet-telemetry server. This endpoint has concurrency 1 (status 429 will be returned if many calls are made at the same time). Multiple vehicles can be configured with a single call.

If any specified VINs are not configured, the response will include skipped_vehicles. The reasons VINs may be rejected:

  • missing_key: Your virtual key has not been added to the vehicle. Distributing your public key.
  • unsupported_hardware: Pre-2021 Model S and X are not supported.
  • unsupported_firmware: Vehicles running firmware version earlier than 2023.20.

Parameters

Name In Type Required Description
vins body array Yes list of Vehicle Identification Number (VIN)
config.hostname body string Yes url of the fleet-telemetry server, must match the root domain (second-level + first-level domain) of the registered application
config.ca body string Yes public certificate authority cert for fleet-telemetry server
config.fields.<field_to_stream>.interval_seconds body integer Yes field publishing interval, exhaustive list of <field_to_stream> here.
config.alert_types body array No list of alert types that the vehicle will publish
config.exp body integer No expiration (epoch time in seconds) of the current config. If not specified, config will be valid indefinitely.
config.port body integer Yes fleet-telemetry server port
Click to view successful response{ "response": { "updated_vehicles": 1, "skipped_vehicles": { "missing_key": [], "unsupported_hardware": [ "5YJ3000000NEXUS02" ], "unsupported_firmware": [ "5YJ3000000NEXUS02" ] } } }

fleet_telemetry_config delete

DELETE /api/1/vehicles/{vehicle_tag}/fleet_telemetry_config

scopes: vehicle_device_data

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

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

fetch("https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/{vehicle_tag}/fleet_telemetry_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/vehicles/{vehicle_tag}/fleet_telemetry_config")

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

request = Net::HTTP::Delete.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("DELETE", "/api/1/vehicles/{vehicle_tag}/fleet_telemetry_config", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Disconnects vehicles to stream telemetry data to self hosted fleet-telemetry server.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "updated_vehicles": 1 } }

fleet_telemetry_config get

GET /api/1/vehicles/{vehicle_tag}/fleet_telemetry_config

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/{vehicle_tag}/fleet_telemetry_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/vehicles/{vehicle_tag}/fleet_telemetry_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/vehicles/{vehicle_tag}/fleet_telemetry_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/vehicles/{vehicle_tag}/fleet_telemetry_config", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Fetches a vehicle's fleet telemetry config. synced set to true means the vehicle has adopted the target config. synced set to false means the vehicle will attempt to adopt the target config when it next establishes a backend connection.

Parameters

Name In Type Required Description
vehicle_tag path integer Yes VIN or id field of a vehicle from /api/1/vehicles endpoint.
Click to view successful response{ "response": { "synced": true, "config": { "hostname": "test-telemetry.com", "ca": "-----BEGIN CERTIFICATE-----\ncert\n-----END CERTIFICATE-----\n", "exp": 1704067200, "port": 4443, "fields": { "DriveRail": { "interval_seconds": 1800 }, "BmsFullchargecomplete": { "interval_seconds": 1800 } }, "alert_types": [ "service" ] } } }

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"))

Returns vehicles belonging to the account.

Parameters

Name In Type Required Description
page query integer No Current page number.
per_page query integer No Number of records per page.
Click to view successful response{ "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 } ], "pagination": { "previous": null, "next": null, "current": 1, "per_page": 2, "count": 2, "pages": 1 }, "count": 1 }

mobile_enabled

GET /api/1/vehicles/{vehicle_tag}/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/{vehicle_tag}/mobile_enabled'