Infraviored
(Florian Schneider)
January 30, 2024, 2:13pm
1
I fear this is impossible. But I try to ask anyway:
How to remove all my Homeassistant entries from Alexa.
I added them unfitted at first, but there are far too many. Some automation names are blocking devices with equal names, and so on.
I want to start fresh:
Remove ALL Homeassistnat-related entities. And then re-link it.
After disabling the integration, the devices remain.
Now what? Delete one after another?
It used to work apparently on
But dickheads at Amazon decided to worsen customer experience even more by forcing the shitty app and disabling a normal web interface.
Please tell me I have to delete my account or remove 300 devices by hand.
1 Like
AFAIK, since they shut down the browser portal, you have to manually delete them one-by-one via the Alexa app… I guess they figure if they make it inconvenient enough, people won’t remove devices and Amazon can keep amassing data…
finity
January 30, 2024, 5:39pm
3
I totally agree.
I’m pretty sure that removing them by hand is the only option.
But even with the web UI you still had to remove them by hand. But it was just way easier because it was only one click on each one in the list to remove it.
Now you need to open each item individually and dig into the settings to delete it in there.
Super frustrating.
And what’s worse is that the data they are amassing likely is totally useless to them if the devices themselves no longer exist.
2 Likes
It’s not technically useless to them, because they use it to inflate their claims about the number of user-specific data points they tell their data clients are available for purchase… it’s not fraud, it’s statistics.
1 Like
So was anyone able to remove device from the Alex integration?
Cbarth3
(Chris B)
January 8, 2025, 9:09pm
6
I am looking for this myself. The only thing I could ever find was this python script, but I am no programmer so I have no idea how to do this. Really wish there was an easy way to remove these devices as I like testing out new things and it just slows the app down if I need to go into it for any reason.
2 Likes
Just in case anyone runs into this post sometime down the line. While there is no way to bulk delete from the list there is a way to remove everything if you accidentally added an empty blocklist matter bridge and added EVERY single entity that matter allows. (in my case anyway, but may work for others) If you click on a device in the devices tab and then click the gear icon, under general, connected via, mine says habridge (my matter bridge name) if you click that you can click the new trashcan which will remove all the devices “connected” with the integration. Then you can do it the proper way the second time!
Hope this helps.
rPraml
(Roland Praml)
January 19, 2026, 1:43pm
8
I had the same problem.
Nearly 500 HA devices were imported.
I had also some “ghost” devices in the app.
I spent the last day to get the Python-Delete-Alexa-Devices working (but without success)
But I want to share the javascript solution, I’ve found:
opened 11:00AM - 19 Jan 26 UTC
Hello @Shereef for this script,
and @Apollon77 for https://github.com/Apollon77… /alexa-remote
I spent a whole day to get the HTTP sniffer working (but without suceess)
I tried on my non rooted phone and on android emulators on WSL. During this research, I've found a much simpler solution, that only requires some javascript entered in the browser console.
I noticed, that you will get/have a valid cookie, if you are logged in in your amazon account. So the whole HTTP sniffing is not needed. (It is/was only needed for reverse enginerring, so thanks for that work)
We can call the APIs directly from the browser (until amazon will change something, e.g. check for user agent..., csrf)
We can also delete `ghost` devices, that cannot be deleted in the app
## Delete all Smarthome devices in ~ 1 minute
(Improved solution - one-liner)
I tried this multiple times. It seems, that no CSRF value is needed (see comments below
1. Ensure, that you are logged in in your amazon (.de/.com) account
2. Check under which of the following URLs you'll get a list of your devices:
- https://alexa.amazon.de/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://alexa.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://layla.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://pitangui.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://alexa.amazon.co.jp/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
3. If you have found the URL, that returns a json with your devices, paste this script in the developer-console (use at own risk!):
```javascript
devices = await (await fetch('/nexus/v1/graphql', { method: 'POST', headers: {"Content-Type": "application/json","Accept": "application/json"}, body: JSON.stringify({query: `query { endpoints { items { friendlyName legacyAppliance { applianceId }}} } `})})).json();for (const device of devices.data.endpoints.items) console.log(await fetch(`/api/phoenix/appliance/${encodeURIComponent(device.legacyAppliance.applianceId)}`, { method: "DELETE", headers: { "Accept": "application/json", "Content-Type": "application/json"}}))
```
4. Refresh the page. (should be empty - if not you may have a CSRF problem)
5. Say `Alexa discover devices`
6. Refresh page again (should show devices only provided by active skills)
### Delete all Smarthome devices with CSRF value
Try this, if the above will not work:
1. Ensure, that you are logged in in your amazon (.de/.com) account
2. Check under which of the following URLs you'll get a list of your devices:
- https://alexa.amazon.de/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://alexa.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://layla.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://pitangui.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
- https://alexa.amazon.co.jp/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
If you've found the correct URL (some JSON retured) keep that page open
3. Get the csrf number:
- open www.amazon.com / www.amazon.de in a new browser tab and put any article in your basket
- open your basket
- open dev-tools (F12) wait a while until the network calms down and clear network tab
- increase the quantity of the article
- you should see a `ref=ox_sc_update_quantity` request. Inspect that request for a `csrf` header or a `csrf=` value in the cookie header. **Copy that number**
- if you only find a `anti-csrftoken-a2z` - you may try that string, too
4. Switch back to the tab with the JSON
5. Enter the following in the dev-tools (browser console) - copy line by line
```javascript
csrf='<insert-csrf-value-here>'
devices = await (await fetch('/nexus/v1/graphql', { method: 'POST', headers: {"Content-Type": "application/json","Accept": "application/json"}, body: JSON.stringify({query: `query { endpoints { items { friendlyName legacyAppliance { applianceId }}} } `})})).json()
for (const device of devices.data.endpoints.items) console.log(await fetch(`/api/phoenix/appliance/${encodeURIComponent(device.legacyAppliance.applianceId)}`, { method: "DELETE", headers: { "Accept": "application/json", "Content-Type": "application/json", "csrf" : csrf }}))
```
### What the javascript does
The first line sets the CSRF value. (which is used by the third line)
The second line fetches all appliance-IDs from the graphql endpoint (you may inspect the `devices.data.endpoints.items` value before continuing with line 3)
The third line iterates over all devices and deletes them.
The script itself must run, while a page is open, you may notice, it uses `fetch('/nexus/v1/graphql')` without hostname. So if you execute it, it will use the same host (with all cookies) from the current page. So it is important, that you execute it in the tab, where the JSON is returend
**Note:** If the browser (I use firefox) renders the JSON as JSON, it will not work. Luckily https://alexa.amazon.de/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome returns `text/html` - although it is JSON. You may also just open https://alexa.amazon.de/ if this is a problem.
The most difficult part for me, was to get the correct applianceIds and pass them correctly encoded to the `/api/phoenix/appliance/` endpoint. Note: This endpoint always returns with 200, nevertheless, the device could be deleted or not
You *may* have to run the script twice.
### CSRF Token
To perform a successful delete, you *may* need a valid `csrf` value which is either a number (`csrf=`) or a string with about 60 chars.
This string is normally set in the `anti-csrftoken-a2z` header. The numeric value is set either in the `csrf` header or on the cookie.
You may find a valid csrf tokem in the page source of https://www.amazon.de/alexa-privacy/apd/myad?disableGlobalNav=true&ref=activityHistory
While I've got a numeric value on firefox, I got the `anti-csrftoken-a2z` in edge. In edge I had the `https://alexa.amazon.de/` page open, so it might be sufficient, if a correct referrer is set. In this case, set anything to csrf value
Would be happy, if someone can confirm that this works (or not)
1 Like
cgiraldo
(Carlos Giraldo)
January 19, 2026, 5:42pm
9
Thank you very much, this save me a lot of time (more than 200 devices). The working link for me from Spain location was https://layla.amazon.com/api/behaviors/entities?skillId=amzn1.ask.1p.smarthome
dag134
(Davin)
January 27, 2026, 1:54am
10
I love you. Worked perfectly and quickly.
Is the link still working for anyone else as I get “This page isn’t working”?
I have over 500 devices added by HA that I need to get rid of.