Announcements
I'm looking for a way to use the Web API to disable a business unit and ultimately delete it if possible. I'm aware of the SetStateRequest in the SDK but was hoping for an equivalent Web API action/function. I can't seem to find anything helpful anywhere so hoping someone can help out. I'm suspecting it's not yet possible.
Thanks in advance!
Thanks for the share
Hi,
Thank you for your query.
You can simply update the isdisabled field to true of the Business Unit entity (there is no separate function available to set state in Web API).
Here is example request:
PATCH [Organization URI]/api/data/v9.0/businessunits(00000000-0000-0000-0000-000000000001)?$select=name,isdisabled HTTP/1.1 OData-MaxVersion: 4.0 OData-Version: 4.0 Accept: application/json Content-Type: application/json; charset=utf-8 Prefer: return=representation {"isdisabled":true}
You can also use delete (using DELETE) verb to remove the BU:
DELETE [Organization URI]/api/data/v9.0/businessunits(00000000-0000-0000-0000-000000000001) HTTP/1.1 Content-Type: application/json OData-MaxVersion: 4.0 OData-Version: 4.0
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156