# How to delete a user with Bonita 6.1+ Rest API ?

**URL:** <https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102>\
**Category:** Q&A\
**Created:** [9 January 2014 14:39 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102 "2014-01-09T14:39:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)\
**Post date:** [9 January 2014 14:39 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/1 "2014-01-09T14:39:26Z")

</div>

Hello bonita community,

I am writing a java [client](https://github.com/a-cordier/bonita-rest-client/blob/c4089ed649584c02d240d2267f7f606258787bdc/src/main/java/fr/univlille2/bonita/rest/client/BonitaRestClient.java) for bonita 6.1 rest API using Apache HttpClient 4.3.1

Currently i'm facing a problem with the HTTP DELETE method.

When i want to delete a single entry I execute a httpDelete on http://myserver.com/bonita/API/identity/user/102

102 exists as an id (i can fetch user 102 with a get)

Here is what I end with:

```
Caused By:(attempt to create delete event with null entity)
```

By the way, bulk delete relies on a HTTP DELETE accepting a payload and i read here and there that payload support is not guaranted for HTTP DELETE.

Have you got a working example please ?

Thank you,

Antoine

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [14 January 2014 10:52 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/2 "2014-01-14T10:52:54Z")

</div>

You can read information about it on the documetation:

- 6.1/6.2 -\> http://documentation.bonitasoft.com/web-rest-api-details
- 6.0 -\>&nbsp;http://documentation.bonitasoft.com/web-rest-api

Thank you very much aCordier for you question. It helps us improve our resources ;-)

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [9 January 2014 15:18 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/3 "2014-01-09T15:18:04Z")

</div>

it is possible to deactivate, but not to delete. would it be enough for you

---

<div class="post-metadata">

**Author:** ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)\
**Post date:** [9 January 2014 15:21 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/4 "2014-01-09T15:21:42Z")

</div>

Maybe even better, but how can i achieve this using HTTP ?

Thanks

Antoine

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [9 January 2014 15:24 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/5 "2014-01-09T15:24:28Z")

</div>

Let me check

---

<div class="post-metadata">

**Author:** ![anthony.birembaut](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anthony.birembaut](https://community.ofelia.com/u/anthony.birembaut)\
**Post date:** [9 January 2014 15:47 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/6 "2014-01-09T15:47:57Z")

</div>

Hi,

Although available in the API, deleting users is not advised because the information about who performed some steps / started some case will be lost...

The best solution is to deactivate a user when he is no longer supposed to have access to the platform.

Anyway, to delete a user, you need to perform a DELETE request on API/identity/user with in the request payload ["102"] or ["102","103","104"] if you want to delete several users.

To deactivate a user, you need to perform a PUT request on API/identity/user/102 with in the request payload {enabled:false}

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [9 January 2014 15:52 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/7 "2014-01-09T15:52:52Z")

</div>

anthony, perhaps it would be good to write an answer with the link the javadoc ?

---

<div class="post-metadata">

**Author:** ![anthony.birembaut](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anthony.birembaut](https://community.ofelia.com/u/anthony.birembaut)\
**Post date:** [9 January 2014 16:34 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/8 "2014-01-09T16:34:40Z")

</div>

Actually, this is part of the REST API, not Java API. So the Javadoc is irrelevent. The REST API documentation is [here](http://documentation.bonitasoft.com/web-rest-api-details). We will update the part about deleting a resource because it is not accurate.

---

<div class="post-metadata">

**Author:** ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)\
**Post date:** [9 January 2014 16:38 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/9 "2014-01-09T16:38:00Z")

</div>

Hello,

Thank you for pointing that out. Putting the user in the disable state is clearly a better aproach and will definitely suit my purpose.

But when I execute the PUT method with {"enabled":"false"} as a payload what I get as an answer is "...descriptor does not contain field updates". I also made an attempt with {"user\_state":"DISABLED"} based on the get response but it does not work that much either.

If i made a put with parameters described in the [documentation](http://documentation.bonitasoft.com/web-rest-api-examples) page, the user is updated as expected.

Do I miss something ?

Thanks

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![anthony.birembaut](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anthony.birembaut](https://community.ofelia.com/u/anthony.birembaut)\
**Post date:** [9 January 2014 17:06 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/10 "2014-01-09T17:06:47Z")

</div>

Which version of Bonita are you using ? The user deactivation feature wasn't present in versions earlier than 6.1.0.

---

<div class="post-metadata">

**Author:** ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)\
**Post date:** [9 January 2014 19:20 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/11 "2014-01-09T19:20:11Z")

</div>

You've got it ! I was running tests on a pretty old server (6.0.x). I'll switch to a 6.2 tomorow and let know here if it made day.

---

<div class="post-metadata">

**Author:** ![aCordier](https://avatars.discourse-cdn.com/v4/letter/a/dbc845/32.png) [@aCordier](https://community.ofelia.com/u/aCordier)\
**Post date:** [10 January 2014 10:28 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/12 "2014-01-10T10:28:40Z")

</div>

It works, thanks!

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/community_bonitasoft/original/2X/6/6b7b18c0478f2645369e82e009b65e3b97f2cc12.svg) [@system](https://community.ofelia.com/u/system)\
**Post date:** [14 January 2014 10:41 UTC](https://community.ofelia.com/t/how-to-delete-a-user-with-bonita-6-1-rest-api/4102/13 "2014-01-14T10:41:20Z")

</div>

The documentation on the WEB REST API has been updated, for [6.0](http://documentation.bonitasoft.com/web-rest-api) and [6.1/6.2](http://documentation.bonitasoft.com/web-rest-api-details).

Chris
