slackline/api/oauth
This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.
Slack Web API methods for the OAuth installation flow and token rotation.
Types
A successful response from oauth.access.
pub type AccessResponse {
AccessResponse(
access_token: option.Option(String),
token_type: option.Option(String),
scope: option.Option(String),
user_id: option.Option(String),
team_name: option.Option(String),
team_id: option.Option(String),
enterprise_id: option.Option(String),
incoming_webhook: option.Option(OAuthIncomingWebhook),
bot: option.Option(OAuthLegacyBot),
app_id: option.Option(String),
app_user_id: option.Option(String),
authorizing_user: option.Option(OAuthWorkspaceAppUser),
installer_user: option.Option(OAuthWorkspaceAppUser),
scopes: option.Option(dict.Dict(String, List(String))),
)
}
Constructors
-
AccessResponse( access_token: option.Option(String), token_type: option.Option(String), scope: option.Option(String), user_id: option.Option(String), team_name: option.Option(String), team_id: option.Option(String), enterprise_id: option.Option(String), incoming_webhook: option.Option(OAuthIncomingWebhook), bot: option.Option(OAuthLegacyBot), app_id: option.Option(String), app_user_id: option.Option(String), authorizing_user: option.Option(OAuthWorkspaceAppUser), installer_user: option.Option(OAuthWorkspaceAppUser), scopes: option.Option(dict.Dict(String, List(String))), )Arguments
- access_token
-
The access token.
- token_type
-
The token type.
appfor legacy workspace apps. - scope
-
Comma-separated scopes granted.
- user_id
-
The ID of the authorizing user.
- team_name
-
The workspace name.
- team_id
-
The workspace ID.
- enterprise_id
-
The Enterprise organization ID, or
null. - incoming_webhook
-
The incoming webhook, when the
incoming-webhookscope was granted. - bot
-
The bot user and token, when the
botscope was granted. - app_id
-
The app ID, for legacy workspace apps.
- app_user_id
-
The app’s user ID, for legacy workspace apps.
- authorizing_user
-
The authorizing user, for legacy workspace apps.
- installer_user
-
The installing user, for legacy workspace apps.
- scopes
-
Granted scopes by context (
app_home,team,channel, …), for legacy workspace apps.
The user who authorized the app, with their user token when user scopes were granted.
pub type OAuthAuthedUser {
OAuthAuthedUser(
id: String,
scope: option.Option(String),
access_token: option.Option(String),
token_type: option.Option(String),
expires_in: option.Option(Int),
refresh_token: option.Option(String),
)
}
Constructors
-
OAuthAuthedUser( id: String, scope: option.Option(String), access_token: option.Option(String), token_type: option.Option(String), expires_in: option.Option(Int), refresh_token: option.Option(String), )Arguments
- id
-
The user ID.
- scope
-
Comma-separated user scopes granted.
- access_token
-
The user token.
- token_type
-
The token type,
user. - expires_in
-
Seconds until
access_tokenexpires, when token rotation is enabled. - refresh_token
-
The refresh token for
access_token, when token rotation is enabled.
The Enterprise organization an app was installed on, if any.
pub type OAuthEnterprise {
OAuthEnterprise(id: String, name: option.Option(String))
}
Constructors
-
OAuthEnterprise(id: String, name: option.Option(String))Arguments
- id
-
The Enterprise organization ID.
- name
-
The Enterprise organization name.
An incoming webhook created during installation with the incoming-webhook
scope.
pub type OAuthIncomingWebhook {
OAuthIncomingWebhook(
channel: option.Option(String),
channel_id: option.Option(String),
configuration_url: option.Option(String),
url: option.Option(String),
)
}
Constructors
-
OAuthIncomingWebhook( channel: option.Option(String), channel_id: option.Option(String), configuration_url: option.Option(String), url: option.Option(String), )Arguments
- channel
-
The name of the channel the user selected for messages.
- channel_id
-
The ID of the same channel.
- configuration_url
-
A link to the webhook’s configuration page.
- url
-
The incoming webhook URL.
The bot user and token from a legacy oauth.access request for the bot
scope.
pub type OAuthLegacyBot {
OAuthLegacyBot(
bot_user_id: option.Option(String),
bot_access_token: option.Option(String),
)
}
Constructors
-
OAuthLegacyBot( bot_user_id: option.Option(String), bot_access_token: option.Option(String), )Arguments
- bot_user_id
-
The bot user ID.
- bot_access_token
-
The bot token.
The workspace an app was installed on. null for org-level installations.
pub type OAuthTeam {
OAuthTeam(id: String, name: option.Option(String))
}
Constructors
-
OAuthTeam(id: String, name: option.Option(String))Arguments
- id
-
The workspace ID.
- name
-
The workspace name.
A token response from oauth.v2.access, oauth.v2.exchange and
oauth.v2.user.access.
pub type OAuthV2AccessResponse {
OAuthV2AccessResponse(
access_token: option.Option(String),
token_type: option.Option(String),
scope: option.Option(String),
bot_user_id: option.Option(String),
app_id: option.Option(String),
expires_in: option.Option(Int),
refresh_token: option.Option(String),
team: option.Option(OAuthTeam),
enterprise: option.Option(OAuthEnterprise),
is_enterprise_install: option.Option(Bool),
authed_user: option.Option(OAuthAuthedUser),
incoming_webhook: option.Option(OAuthIncomingWebhook),
id_token: option.Option(String),
warning: option.Option(String),
response_metadata: option.Option(slackline.ResponseMetadata),
)
}
Constructors
-
OAuthV2AccessResponse( access_token: option.Option(String), token_type: option.Option(String), scope: option.Option(String), bot_user_id: option.Option(String), app_id: option.Option(String), expires_in: option.Option(Int), refresh_token: option.Option(String), team: option.Option(OAuthTeam), enterprise: option.Option(OAuthEnterprise), is_enterprise_install: option.Option(Bool), authed_user: option.Option(OAuthAuthedUser), incoming_webhook: option.Option(OAuthIncomingWebhook), id_token: option.Option(String), warning: option.Option(String), response_metadata: option.Option(slackline.ResponseMetadata), )Arguments
- access_token
-
The bot token (or the user token, for
oauth.v2.user.access). - token_type
-
The type of
access_token:botoruser. - scope
-
Comma-separated scopes granted to
access_token. - bot_user_id
-
The bot user ID.
- app_id
-
The app ID.
- expires_in
-
Seconds until
access_tokenexpires, when token rotation is enabled. - refresh_token
-
The refresh token for
access_token, when token rotation is enabled. - team
-
The workspace.
nullfor org-level installations. - enterprise
-
The Enterprise organization, or
null. - is_enterprise_install
-
Whether the app was installed on an entire organization.
- authed_user
-
The installing user and their user token.
- incoming_webhook
-
The incoming webhook, when the
incoming-webhookscope was granted. - id_token
-
An OpenID Connect ID token, from
oauth.v2.user.accesswith theopenidscope. - warning
-
A warning such as
slackbot_mcp_unavailable. Installation still succeeded.
A user from a legacy workspace app oauth.access response.
pub type OAuthWorkspaceAppUser {
OAuthWorkspaceAppUser(
user_id: option.Option(String),
app_home: option.Option(String),
)
}
Constructors
-
OAuthWorkspaceAppUser( user_id: option.Option(String), app_home: option.Option(String), )Arguments
- user_id
-
The user ID.
- app_home
-
The ID of the user’s App Home conversation.
Identifies oauth.v2.access in the slackline.Call that v2_access
returns.
pub type V2Access
Identifies oauth.v2.beginShortTokenRotation in the slackline.Call that
v2_begin_short_token_rotation returns.
pub type V2BeginShortTokenRotation
A successful response from oauth.v2.beginShortTokenRotation.
pub type V2BeginShortTokenRotationResponse {
V2BeginShortTokenRotationResponse(new_token: String)
}
Constructors
-
V2BeginShortTokenRotationResponse(new_token: String)Arguments
- new_token
-
The new token. It is not active until the rotation is completed.
Identifies oauth.v2.completeShortTokenRotation in the slackline.Call
that v2_complete_short_token_rotation returns.
pub type V2CompleteShortTokenRotation
A successful response from oauth.v2.completeShortTokenRotation.
pub type V2CompleteShortTokenRotationResponse {
V2CompleteShortTokenRotationResponse(token: String)
}
Constructors
-
V2CompleteShortTokenRotationResponse(token: String)Arguments
- token
-
The now active token. The original token is invalidated.
Identifies oauth.v2.exchange in the slackline.Call that v2_exchange
returns.
pub type V2Exchange
Identifies oauth.v2.user.access in the slackline.Call that
v2_user_access returns.
pub type V2UserAccess
Values
pub fn access() -> slackline.Call(Access, AccessResponse)
oauth.access:
Exchanges a temporary OAuth verifier code for an access token.
oauth.Access identifies this method in slackline.Call.
Set optional arguments with the functions in slackline/api/oauth/access.
Rate limit tier: t4.
Documented errors: bad_client_secret, bad_redirect_uri,
code_already_used, invalid_client_id, invalid_code, invalid_token,
missing_resource, oauth_authorization_url_mismatch,
user_email_unverified.
pub fn access_response_decoder() -> decode.Decoder(AccessResponse)
Decodes the response from oauth.access.
pub fn oauth_authed_user_decoder() -> decode.Decoder(
OAuthAuthedUser,
)
Decodes OAuthAuthedUser from json.
pub fn oauth_authed_user_to_json(
it: OAuthAuthedUser,
) -> json.Json
Encodes OAuthAuthedUser as json.
pub fn oauth_enterprise_decoder() -> decode.Decoder(
OAuthEnterprise,
)
Decodes OAuthEnterprise from json.
pub fn oauth_enterprise_to_json(it: OAuthEnterprise) -> json.Json
Encodes OAuthEnterprise as json.
pub fn oauth_incoming_webhook_decoder() -> decode.Decoder(
OAuthIncomingWebhook,
)
Decodes OAuthIncomingWebhook from json.
pub fn oauth_incoming_webhook_to_json(
it: OAuthIncomingWebhook,
) -> json.Json
Encodes OAuthIncomingWebhook as json.
pub fn oauth_legacy_bot_decoder() -> decode.Decoder(
OAuthLegacyBot,
)
Decodes OAuthLegacyBot from json.
pub fn oauth_legacy_bot_to_json(it: OAuthLegacyBot) -> json.Json
Encodes OAuthLegacyBot as json.
pub fn oauth_team_decoder() -> decode.Decoder(OAuthTeam)
Decodes OAuthTeam from json.
pub fn oauth_v2_access_response_decoder() -> decode.Decoder(
OAuthV2AccessResponse,
)
Decodes OAuthV2AccessResponse from json.
pub fn oauth_v2_access_response_to_json(
it: OAuthV2AccessResponse,
) -> json.Json
Encodes OAuthV2AccessResponse as json.
pub fn oauth_workspace_app_user_decoder() -> decode.Decoder(
OAuthWorkspaceAppUser,
)
Decodes OAuthWorkspaceAppUser from json.
pub fn oauth_workspace_app_user_to_json(
it: OAuthWorkspaceAppUser,
) -> json.Json
Encodes OAuthWorkspaceAppUser as json.
pub fn v2_access() -> slackline.Call(
V2Access,
OAuthV2AccessResponse,
)
oauth.v2.access:
Exchanges a temporary OAuth verifier code for an access token.
oauth.V2Access identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/oauth/v2_access.
Rate limit tier: t5.
Documented errors: bad_client_secret, bad_redirect_uri,
cannot_install_an_org_installed_app, invalid_client_id, invalid_code,
invalid_code_verifier, invalid_grant_type, invalid_refresh_token,
no_scopes, oauth_authorization_url_mismatch, pkce_not_allowed,
preview_feature_not_available, user_email_unverified.
pub fn v2_begin_short_token_rotation(
client_id client_id: String,
client_secret client_secret: String,
) -> slackline.Call(
V2BeginShortTokenRotation,
V2BeginShortTokenRotationResponse,
)
oauth.v2.beginShortTokenRotation:
Begins rotating the secret on an API token with a short secret.
oauth.V2BeginShortTokenRotation identifies this method in
slackline.Call.
Rate limit tier: t2.
Documented errors: bad_client_secret, invalid_client_id,
invalid_token, token_too_long.
pub fn v2_begin_short_token_rotation_response_decoder() -> decode.Decoder(
V2BeginShortTokenRotationResponse,
)
Decodes the response from oauth.v2.beginShortTokenRotation.
pub fn v2_complete_short_token_rotation(
client_id client_id: String,
client_secret client_secret: String,
new_token new_token: String,
) -> slackline.Call(
V2CompleteShortTokenRotation,
V2CompleteShortTokenRotationResponse,
)
oauth.v2.completeShortTokenRotation:
Finishes rotating the secret on an API token with a short secret.
oauth.V2CompleteShortTokenRotation identifies this method in
slackline.Call.
Rate limit tier: t2.
Documented errors: bad_client_secret, invalid_client_id,
invalid_token, rotation_not_found, token_too_long.
pub fn v2_complete_short_token_rotation_response_decoder() -> decode.Decoder(
V2CompleteShortTokenRotationResponse,
)
Decodes the response from oauth.v2.completeShortTokenRotation.
pub fn v2_exchange(
client_id client_id: String,
client_secret client_secret: String,
) -> slackline.Call(V2Exchange, OAuthV2AccessResponse)
oauth.v2.exchange:
Exchanges a legacy access token for a new expiring access token and refresh
token
oauth.V2Exchange identifies this method in slackline.Call.
Rate limit tier: t3.
Documented errors: authorization_not_found, bad_client_secret,
invalid_client_id, invalid_token, token_already_exchanged,
token_rotation_not_enabled.
pub fn v2_user_access() -> slackline.Call(
V2UserAccess,
OAuthV2AccessResponse,
)
oauth.v2.user.access:
Exchanges a temporary OAuth verifier code for a user access token.
oauth.V2UserAccess identifies this method in slackline.Call.
Set optional arguments with the functions in
slackline/api/oauth/v2_user_access.
Rate limit tier: t5.
Documented errors: app_not_admin_approved, app_not_org_installed,
bad_client_secret, bad_redirect_uri,
cannot_install_an_org_installed_app, client_id_mismatch, ema_disabled,
ema_issuer_mismatch, ema_tenant_mismatch, invalid_aud_tenant,
invalid_audience, invalid_client_id, invalid_code, invalid_email,
invalid_grant_type, invalid_issuer, invalid_jti,
invalid_refresh_token, invalid_resource, invalid_scope, invalid_sub,
invalid_sub_id_format, missing_audience, missing_client_id,
no_app_scopes_requested, no_approved_scopes_requested, no_assertion,
no_idp_config_for_entity_id, no_scopes, no_user_scopes,
not_implemented, oauth_authorization_url_mismatch,
preview_feature_not_available, user_email_unverified,
user_not_authenticated.