Sample - Slack Web API
GET/oauth.token

Exchange an OAuth verifier code for a workspace token

Exchanges a temporary OAuth verifier code for a workspace token. Supply the code returned through the OAuth callback and the application credentials, and ensure redirect_uri matches the URI originally submitted when one was used. Use single_channel to request installation to a single channel when supported by the workspace app.

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

5 parameters
client_idstringoptional
Application identifier issued when the application was created.
client_secretstringoptional
Application secret issued when the application was created.
codestringoptional
Temporary verifier code returned through the OAuth callback.
redirect_uristringoptional
Redirect URI that must match the originally submitted URI when one was provided.
single_channelbooleanoptional
Set to true to request installation to a single channel.

2 status codes
200Returns an object with `ok` set to true confirming successful workspace token negotiation.
okbooleanrequired
Allowed:true
defaultReturned when the OAuth verifier, application credentials, redirect URI, or installation options are invalid; the response includes `ok` set to false.
okbooleanrequired
Allowed:false

Error handling

Use the code returned by the OAuth callback together with the client_id and client_secret issued for the application. If redirect_uri is supplied, it must exactly match the originally submitted URI; single_channel requests installation to a single channel.