I’d like my application to update my users’ linked discourse account: specifically the display name and groups the user is a member of (e.g. when they’re promoted in my application, they’re added to another forum group as well).
I expected to store a “discourse member id” reference in my application’s users table, and use that to make updates, e.g. POST /users/{id}.json with a payload like {"name": "new name"}. But it looks like all the API routes expect a username instead of an id.
I don’t understand why this would be the default: can’t users change their username? It seems like that would break the integration if they did.
How can I make changes like this reliably, using a consistent identifier (like id)?