Retrieve the saved Slack access token and ID token for a member. After a successful OAuth login, Stytch will save the issued access token and ID token from the identity provider.
Get Slack Access Token
Path parameters
Globally unique UUID that identifies a specific Organization. The organization_id is critical to perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id here as a convenience.
Globally unique UUID that identifies a specific Member. The member_id is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member.
Response fields
Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
Denotes the OAuth identity provider that the user has authenticated with, e.g. Google, Microsoft, GitHub etc.
A list of tokens the member is registered with.
The unique identifier for the User within a given OAuth provider. Also commonly called the sub or "Subject field" in OAuth protocols.
The tenant ID returned by the OAuth provider. This is typically used to identify an organization or group within the provider's domain. For example, in HubSpot this is a Hub ID, in Slack this is the Workspace ID, and in GitHub this is an organization ID. This field will only be populated if exactly one tenant ID is returned from a successful OAuth authentication and developers should prefer provider_tenant_ids over this since it accounts for the possibility of an OAuth provider yielding multiple tenant IDs.
The access_token that you may use to access the User's data in the provider's API.
The OAuth scopes included for a given provider. See each provider's section above to see which scopes are included by default and how to add custom scopes.
The access_token that you may use to access data as a bot application in Slack. Use in conjunction with bot_scopes.
The scopes that the bot application has access to in Slack.
const stytch = require('stytch');
const client = new stytch.B2BClient({
project_id: 'PROJECT_ID',
secret: 'SECRET',
});
const params = {
organization_id: "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
member_id: "member-test-32fc5024-9c09-4da3-bd2e-c9ce4da9375f",
};
client.organizations.members.oauthProviders.slack(params)
.then(resp => { console.log(resp) })
.catch(err => { console.log(err) });
{
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"status_code": 200,
"provider_type": "Slack",
"registrations": [
"provider_subject": "10769150350006150715113082367",
"provider_tenant_id": "1234567",
"access_token": "eyJ...",
"access_token_expires_in": 3600,
"scopes": ["read:users", "write:users"]
"bot_access_token": "eyJ...",
"bot_scopes": ["read:bots"]
]
}
{
"status_code": 401,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "unauthorized_credentials",
"error_message": "Unauthorized credentials.",
"error_url": "https://stytch.com/docs/api/errors/401"
}
{
"status_code": 429,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "too_many_requests",
"error_message": "Too many requests have been made.",
"error_url": "https://stytch.com/docs/api/errors/429"
}
{
"status_code": 500,
"request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
"error_type": "internal_server_error",
"error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
"error_url": "https://stytch.com/docs/api/errors/500"
}