Replace User Locations
Two operations share this endpoint, chosen by which field you send:
- Replace memberships — send
locations(an array of location UUIDs). The user’s memberships become exactly that set: anything not listed is removed. - Set the default location — send
defaultLocationId. Passnullor""to clear it.
If defaultLocationId is present in the body, that branch runs and locations is ignored, so do not send both in one call — make two calls.
location_ids is accepted as an alias for locations, matching the field name used by Provision Users.
For API-key callers locations must be present when you are replacing memberships: an omitted array would otherwise read as “remove everything”, so it is rejected instead. Sending an explicit empty array does clear every membership. Every id must belong to this workspace, and the target user must already be a member of it.
Requires the Advanced Location Based Assignment workspace feature, plus either CAN_ACCESS_LOCATIONS or CAN_EDIT_LOCATIONS on the key’s user.
Path Parameters
UUID of the workspace. Must be the workspace your API key is bound to.
UUID of the user whose location memberships are being replaced.
Body
The complete set of location UUIDs the user should belong to. Required for API-key callers when replacing memberships. Also accepted as location_ids.
Sets the user's default location. Send null or "" to clear it. When this field is present, locations is ignored.
Response
Memberships replaced — data is the user's resulting location ids. (On a defaultLocationId call, data is the user's workspace membership record instead.)