# What is the significance of "blocked" parameter in PATCH /api/v2/users/{id} call?

**URL:** <https://community.auth0.com/t/what-is-the-significance-of-blocked-parameter-in-patch-api-v2-users-id-call/85030>\
**Category:** Get Help\
**Tags:** user\
**Created:** [June 13, 2022, 2:07pm UTC](https://community.auth0.com/t/what-is-the-significance-of-blocked-parameter-in-patch-api-v2-users-id-call/85030 "2022-06-13T14:07:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gunjan.prmr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gunjan.prmr/32/37960_2.png) [@gunjan.prmr](https://community.auth0.com/u/gunjan.prmr)\
**Post date:** [June 13, 2022, 2:07pm UTC](https://community.auth0.com/t/what-is-the-significance-of-blocked-parameter-in-patch-api-v2-users-id-call/85030/1 "2022-06-13T14:07:55Z")

</div>

I have a requirement where I want to deactivate the user based on certain criteria. First I thought of deleting the user [DELETE user](https://auth0.com/docs/api/management/v2#!/Users/delete_users_by_id) and [create it back](https://auth0.com/docs/api/management/v2#!/Users/post_users) if needed.

While going through docs, I found [PATCH /user](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id) call with `blocked` option. If I set this to true and call GET /user API then I get the response with `"blocked":true` whereas if I call DELETE /user endpoint, I get `user does not exists` (something like that) response.

I guess, I am not sure in what case I should use `PATCH` call with `blocked: true`.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [June 13, 2022, 5:46pm UTC](https://community.auth0.com/t/what-is-the-significance-of-blocked-parameter-in-patch-api-v2-users-id-call/85030/3 "2022-06-13T17:46:09Z")

</div>

Hi @gunjan.prmr ,

Thank you for posting this topic on the Auth0 Community!

To deactivate the users, we can block users to revoke their access to the Application. If deleting the users instead, they could try signing up again to get access to the Application.

I did the following test and here are the details.

1. called the [PATCH user by id] with the below body scripts ([Auth0 Management API v2](https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id)) endpoint

```auto
{
  "blocked": true
}

```

1. verified that the user is blocked on the Auth0 Dashboard.
2. called the [Get a User endpoint](https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id), the user exists with `"blocked": true`.
3. called the [Delete a User](https://auth0.com/docs/api/management/v2#!/Users/delete_users_by_id) endpoint
4. verified that the user does not exist on the Auth0 Dashboard since it’s been deleted.

If you have followed the same steps and observed different responses, could you provide additional context? I am happy to look into this further.

Thank you!

---

<div class="post-metadata">

**Author:** ![gunjan.prmr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gunjan.prmr/32/37960_2.png) [@gunjan.prmr](https://community.auth0.com/u/gunjan.prmr)\
**Post date:** [June 13, 2022, 7:11pm UTC](https://community.auth0.com/t/what-is-the-significance-of-blocked-parameter-in-patch-api-v2-users-id-call/85030/4 "2022-06-13T19:11:54Z")

</div>

I observed the same results. My question was more of a like “what is right path for my use case”. I want to deactivate the user based on some criteria, then should I call PATCH call with “blocked:true” or just delete the user.

I guess you are confirming that user shows blocked in Auth0 dashboard. Meaning, the user won;t be able to sign in, in this case. If true, then I will go with PATCH.

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [June 13, 2022, 7:20pm UTC](https://community.auth0.com/t/what-is-the-significance-of-blocked-parameter-in-patch-api-v2-users-id-call/85030/5 "2022-06-13T19:20:48Z")

</div>

I suggest you use the patch call to block the users if you want to deactivate them 🙂

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [June 27, 2022, 3:00pm UTC](https://community.auth0.com/t/what-is-the-significance-of-blocked-parameter-in-patch-api-v2-users-id-call/85030/6 "2022-06-27T15:00:07Z")

</div>

This topic was automatically closed after 13 days. New replies are no longer allowed.
