# Bulk editing users through Management API

**URL:** <https://community.auth0.com/t/bulk-editing-users-through-management-api/74482>\
**Category:** Get Help\
**Created:** [December 8, 2021, 2:34pm UTC](https://community.auth0.com/t/bulk-editing-users-through-management-api/74482 "2021-12-08T14:34:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![balazs.bokanyi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/balazs.bokanyi/32/12699_2.png) [@balazs.bokanyi](https://community.auth0.com/u/balazs.bokanyi)\
**Post date:** [December 8, 2021, 2:34pm UTC](https://community.auth0.com/t/bulk-editing-users-through-management-api/74482/1 "2021-12-08T14:34:29Z")

</div>

Hello everyone!

I know that I can “Block” individual users either through the Management API (call “Update a User” endpoint with “blocked” property set to “true”) or via the Auth0 Dashboard.

My question is, can I bulk-block a bunch of users via the Management API, specified with their email addresses or Auth0 ID?

Or in general, perform any bulk operations on a group of users (including deleting) via the Management API?

If not, is there any workaround to achieve this? The main objective is to not call the API 30 times, but only once.

Thanks in advance!

---

<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:** [December 8, 2021, 6:38pm UTC](https://community.auth0.com/t/bulk-editing-users-through-management-api/74482/3 "2021-12-08T18:38:00Z")

</div>

Hi @balazs.bokanyi,

Thanks for reaching out to the Auth0 Community!

I understand that you’d like to bulk block users on your application.

Unfortunately, there isn’t an equivalent endpoint that could bulk block your users.

If you would like to block your users, you will need to use the Auth0 [Management API Update a user endpoint](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id) to programmatically update those individuals to a blocked state.

As an alternative, you could consider using something like Auth0 Actions. If there is a specific condition which you know these users should be blocked, for example, a certain domain, IP address, or a list of email addresses, then you could have a [Post-Login script](https://auth0.com/docs/actions/triggers/post-login) waiting to block these users and deny them access.

Hoped this helps!

Thank you.

---

<div class="post-metadata">

**Author:** ![balazs.bokanyi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/balazs.bokanyi/32/12699_2.png) [@balazs.bokanyi](https://community.auth0.com/u/balazs.bokanyi)\
**Post date:** [December 9, 2021, 8:34am UTC](https://community.auth0.com/t/bulk-editing-users-through-management-api/74482/4 "2021-12-09T08:34:47Z")

</div>

Hello @rueben.tiow ,

thank you for your reply!

Using a Post-login script, what would happen if the user is already logged in? That is, the …/authorize endpoint redirects back to the application directly instead of the …/login endpoint. Would the script still run?

---

<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:** [December 9, 2021, 5:48pm UTC](https://community.auth0.com/t/bulk-editing-users-through-management-api/74482/5 "2021-12-09T17:48:25Z")

</div>

Hi @balazs.bokanyi,

Thank you for your response.

> [@balazs.bokanyi](#):
>
> Using a Post-login script, what would happen if the user is already logged in? That is, the …/authorize endpoint redirects back to the application directly instead of the …/login endpoint. Would the script still run?

The Post-Login script will always trigger after a successful login flow. So in the case where a user hits the `/authorize` endpoint with an active session, then the user will not need to re-authenticate, and the Post-Login script will execute.

I hope this answers your question.

Please let me know if there’s anything else I can do 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:** [December 24, 2021, 5:48pm UTC](https://community.auth0.com/t/bulk-editing-users-through-management-api/74482/6 "2021-12-24T17:48:34Z")

</div>

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