migration.exchange
method
We're still building and not all features are available quite yet. Enjoy this peek into the future!
Not ready for the future? Return to the past at api.slack.com.
Usage info
migration.exchange
Easily convert your vintage user IDs to Enterprise Grid-friendly global user IDs.
This method is best used in conjunction with turning off the translation layer for your app, as a bulk conversion step just after a workspace migrates to Enterprise Grid.
By providing a list of "local" user IDs associated with the same workspace as your token, you can exchange your IDs for "global" user IDs beginning with the letter W
or U
.
You can use any existing tokens authorized for the team to request for the user mappings.
The team_id
is only relevant when using an org-level token. This field will be ignored if the API call is sent using a workspace-level token.
The to_old
parameter is false
by default. When false
, the method returns a user_id_map
mapping from local user IDs to global user IDs. For a reverse mapping from global user IDs back to local user IDs, set to_old
to true
.
Response
The method may only be used on workspaces that have migrated to enterprise. When used on typical workspaces, a not_enterprise_team
error is thrown.
Additional nuance
Users that were already part of a workspace migrating to Enterprise Grid have two user IDs: a local user ID and a global user ID. Users that are created post-migration or on workspaces that are created after migration have only global user IDs.
When using this method and attempting to convert a global user ID to a local user ID and that corresponding user only has a global user ID, you'll receive the global user ID on both sides of the map.
Providing invalid users or user IDs not belonging to the related workspace will result with those IDs being listed in an invalid_user_ids
array.