Sample - Slack Web API
GET/migration.exchange

Exchange workspace and global user IDs

Maps workspace-specific user IDs to global user IDs for an Enterprise Grid workspace. Supply up to 400 comma-separated user IDs in users, and use to_old to request conversion from global IDs back to workspace-specific IDs. Include team_id when using an organization token to identify the workspace.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

4 parameters
tokenstringrequired
Authentication token with the `tokens.basic` scope.
usersstringrequired
Comma-separated user IDs to map, with a maximum of 400 IDs per request.
team_idstringoptional
Workspace identifier beginning with `T`, used with an organization token.
to_oldbooleanoptional
Set to true to convert global `W` user IDs to workspace-specific `U` IDs. Defaults to false when omitted.

2 status codes
200Returns `ok` set to true, the `team_id` and `enterprise_id`, a `user_id_map` containing the requested mappings, and an `invalid_user_ids` list when applicable.
enterprise_idstringrequired
invalid_user_idsarray<string>optional
okbooleanrequired
Allowed:true
team_idstringrequired
user_id_mapobjectoptional
defaultReturned when the request is not for an Enterprise Grid workspace, contains too many users, lacks valid authentication or permission, or has invalid arguments; the response includes `ok` set to false and an `error` reason.
callstackstringoptional
Note: PHP callstack is only visible in dev/qa
errorstringrequired
Allowed:not_enterprise_teamtoo_many_usersnot_authedinvalid_authaccount_inactivetoken_revokedno_permissionorg_login_requiredinvalid_arg_nameinvalid_array_arginvalid_charsetinvalid_form_data
okbooleanrequired
Allowed:false

Error handling

The token must include the tokens.basic scope, and users must contain no more than 400 comma-separated user IDs. When using an organization token, team_id must identify a team beginning with T; set to_old to true only when converting global IDs to workspace-specific IDs.