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.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive