Blocking/Unblocking user with management API calls

Hi there, I’m working on automating our users’ blocking/ unblocking experience. I understand we have two types of blocks on Auth0 (IP block and global block)
My question is:
If i want to globally block a user with management API calls, should I call “Update User Profile” endpoint with “blocked” property set to “true”? would that globally block the user?
And for globally unblock the user I should call the same endpoint with “false”?

For unblocking the “IP” address due to excessive credential attempts, I assume I should call “DELETE on /user-blocks” endpoint?
Can you please confirm this.

Hi @narges.fallahi,

Welcome to the Auth0 Community!

I understand that you have questions about blocking and unblocking users with the Management API.

Yes, that is correct. The way to globally block or unblock a user is to call the Management API UPDATE /api/v2/users endpoint with the blocked property set to true or false.

Yes, that is also correct. The method for removing IP blocks that are triggered by Auth0’s Attack Protection is by calling the Management API DELETE /api/v2/user-blocks endpoint.

Please let me know if you have any further questions. I’d be happy to help.

Thank you.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.