Anonymize by external id

Hi,

I’m looking into anonymizing users via the API and this works fine:

$"{_discourseSettings.Host}/admin/users/{id}/anonymize.json?api_key={_discourseSettings.ApiKey}&api_username={_discourseSettings.ApiUsername}";

But I’d really like to use our external Id instead of querying for a user first:

$"{_discourseSettings.Host}/admin/users/by-external/{myId}/anonymize.json?api_key={_discourseSettings.ApiKey}&api_username={_discourseSettings.ApiUsername}";

Is it wishful thinking that all API calls that take a user id also accept an external id, or is my path incorrect?

You’ll need to make an initial request to lookup the user ID first, as I believe you’ve already figured out.

3 Likes