Authentication
Tokens /oauth/token
POST
/oauth/token
Get an Access Token
Returns a access_token
which is passed along as a header with all future requests to authenticate the user.
You must provide the Authorization: Bearer {access_token}
header in all other requests.
The current client ID and secret are available here
Example URI
https://owner-api.teslamotors.com /oauth/tokenRequest object
grant_type | string | The type of oAuth grant. Always "password" | password | |
client_id | string | The oAuth client ID | abc | |
client_secret | string | The oAuth client secret | 123 | |
string | The email for my.teslamotors.com | elon@teslamotors.com | ||
password | string | The password for my.teslamotors.com | edisonsux |
Headers
-
Content-Type: application/json
application/json
{ "access_token": "abc123", "token_type": "bearer", "expires_in": 7776000, "created_at": 1457385291 }
Vehicles
A logged in user can have multiple vehicles under their account. This resource is primarily responsible for listing the vehicles and the basic details about them.
Vehicle Collection /api/1/vehicles
GET
/api/1/vehicles
List all Vehicles
Example URI
https://owner-api.teslamotors.com /api/1/vehiclesHeaders
-
Authorization: Bearer {access_token}
Headers
-
Content-Type: application/json
application/json
{ "response": [{ "color": null, "display_name": null, "id": 321, "option_codes": "MS01,RENA,TM00,DRLH,PF00,BT85,PBCW,RFPO,WT19,IBMB,IDPB,TR00,SU01,SC01,TP01,AU01,CH00,HP00,PA00,PS00,AD02,X020,X025,X001,X003,X007,X011,X013", "user_id": 123, "vehicle_id": 1234567890, "vin": "5YJSA1CN5CFP01657", "tokens": ["x", "x"], "state": "online" }], "count":1 }
State and Settings /api/1/vehicles/{vehicle_id}
These resources are read-only and determine the state of the vehicle's various sub-systems.
GET
/api/1/vehicles/{vehicle_id}/mobile_enabled
Mobile Access
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/mobile_enabledHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": true }
GET
/api/1/vehicles/{vehicle_id}/data_request/charge_state
Charge State
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/data_request/charge_stateHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "charging_state": "Complete", // "Charging", ?? "charge_to_max_range": false, // current std/max-range setting "max_range_charge_counter": 0, "fast_charger_present": false, // connected to Supercharger? "battery_range": 239.02, // rated miles "est_battery_range": 155.79, // range estimated from recent driving "ideal_battery_range": 275.09, // ideal miles "battery_level": 91, // integer charge percentage "battery_current": -0.6, // current flowing into battery "charge_starting_range": null, "charge_starting_soc": null, "charger_voltage": 0, // only has value while charging "charger_pilot_current": 40, // max current allowed by charger & adapter "charger_actual_current": 0, // current actually being drawn "charger_power": 0, // kW (rounded down) of charger "time_to_full_charge": null, // valid only while charging "charge_rate": -1.0, // float mi/hr charging or -1 if not charging "charge_port_door_open": true } }
GET
/api/1/vehicles/{vehicle_id}/data_request/climate_state
Climate Settings
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/data_request/climate_stateHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "inside_temp": 17.0, // degC inside car "outside_temp": 9.5, // degC outside car or null "driver_temp_setting": 22.6, // degC of driver temperature setpoint "passenger_temp_setting": 22.6, // degC of passenger temperature setpoint "is_auto_conditioning_on": false, // apparently even if on "is_front_defroster_on": null, // null or boolean as integer? "is_rear_defroster_on": false, "fan_status": 0 // fan speed 0-6 or null } }
GET
/api/1/vehicles/{vehicle_id}/data_request/drive_state
Driving and Position
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/data_request/drive_stateHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "shift_state": null, // "speed": null, // "latitude": 33.794839, // degrees N of equator "longitude": -84.401593, // degrees W of the prime meridian "heading": 4, // integer compass heading, 0-359 "gps_as_of": 1359863204 // Unix timestamp of GPS fix } }
GET
/api/1/vehicles/{vehicle_id}/data_request/gui_settings
GUI Settings
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/data_request/gui_settingsHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "gui_distance_units": "mi/hr", "gui_temperature_units": "F", "gui_charge_rate_units": "mi/hr", "gui_24_hour_time": false, "gui_range_display": "Rated" } }
GET
/api/1/vehicles/{vehicle_id}/data_request/vehicle_state
Vehicle State
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/data_request/vehicle_stateHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "df": false, // driver's side front door open "dr": false, // driver's side rear door open "pf": false, // passenger's side front door open "pr": false, // passenger's side rear door open "ft": false, // front trunk is open "rt": false, // rear trunk is open "car_verson": "1.19.42", // car firmware version "locked": true, // car is locked "sun_roof_installed": false, // panoramic roof is installed "sun_roof_state": "unknown", "sun_roof_percent_open": 0, // null if not installed "dark_rims": false, // gray rims installed "wheel_type": "Base19", // wheel type installed "has_spoiler": false, // spoiler is installed "roof_color": "Colored", // "None" for panoramic roof "perf_config": "Base" } }
Vehicle Commands
These commands alter the vehicles state, and return result (true/false) to indicate success, and if failure reason contains the cause of failure.
Wake Up Car /api/1/vehicles/{vehicle_id}/wake_up
POST
/api/1/vehicles/{vehicle_id}/wake_up
Wake Up Car
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/wake_upHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Set Valet Mode /api/1/vehicles/{vehicle_id}/command/set_valet_mode
POST
/api/1/vehicles/{vehicle_id}/command/set_valet_mode
Set Valet Mode
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/set_valet_modeHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Request object
on | boolean | Whether to enable or disable valet mode. | true | |
password | number | (optional) A 4 digit PIN code to unlock the car. | 1234 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Reset Valet PIN /api/1/vehicles/{vehicle_id}/command/reset_valet_pin
POST
/api/1/vehicles/{vehicle_id}/command/reset_valet_pin
Reset Valet PIN
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/reset_valet_pinHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Open Charge Port /api/1/vehicles/{vehicle_id}/command/charge_port_door_open
POST
/api/1/vehicles/{vehicle_id}/command/charge_port_door_open
Open Charge Port
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/charge_port_door_openHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Set Charge Limit to Standard /api/1/vehicles/{vehicle_id}/command/charge_standard
POST
/api/1/vehicles/{vehicle_id}/command/charge_standard
Set Charge Limit to Standard
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/charge_standardHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": false, "reason": "already_standard" } }
Set Charge Limit to Max Range /api/1/vehicles/{vehicle_id}/command/charge_max_range
POST
/api/1/vehicles/{vehicle_id}/command/charge_max_range
Set Charge Limit to Max Range
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/charge_max_rangeHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": false, "reason": "already_max_range" } }
Set Charge Limit /api/1/vehicles/{vehicle_id}/command/set_charge_limit?percent={limit_value}
POST
/api/1/vehicles/{vehicle_id}/command/set_charge_limit?percent={limit_value}
Set Charge Limit
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/set_charge_limit?percent=75Headers
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
limit_value | number | required | The percentage value | 75 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Start Charging /api/1/vehicles/{vehicle_id}/command/charge_start
POST
/api/1/vehicles/{vehicle_id}/command/charge_start
Start Charging
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/charge_startHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" // "already_started" if a charge is in progress } }
Stop Charging /api/1/vehicles/{vehicle_id}/command/charge_stop
POST
/api/1/vehicles/{vehicle_id}/command/charge_stop
Stop Charging
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/charge_stopHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" // "not_charging" if a charge was not in progress } }
Flash Lights /api/1/vehicles/{vehicle_id}/command/flash_lights
POST
/api/1/vehicles/{vehicle_id}/command/flash_lights
Flash Lights
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/flash_lightsHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Honk Horn /api/1/vehicles/{vehicle_id}/command/honk_horn
POST
/api/1/vehicles/{vehicle_id}/command/honk_horn
Honk Horn
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/honk_hornHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Unlock Doors /api/1/vehicles/{vehicle_id}/command/door_unlock
POST
/api/1/vehicles/{vehicle_id}/command/door_unlock
Unlock Doors
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/door_unlockHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Lock Doors /api/1/vehicles/{vehicle_id}/command/door_lock
POST
/api/1/vehicles/{vehicle_id}/command/door_lock
Lock Doors
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/door_lockHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Set Temperature /api/1/vehicles/{vehicle_id}/command/set_temps?driver_temp={driver_degC}&passenger_temp={pass_degC}
POST
/api/1/vehicles/{vehicle_id}/command/set_temps?driver_temp={driver_degC}&passenger_temp={pass_degC}
Set Temperature
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/set_temps?driver_temp=23.7&passenger_temp=18.1Headers
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
driver_degC | number | required | The desired temperature on the driver's side in °C. | 23.7 |
pass_degC | number | required | The desired temperature on the passenger's side in °C. | 18.1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Start HVAC System /api/1/vehicles/{vehicle_id}/command/auto_conditioning_start
POST
/api/1/vehicles/{vehicle_id}/command/auto_conditioning_start
Start HVAC System
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/auto_conditioning_startHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Stop HVAC System /api/1/vehicles/{vehicle_id}/command/auto_conditioning_stop
POST
/api/1/vehicles/{vehicle_id}/command/auto_conditioning_stop
Stop HVAC System
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/auto_conditioning_stopHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Move Pano Roof /api/1/vehicles/{vehicle_id}/command/sun_roof_control?state={state}&percent={percent}
POST
/api/1/vehicles/{vehicle_id}/command/sun_roof_control?state={state}&percent={percent}
Move Pano Roof
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/sun_roof_control?state=%3Cul%20class%3D%22list-group%20mdl-list%22%3E%3Cli%20class%3D%22list-group-item%20mdl-list__item%22%3Eopen%3C%2Fli%3E%3Cli%20class%3D%22list-group-item%20mdl-list__item%22%3Eclose%3C%2Fli%3E%3Cli%20class%3D%22list-group-item%20mdl-list__item%22%3Ecomfort%3C%2Fli%3E%3Cli%20class%3D%22list-group-item%20mdl-list__item%22%3Event%3C%2Fli%3E%3Cli%20class%3D%22list-group-item%20mdl-list__item%22%3Emove%3C%2Fli%3E%3C%2Ful%3E&percent=50Headers
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
state | enum | required | The desired state of the panoramic roof. The approximate percent open values for each state are |
|
percent | number | optional | The percentage to move the roof to. | 50 |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Remote Start /api/1/vehicles/{vehicle_id}/command/remote_start_drive?password={password}
POST
/api/1/vehicles/{vehicle_id}/command/remote_start_drive?password={password}
Remote Start
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/remote_start_drive?password=edisonsuxHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
password | string | required | The password to the authenticated my.teslamotors.com account. | edisonsux |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }
Open Trunk/Frunk /api/1/vehicles/{vehicle_id}/command/trunk_open
POST
/api/1/vehicles/{vehicle_id}/command/trunk_open
Open Trunk/Frunk
Example URI
https://owner-api.teslamotors.com /api/1/vehicles/1/command/trunk_openHeaders
-
Authorization: Bearer {access_token}
URI Parameters
vehicle_id | number | required | The id of the Vehicle. | 1 |
Request object
which_trunk | string | The trunk to open. | rear |
Headers
-
Content-Type: application/json
application/json
{ "response": { "result": true, "reason": "" } }