ユーザーの配置転換
POST /users/{userId}/move
ユーザーを同テナント内の異なるドメインに移動し、ユーザーの ExternalKey、email、組織情報を一括で変更します。
転換時に引き継がれる情報については以下の通りです。
トークの引き継ぎ
- 転換するとトークも引き継がれます。ただし、グループ/組織/外部トーク連携のトークルームについてはそれぞれの引き継ぎ条件に従います。
グループの引き継ぎ
- 参加中のグループ (グループトーク含む) を引き継ぐ場合、preserveGroup に true を指定します 。
組織の引き継ぎ
- 所属している組織 (組織トーク含む) を引き継ぐ場合、organizations リストに該当の domain 情報を含め、かつ、所属していた組織の orgUnitId を設定します。
外部トーク連携の引き継ぎ
- 外部ユーザーとのトークルームを移行するには、対象のユーザーが転換元/先の両方で外部連携権限を持つことが必要です。
- 外部トーク連携 IDとして使用されているユーザーの email が更新された場合、外部トーク連携 ID も自動的に更新される。
- このとき、新しい email に禁止ワードが含まれている場合、以前の email をサブメールアドレスとして登録し、外部トーク連携 ID として継続利用する。
監査ログの引き継ぎ
- トーク履歴含め、監査ログは移行されません。
その他ユーザーデータの引き継ぎ
- ユーザーが持つ各データ (カレンダー、タスク、連絡先など) も一緒に引き継がれます。
制限
- 削除中のユーザーまたは最高管理者は配置転換できません。
- 転換元ドメインのカスタムフィールドは削除されます。
注意
- ユーザーの登録/更新/部分更新/配置転換 API は、同じユーザーに対しては同時に呼び出してはならず、順番通りに呼び出すことを推奨します。
Authorization
oauth2
Access Token を指定します。
指定の方法や Access Token の取得方法は 共通仕様 を参照してください。
Scope
user
directory
Request
HTTP Request
POST
https://www.worksapis.com/v1.0/users/{userId}/move
Path Parameters
Parameter | Type | Description |
---|---|---|
userId | string | ユーザーを特定する ID (URL エンコードする)
required example : userf7da-f82c-4284-13e7-030f3b4c756x |
Header Parameters
Header | type | Description |
---|---|---|
Authorization | string | Bearer {token} required |
Content-Type | string | application/json required example : application/json |
Request Body
Property | Type | Description |
---|---|---|
organizations | array (UserOrganization) | 組織情報 minItems : 1 |
preserveGroup | boolean | 参加グループの維持の可否 (既定値: false)この値が false の場合、ユーザーが所属していたグループは配置転換後に維持されない。したがって、ユーザーは利用中のトークルームから退室し、それまでのトーク内容を確認できなくなる。配置転換後も参加グループを維持するには、この値を true に設定する。 default : false |
UserOrganization
Property | Type | Description |
---|---|---|
domainId | integer | ドメイン ID required format : int32 |
primary | boolean | 代表ドメインフラグ required |
userExternalKey | string | ユーザーの ExternalKey"%"、"\"、"#"、"/"、"?" の特殊文字は利用不可。 maxLength : 100 nullable : true |
string | メールアドレス maxLength : 90 | |
levelId | string | 職級 ID
nullable : true |
orgUnits | array (orgUnit) | 組織リスト minItems : 0 maxItems : 30 |
orgUnit
Property | Type | Description |
---|---|---|
orgUnitId | string | 組織 ID
required |
primary | boolean | 代表組織フラグ required |
positionId | string | 役職 ID
nullable : true |
isManager | boolean | 組織長フラグ (既定値: false) default : false |
visible | boolean | ユーザー公開フラグ (既定値: true) default : true |
useTeamFeature | boolean | 組織のトークルーム機能の利用フラグ (既定値: true)
default : true |
Request Example
example
1{
2 "organizations": [
3 {
4 "domainId": 10000001,
5 "primary": true,
6 "userExternalKey": null,
7 "email": "localpart@example.com",
8 "levelId": "levelaa7-b824-4937-66af-042f1f43cefa",
9 "orgUnits": [
10 {
11 "orgUnitId": "orgunitf-f27f-4af8-27e1-03817a911417",
12 "primary": true,
13 "positionId": "position-7027-4a02-b838-6f52b5e38db7",
14 "isManager": true,
15 "visible": true,
16 "useTeamFeature": true
17 }
18 ]
19 }
20 ],
21 "preserveGroup": false
22}
Response
HTTP 204
No Content
HTTP 400
Bad Request
HTTP 404
Not Found