# Delete user from Jenkins Instance using API or CURL request

**URL:** <https://community.jenkins.io/t/delete-user-from-jenkins-instance-using-api-or-curl-request/653>\
**Category:** Ask a question\
**Created:** [October 26, 2021, 5:46am UTC](https://community.jenkins.io/t/delete-user-from-jenkins-instance-using-api-or-curl-request/653 "2021-10-26T05:46:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CS19M002](https://avatars.discourse-cdn.com/v4/letter/c/e8c25b/32.png) [@CS19M002](https://community.jenkins.io/u/CS19M002)\
**Post date:** [October 26, 2021, 5:46am UTC](https://community.jenkins.io/t/delete-user-from-jenkins-instance-using-api-or-curl-request/653/1 "2021-10-26T05:46:14Z")

</div>

I want to delete member from jenkins project using CURL or API call, so that I can replicate the same using code. Like we can delete a Job from jenkins using a POST request like below

`http://<jenkins URL>/job/<job name>/doDelete`

Similarly do we have a CURL or API to delete a member from a particular Jenkin Project?

---

<div class="post-metadata">

**Author:** ![martinda](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/martinda/32/288_2.png) [@martinda](https://community.jenkins.io/u/martinda)\
**Post date:** [January 2, 2022, 4:49pm UTC](https://community.jenkins.io/t/delete-user-from-jenkins-instance-using-api-or-curl-request/653/2 "2022-01-02T16:49:32Z")

</div>

> Similarly do we have a CURL or API to delete a member from a particular Jenkin Project?

Not to my knowledge.

That would be done via the job update API. If you look at the `config.xml` of a Folder for example, you would see something like this (irrelevant parts omitted):

```
<com.cloudbees.hudson.plugins.folder.Folder plugin="cloudbees-folder@6.16">
  <properties>
    <com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty>
      <permission>hudson.model.Item.Build:user</permission>
      <permission>hudson.model.Item.Cancel:user</permission>
      <permission>hudson.model.Item.Configure:user</permission>
      <permission>hudson.model.Item.Create:user</permission>
      <permission>hudson.model.Item.Delete:user</permission>
      <permission>hudson.model.Item.Discover:user</permission>
      <permission>hudson.model.Item.Move:user</permission>
      <permission>hudson.model.Item.Read:user</permission>
      <permission>hudson.model.Item.Workspace:user</permission>
    </com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty>
  </properties>
</com.cloudbees.hudson.plugins.folder.Folder>

```

You’d need a HTML parser, it would have to have the knowledge of the structure (which hopefully won’t change too much between Jenkins versions), and it would have to pull out the specific user (or be able to grant/alter/revoke the required permissions), then post the modified `config.xml` back to Jenkins.

I think a scripted client sitting inside or on top of [jenkins-rest](https://github.com/cdancy/jenkins-rest) would be a good place to implement this feature. Try to start a conversation about it by opening an issue in [jenkins-rest](https://github.com/cdancy/jenkins-rest/issues).
