Delete User API
We need to remove more than 200 users in our instance and we want to do this in bulk. For that we thought on calling the User API via scripting so it could execute quickly.
However, the API is returning an error 400 referring that the user owns datasets and therefore can't be deleted. We already have confirmed that the user does not own anything in our instance so is there a problem with this request?
Thank you
Answers
-
Do they own anything else besides a dataset like a view, fusion or dataflow?
Have you tried utilizing the CLI tool and the swap-owner command to try and swap anything they might have over to a new user?
https://domohelp.domo.com/hc/en-us/articles/360043437733-Command-Line-Interface-CLI-Tool
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
@GrantSmith we have just tried the swap-owner command in JavaCLI and it moved everything for the new user (which was nothing because the user we want to delete does not have anything) and we still can't delete it.
Maybe the API suffered some changes, we followed the documentation here: https://developer.domo.com/docs/users-api-reference/users-2#Delete%20a%20user
0 -
this question was the inspiration for a tutorial:
to just get datasets owned by a specific user, just hit that query API with the body
{"entities":["DATASET"],"filters":[{"filterType":"term","field":"owned_by_id","value":"1527841788:USER","name":"George Read","not":false}],"combineResults":true,"query":"*","count":30,"offset":0,"sort":{"isRelevance":false,"fieldSorts":[{"field":"create_date","sortOrder":"DESC"}]}}
then to alter permissions. hit the Permissions API. set the owner to 'can share' or 'no access'. then set a new owner to the dataaset
{ "type": "USER", "id": "1893952720", "accessLevel": "OWNER" }
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
Categories
- 11K All Categories
- 5 Private Company Board
- 2 APAC User Group
- 12 Welcome
- 42 Domo News
- 9.9K Using Domo
- 2K Dataflows
- 2.5K Card Building
- 2.2K Ideas Exchange
- 1.2K Connectors
- 349 Workbench
- 266 Domo Best Practices
- 11 Domo Certification
- 474 Domo Developer
- 51 Domo Everywhere
- 110 Apps
- 725 New to Domo
- 85 Dojo
- Domopalooza
- 1.1K 日本支部
- 4 道場-日本支部へようこそ
- 28 お知らせ
- 65 Kowaza
- 301 仲間に相談
- 662 ひらめき共有