How to get long lived access token?

Hello. I am new in HA. I need to get long lived access token for edit config files with Visual Studio Code Config Helper.

I see that topic in manual https://developers.home-assistant.io/docs/en/auth_api.html#long-lived-access-token but I dont understand how to use it. I try send POST json to http://hassio.local:8123/auth/long_lived_access_token and it just say 404 page not found.

Help me please understand how to get those tokens/

Go under your profile than logged in, there you can find at the end of the page the option to create long life access tokens.

6 Likes

How can I obtain the token through the API when establishing the web socket connection for the firs time? How can we establish a web socket using the username and password, then secondly obtaining the token?

For those who are having trouble finding it, you get to your Profile page on Home Assistant by clicking on your username in the bottom left panel of the HA page (under Notifications)

image

Then click on Create Token all the way at the bottom:

Give it a meaningful name and then copy it for use in your application.

image

image

Make sure you save it because it won’t be displayed again.

4 Likes

Thank you. This helped me.

2 Likes

What if this card (Long-Lived Access Tokens) don’t exists on this profile page?

EDIT: I found it on “Security” tab