Users: AddUserToOffice

Adds an existing user to a single office. You specify the office to which you want to add the user in the designatedOffice request body.

To add a user to multiple offices, you must make this call separately for each office.

Note: The accessLevel of the user that you are adding must be office.

Permissions

You must also 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 and remove other users who have a lower access level than their own (in offices or regions that they oversee) from a region or office. They can also modify those users.
  • canManageMemberSameAccessLevel: Users can add and remove 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. They can also modify those users.

Request

HTTP request

POST /restapi/v2/accounts/{accountId}/users/{userId}/add_to_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 added to the office.

400

Bad request. See ErrorCode and Message for details

ApiError
401

Not authorized to make this request.

ApiError

SDK Method

Users::AddUserToOffice

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.

}} />