Tesla API Token

If you want to generate a Tesla API token we need either:

The Tesla API token can be repeatedly used until it expires, typically about 6 weeks after it has been created.

Because the API token expires, some 3rd party applications want a refresh token so they can regenerate the API token without asking you. While this can be convenient, be aware that they can keep regenerating tokens with asking for your MFA token again. In general we don't like the Tesla arrangements regarding security but that is the way they have it set up.

Tesla-Info does not store your email address or password, nor the generated tokens. 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. If you want to invalidate any tokens and refresh tokens, then you will need to change your Tesla Password.



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]&request=[command]&value=[value]

An example of the command to lock the cars on your account:

https://tesla-info.com/api/control.php?token=eu-abcd1234&request=lock

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.

For more information, see our guide to Tesla automation.


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

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.


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.