Thank you for bringing this issue to our attention. Please make sure you are using the devices.requestSync API correctly to notify Google of changes to your devices (additions, removals, or renamings).
We want to clarify that Google doesn’t delete the agentUserId. Users have the option to unlink and delete the service from their end, but we do not automatically delete these IDs.
The error you're seeing is likely related to the authentication tokens associated with the agentUserId. While we don't delete the agentUserId itself, the access and refresh tokens used for authentication can become invalidated. This is the most probable cause of the 404 error.
When you make a devices.requestSync call, Google needs valid access and refresh tokens to properly issue a sync intent. If the refresh token has been invalidated (due to user action, inactivity, or other reasons), Google will return an error, which in some cases might manifest as a 404.