# Blocking/Unblocking user with management API calls

**URL:** <https://community.auth0.com/t/blocking-unblocking-user-with-management-api-calls/70937>\
**Category:** Get Help\
**Tags:** blocking, auth0\
**Created:** [October 7, 2021, 2:17pm UTC](https://community.auth0.com/t/blocking-unblocking-user-with-management-api-calls/70937 "2021-10-07T14:17:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![narges.fallahi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/narges.fallahi/32/32190_2.png) [@narges.fallahi](https://community.auth0.com/u/narges.fallahi)\
**Post date:** [October 7, 2021, 2:17pm UTC](https://community.auth0.com/t/blocking-unblocking-user-with-management-api-calls/70937/1 "2021-10-07T14:17:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [October 7, 2021, 3:59pm UTC](https://community.auth0.com/t/blocking-unblocking-user-with-management-api-calls/70937/3 "2021-10-07T15:59:49Z")

</div>

Hi @narges.fallahi,

Welcome to the Auth0 Community!

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

> [@narges.fallahi](#):
>
> 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”?

Yes, that is correct. The way to globally block or unblock a user is to call the Management API [`UPDATE /api/v2/users`](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id) endpoint with the `blocked` property set to `true` or `false`.

> [@narges.fallahi](#):
>
> For unblocking the “IP” address due to excessive credential attempts, I assume I should call “DELETE on /user-blocks” endpoint?

Yes, that is also correct. The method for removing IP blocks that are triggered by Auth0’s [Attack Protection](https://auth0.com/docs/configure/attack-protection) is by calling the Management API [DELETE `/api/v2/user-blocks`](https://auth0.com/docs/api/management/v2#!/User_Blocks/delete_user_blocks_by_id) endpoint.

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

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 22, 2021, 4:00pm UTC](https://community.auth0.com/t/blocking-unblocking-user-with-management-api-calls/70937/4 "2021-10-22T16:00:25Z")

</div>

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