This is what I’m talking about - you can use the “update notification level for category $X” when someone wants to subscribe or unsubscribe via your platform.
This is instead of doing a read-modify-write of everything in the user preferences (which you can do on sign up). Much easier for you to code.