Users: RemoveUserFromOffice

Removes a user from a single office. You specify the office from which you want to remove the user in the designatedOffice request body.

The user still maintains their other office, region, company, and account associations.

Note: You cannot remove a user from their default office. You must first assign the user a different default office by using the Users::updateUser method.

Permissions

You must have the correct Member Management permissions.

Rooms Version 5: canManageCompanyMembers must be set to true.

Rooms Version 6: You must have at least one of the following permissions set to true, depending on the level of the user that you want to add or remove:

  • canManageMemberLowerAccessLevel: Users can add or remove other users who have a lower access level than their own (in offices or regions that they oversee) from a region or office.
  • canManageMemberSameAccessLevel: Users can modify other users who have the same access level as their own (in offices or regions that they oversee or belong to) from a region or office.

Request

HTTP request

POST /v2/accounts/{accountId}/users/{userId}/remove_from_office

Parameters

Parameter NameValueDescription
Path Parameters
userIdinteger

(Required) The id of the user.

accountIdstring

(Required) The id of the account.

Request Body

designatedOffice

Responses

CodeDescriptionReference
204

User successfully removed from the office.

400

Bad request. See ErrorCode and Message for details

ApiError
401

Not authorized to make this request.

ApiError

SDK Method

Users::RemoveUserFromOffice

Definitions

ApiError

This object describes errors that occur. It is valid only for responses and ignored in requests.

errorCodestring

The code associated with the error condition.

messagestring

A brief message describing the error condition.

DesignatedOffice

This object contains information about the office that you want to add a member to or remove a member from.

officeIdinteger

(Required) The id of the office. This is the id that the system generated when you created the office.

}} />