Generate a Tesla Token

If you want to generate a Tesla API token we need your email address and password as used on your Tesla account. If you have Multi-Factor Authentication turned on, we will also need the current value from your first registered MFA device.

Tesla-Info does not store your email address or password, nor the generated token. Once we have executed the command and the results presented to you, the details are lost from our servers. The MFA code will expire shortly after being issued. You do not need to use our servers to generate a token if you still want to use out simplified API or Apple shortcuts.

Tesla may well ask for a captcha - if this appears, please enter the values shown and hit return.


Tesla simplified API made easy

Whether you generate a token with us or already have one, we have a number of utilities which you may wish to use to make the most of your token.

Our cars go to sleep and simply running a command to execute a function will often fail unless the car is prompted to wake up first, and only when it is awake is the command sent to the car. We have done the hard work building a general-purpose API which you can use to call one of the many Tesla commands.

The format for the API is as follows, although the id can be omitted and we will identify the first car on your Tesla account (for most people this will be their only car). The value is also only required for somne commands such as setting the temperature (in Celsius) or the charge level (in %).

https://tesla-info.com/api/control.php?token=[your token qts-lots of characters]&id=[id]&request=[command]&value=[value]

An example of a command to unlock the first car on your account is:
https://tesla-info.com/api/control.php?token=qts-abcdefghijklmnopqrstuvwxyz&request=unlock

An further example of a command to set the charge level of the car with the id 123456789 to 70% is:
https://tesla-info.com/api/control.php?token=qts-abcdefghijklmnopqrstuvwxyz&id=123456789&request=set_charge_limit&value=70

These commands can be integrated into IFTTT sequences for instance controlling the charging when your solar panels are produicing enough electricity, and the returned values are in legible JSON format. The command choices are
door_lock, lock, door_unlock, unlock, charge_port_door_open, chargeopen, charge_port_door_close, chargeclose, charge_start, charge, charge_stop, stopcharge, flash_lights, flash, honk_horn, honk, auto_conditioning_start, hvac, auto_conditioning_stop, hvacoff

Because the request may need to wake the car first, they can take up to 30 seconds to run.

The beauty of these API URLs is that they can be included in an Apple shortcut or as part of some other automation and the complexity of the various aspects such as waking the car will be taken care of for you without and of the data being held by a third party. We transiently use your information to execute the request and then the information is forgotten by us. And best of all, it's free.


Apple shortcuts

If you already have a token you can create a data.txt file on your apple device under Shortcuts in a folder called tesla with the format

{"token":"your token.","id":"car id"}

Creating files on an apple device can be quite difficult. We have found the easiest way to create a data.txt file from your apple device is to create the text in something like an email text body. Then select the text including the opening and closing curly bracket, then select Share, scroll down until you see "Save to files". From here, edit the word "text" to say "data" (no capital letter), select Shortcuts folder and then tesla using the create folder option in the top right hand corner if necessary. then select iCloud Drive, Shortcuts, tesla (creating the folders if they do not exist).

Tesla Token File save

If you don't have your vehicle id then you can leave the car id blank and we will work out the first car on your tesla account. If you have access to the data returned by Tesla to determine the relevant id, it is confusingly not the "vehicle id", but simply the "id".

The following ios shortcuts have been created to get you started, each of them accesses the information in the data.txt file, calls our servers which will wake up your car if necessary and then execute the command. The first time you run them you may be asked for permission to access the tesla-info website. Please be aware that if the car is asleep, the commands can take up to 30 seconds to complete as they are trying to wake the car first.


In general, tesla-info does not like the idea of third parties having access to your tesla token. This put us in a moral dilemma as many owners want to make use of the unofficial Tesla API for various activities and as part of scripting. What we have come up with is the best compromise we can think of, which is simply not to store your personal information requiring you to provide it to us each time for the one-time execution of the command. To make this easier for owners, we have provided a simple API that you can use plus some prebuilt Apple shortcuts which access a file held on your mobile device with the necessary information.

This will mean when your token expires and we will not be able to automatically renew it for you. If we were to do this, we would need to store your refresh token which is very powerful and needs to be protected very securely. While we are more than happy with our site security, we just don't see the point in taking the risk, and we don't think it is that much of an inconvenience to users. The tokens we issue will last about 6 weeks but we suggest updating them monthly or if the use of the token stops working we suggest repeating the process to update the token you store.

If at any time you feel your security has been compromised or your token leaked, visit tesla.com and change your Tesla password.

Facebook LinkedIn This site uses cookies to deliver our services and to show you relevant ads. By using our site, you acknowledge that you have read and understand our Privacy and Cookie Policy. Your use of the tesla-info website is subject to these policies and terms. All data is provided on a reasonable endeavours basis but errors and omissions may exist. No data should be relied upon as being accurate and additional checks should be made if the information is material to any purchase or use of the car. We provide product listings on Amazon for which we will receive a small commission if you chose to buy.