POST/users/{userId}/move

Changes the domain of a member in the primary position to another domain, along with the member's external key, ID (primaryEmail) and team information.

Note

  • A member who has been deleted or the super admin cannot be relocated to another domain.
  • Email address used as an external linked account
    • A member who is authorized to use External Link cannot be relocated to a domain that does not support the feature.
    • If a member's email address that is used as an external linked account is updated, the external linked account is also automatically updated.
    • If the new email address contains prohibited keywords (NG WORD), add the previous email address as an email alias so that it can still be used as the external linked account.
  • The custom fields that are specified on the basis of the primary position's domain are deleted.

Caution

  • The following API operations must be called in the order they are listed: Add a member, Update a member, Update part of a member, and Relocate a member.

Authorization

oauth2

OAuth 2.0 authentication.
For more information, see Authentication and Authorization.

Scope

user
directory

HTTP Request

POSThttps://www.worksapis.com/v1.0/users/{userId}/move

Path Parameters

ParameterTypeDescription
userId string 

Member ID
- Email address
- Resource ID
- External key in "externalKey:{externalKey}" format


required
example : userf7da-f82c-4284-13e7-030f3b4c756x 

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
organizations array (UserOrganization) 

Team information


minItems : 1 
userExternalKey string 

Caution

For backward compatibility, the following priority applies:

  1. userExternalKey in the top-level path (root)
  2. organizations[].userExternalKey with primary=true
  3. The first organizations[].userExternalKey Customer's member external key %, \, #, /, ? are not allowed.

maxLength : 100
nullable : true 
preserveGroup boolean 

Indicates whether to keep the member's groups (default: false). If it is "false", the groups that the member belongs to are not kept after relocation. So, the member automatically gets out of their message rooms and can no longer see the previous conversation history. Set this parameter to "true" to keep the groups after relocation.


default : false 

UserOrganization

PropertyTypeDescription
domainId integer 

Domain ID


required
format : int32 
primary boolean 

Indicates whether it is the primary domain.

Make sure that you have one primary item (primary: true). If not specified, the first item automatically becomes primary.


required 
userExternalKey string 

Caution

  • It references the top-level userExternalKey value instead of organizations[].userExternalKey.
  • When a member is added, updated, or partially updated, the value is ignored even if it is passed.

Customer's member external key

Some special characters, %, \, #, /, ? are not allowed.


maxLength : 100
nullable : true 
email string 

Email address.
Use this parameter to set two different email addresses for the primary and secondary positions.
Neither "admin" nor "administrator" can be used as the localpart.


maxLength : 90 
levelId string 

Job level ID. Specify this parameter using the "Enable job levels" API operation.

  • Job level ID (levelId)
  • Job level's ExternalKey (externalKey:{levelExternalKey})

nullable : true 
orgUnits array (orgUnit) 

List of teams


minItems : 0
maxItems : 30 

orgUnit

PropertyTypeDescription
orgUnitId string 

Team ID

  • Team ID (orgUnitId)
  • Team's ExternalKey (externalKey:{orgUnitExternalKey})

required 
primary boolean 

Indicates whether it is the primary team.

Make sure that you have one primary item (primary: true). If not specified, the first item automatically becomes primary.


required 
positionId string 

Position ID. It is available only if usePosition of the "Enable Positions" API operation is "true". If not specified, "no position" applies.

  • Position ID (positionId)
  • Position's ExternalKey (externalKey:{positionExternalKey})

nullable : true 
isManager boolean 

Indicates whether the member is a team leader (default: false). If it is "true" and a team leader already exists, the member replaces them, and the previous team leader is relieved of their duties.


default : false 
visible boolean 

Indicates whether to make the member visible (default: true). It indicates whether to make the member visible in the organization chart.


default : true 
useTeamFeature boolean 

Indicates whether to use the team features (default: true). Use this parameter to restrict a member's use of the team features for security purposes, such as: receiving messages, sharing files and receiving team emails in the team's message room. If it is "true", the member can join the team's message room (Message/Note/Calendar/Folder) and use the following team features:

  • Receive email messages sent to the team.
  • Receive calendar events shared to the team.
  • View the team calendar.
  • View files in the drive shared to the team.
  • View boards with the permissions given to the team.
  • Respond to surveys of the team.
  • Become a member of the groups which the team belongs to. If it is "false", all the team features described above are disabled. To prevent the member from using the team features, set this parameter to "false".

default : true 

Request Example

example

1{2  "organizations": [3    {4      "domainId": 10000001,5      "primary": true,6      "email": "localpart@example.com",7      "levelId": "levelaa7-b824-4937-66af-042f1f43cefa",8      "orgUnits": [9        {10          "orgUnitId": "orgunitf-f27f-4af8-27e1-03817a911417",11          "primary": true,12          "positionId": "position-7027-4a02-b838-6f52b5e38db7",13          "isManager": true,14          "visible": true,15          "useTeamFeature": true16        }17      ]18    }19  ],20  "userExternalKey": null,21  "preserveGroup": false22}

Response

HTTP 204

No Content

HTTP 400

Bad Request

HTTP 404

Not Found