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
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 296 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 614 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 53 App Studio
- 40 Variables
- 677 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 45 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 32 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive