Deleting a Developer organization user using a REST API

With proper permissions, you can delete user accounts from a Developer organization using a REST API.

About this task

This feature requires the 5085-ifix, available as an Identity Fix from Fix Central (Fix Central > Select Fixes > WebSphere, IBM API Connect (5.0.8.4, All platforms) .

User accounts in a Developer organization can be deleted from IBM® API Connect using a REST API call. (Note that this API cannot be used to delete users from API Manager or Cloud Manager.) A role with one of the following catalog permissions is required to use this API:
  • Developer Organizations and Developers
  • View and manage developer organizations and developers

Procedure

To delete a user from a Developer organization, issue the following call:
DELETE /users/{Id}
where
  • {Id} is the user's id. The user id is required.

Users cannot be deleted if they are currently an owner of a Developer organization. Transfer ownership of the Developer organization prior to deleting the user. Optionally, you can also delete the Developer organization and then delete the users, including the owner.

To find the user id, search using the provider organization environment id. Use the searchFilter query parameter with a search string to filter results:
curl -X GET 'https://APICmanagementServer.myCompany.com/v1/users/context/4c22194ee2b0cdc2dfd2a2f2?searchFilter=Alice' -H 'Accept: application/json' -H 'Content-Type: application/json' -u apimanager/Sally.Manager@myCompany.com:sally_password -k -i
where:
  • https://APICmanagementServer.myCompany.com is the URL of the management server
  • 4c22194ee2b0cdc2dfd2a2f2 is the provider organization environment id
  • Alice is the search string (name of the user)
  • apimanager/Sally.Manager@myCompany.com:sally_password is the username and password for a user with a role that has the required permissions to use the API, for example, API Manager administrator, product manager, or catalog owner
Following are sample results. The user id appears in bold text:
[{"name":"Alice.Smith@myCompany.com","validationLink":null,"id":"4c35144ae4b0cdc4dfd3a324","context":"4c22194ee2b0cdc2dfd2a2f2","idpId":"4c22194ee2b0cdc2dfd2a2f2","username":"Alice.Smith@myCompany.com","email":"Alice.Smith@myCompany.com","firstName":"Alice","lastName":"Smith","lastLoginTime":null,"phoneNumber":null,"status":"active","url":"https://apimdev0068.hursley.ibm.com/v1/users/4c35144ae4b0cdc4dfd3a324"}] 

You can also find the user id by searching using the provider organization name and environment, for example, ProvOrgName.sb:

curl -X GET 'https://APICmanagementServer.myCompany.com/v1/users/context/ProvOrgName.sb?searchFilter=Alice' -H 'Accept: application/json' -H 'Content-Type: application/json' -u apimanager/Sally.Manager@myCompany.com:sally_password -k -i
Following are the sample results for this call. The user id appears in bold text:
"name":"myEmail@uk.ibm.com","validationLink":null,"id":"5c877e910cf29fd6e6c6e80b","context":"5c2cce2d0cf2a6345071d93a","idpId":"5c2cce290cf2a6345071d926","username":"myEmail@uk.ibm.com","email":"myEmail@uk.ibm.com","firstName":null,"lastName":null,"lastLoginTime":null,"phoneNumber":null,"status":"pending","url":"https://158.175.102.115/v1/users/5c877e910cf29fd6e6c6e80b"
Note: The Portal Administrator must remove the user from the Portal database.