slackline/api/admin/users

This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.

Admin API methods for managing users, guests and sessions across an org.

Types

Identifies admin.users.access.pause in the slackline.Call that access_pause returns.

pub type AccessPause

A successful response from admin.users.access.pause.

pub type AccessPauseResponse {
  AccessPauseResponse(
    invalid_users: option.Option(List(InvalidAccessUser)),
  )
}

Constructors

  • AccessPauseResponse(
      invalid_users: option.Option(List(InvalidAccessUser)),
    )

    Arguments

    invalid_users

    Users that were rejected. Empty when every user was queued.

Identifies admin.users.access.resume in the slackline.Call that access_resume returns.

pub type AccessResume

A successful response from admin.users.access.resume.

pub type AccessResumeResponse {
  AccessResumeResponse(
    invalid_users: option.Option(List(InvalidAccessUser)),
  )
}

Constructors

  • AccessResumeResponse(
      invalid_users: option.Option(List(InvalidAccessUser)),
    )

    Arguments

    invalid_users

    Users that were rejected. Empty when every user was queued.

An active user session.

pub type ActiveSession {
  ActiveSession(
    user_id: String,
    team_id: option.Option(String),
    session_id: Int,
    recent: option.Option(SessionDevice),
    created: option.Option(SessionDevice),
  )
}

Constructors

  • ActiveSession(
      user_id: String,
      team_id: option.Option(String),
      session_id: Int,
      recent: option.Option(SessionDevice),
      created: option.Option(SessionDevice),
    )

    Arguments

    recent

    The most recent version of the session. Missing when the session has not changed since it was created.

    created

    The original version of the session.

A user, as listed by admin.users.list.

pub type AdminUser {
  AdminUser(
    id: String,
    email: option.Option(String),
    is_admin: option.Option(Bool),
    is_owner: option.Option(Bool),
    is_primary_owner: option.Option(Bool),
    is_restricted: option.Option(Bool),
    is_ultra_restricted: option.Option(Bool),
    is_bot: option.Option(Bool),
    username: option.Option(String),
    full_name: option.Option(String),
    is_active: option.Option(Bool),
    date_created: option.Option(Int),
    deactivated_ts: option.Option(Int),
    expiration_ts: option.Option(Int),
    workspaces: option.Option(List(String)),
    has_2fa: option.Option(Bool),
    has_sso: option.Option(Bool),
  )
}

Constructors

Identifies admin.users.assign in the slackline.Call that assign returns.

pub type Assign

Identifies admin.users.deactivate in the slackline.Call that deactivate returns.

pub type Deactivate

Identifies admin.users.getExpiration in the slackline.Call that get_expiration returns.

pub type GetExpiration

A successful response from admin.users.getExpiration.

pub type GetExpirationResponse {
  GetExpirationResponse(user: GuestExpiration)
}

Constructors

The expiration details of a guest user.

pub type GuestExpiration {
  GuestExpiration(
    id: String,
    email: option.Option(String),
    is_restricted: option.Option(Bool),
    is_ultra_restricted: option.Option(Bool),
    expiration_ts: option.Option(Int),
  )
}

Constructors

  • GuestExpiration(
      id: String,
      email: option.Option(String),
      is_restricted: option.Option(Bool),
      is_ultra_restricted: option.Option(Bool),
      expiration_ts: option.Option(Int),
    )

    Arguments

    expiration_ts

    When the guest account expires, in Unix seconds. 0 means never.

A user whose access could not be paused or resumed.

pub type InvalidAccessUser {
  InvalidAccessUser(
    user_id: String,
    reason: option.Option(String),
  )
}

Constructors

  • InvalidAccessUser(user_id: String, reason: option.Option(String))

    Arguments

    reason

    Why the user was rejected, such as user_not_frontline_member.

Identifies admin.users.invite in the slackline.Call that invite returns.

pub type Invite

Identifies admin.users.list in the slackline.Call that list returns.

pub type ListMethod

A successful response from admin.users.list.

pub type ListResponse {
  ListResponse(
    users: option.Option(List(AdminUser)),
    response_metadata: option.Option(slackline.ResponseMetadata),
  )
}

Constructors

Identifies admin.users.remove in the slackline.Call that remove returns.

pub type Remove

Identifies admin.users.session.clearSettings in the slackline.Call that session_clear_settings returns.

pub type SessionClearSettings

Device details of a session, at creation or most recently.

pub type SessionDevice {
  SessionDevice(
    device_hardware: option.Option(String),
    os: option.Option(String),
    os_version: option.Option(String),
    slack_client_version: option.Option(String),
    ip: option.Option(String),
  )
}

Constructors

  • SessionDevice(
      device_hardware: option.Option(String),
      os: option.Option(String),
      os_version: option.Option(String),
      slack_client_version: option.Option(String),
      ip: option.Option(String),
    )

    Arguments

    device_hardware

    The type of device for the session.

    os

    The operating system for the device.

    os_version

    The version of the OS.

    slack_client_version

    The version of the Slack client, if available.

    ip

    The IP address for the session.

Identifies admin.users.session.getSettings in the slackline.Call that session_get_settings returns.

pub type SessionGetSettings

A successful response from admin.users.session.getSettings.

pub type SessionGetSettingsResponse {
  SessionGetSettingsResponse(
    session_settings: option.Option(List(UserSessionSettings)),
    no_settings_applied: option.Option(List(String)),
  )
}

Constructors

  • SessionGetSettingsResponse(
      session_settings: option.Option(List(UserSessionSettings)),
      no_settings_applied: option.Option(List(String)),
    )

    Arguments

    session_settings

    Settings of users that have active sessions.

    no_settings_applied

    IDs of users with no session settings applied.

Identifies admin.users.session.invalidate in the slackline.Call that session_invalidate returns.

pub type SessionInvalidate

Identifies admin.users.session.list in the slackline.Call that session_list returns.

pub type SessionList

A successful response from admin.users.session.list.

pub type SessionListResponse {
  SessionListResponse(
    active_sessions: option.Option(List(ActiveSession)),
    response_metadata: option.Option(slackline.ResponseMetadata),
  )
}

Constructors

Identifies admin.users.session.reset in the slackline.Call that session_reset returns.

pub type SessionReset

Identifies admin.users.session.resetBulk in the slackline.Call that session_reset_bulk returns.

pub type SessionResetBulk

Identifies admin.users.session.setSettings in the slackline.Call that session_set_settings returns.

pub type SessionSetSettings

Identifies admin.users.setAdmin in the slackline.Call that set_admin returns.

pub type SetAdmin

Identifies admin.users.setExpiration in the slackline.Call that set_expiration returns.

pub type SetExpiration

Identifies admin.users.setOwner in the slackline.Call that set_owner returns.

pub type SetOwner

Identifies admin.users.setRegular in the slackline.Call that set_regular returns.

pub type SetRegular

Identifies admin.users.unsupportedVersions.export in the slackline.Call that unsupported_versions_export returns.

pub type UnsupportedVersionsExport

The session settings of a user.

pub type UserSessionSettings {
  UserSessionSettings(
    user_id: String,
    desktop_app_browser_quit: option.Option(Bool),
    duration: option.Option(Int),
  )
}

Constructors

  • UserSessionSettings(
      user_id: String,
      desktop_app_browser_quit: option.Option(Bool),
      duration: option.Option(Int),
    )

    Arguments

    desktop_app_browser_quit

    Whether the session ends when the desktop app or browser is closed.

    duration

    The session duration, in seconds.

Values

pub fn access_pause(
  user_ids user_ids: List(String),
) -> slackline.Call(AccessPause, AccessPauseResponse)

admin.users.access.pause: Pause access across the organization for up to 1,000 frontline members. Success means the request was queued, not that all updates have completed.

users.AccessPause identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/access_pause.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: failed_for_all_users, failed_for_some_users, failed_job_enqueue, feature_not_enabled, restricted_action.

pub fn access_pause_response_decoder() -> decode.Decoder(
  AccessPauseResponse,
)

Decodes the response from admin.users.access.pause.

pub fn access_resume(
  user_ids user_ids: List(String),
) -> slackline.Call(AccessResume, AccessResumeResponse)

admin.users.access.resume: Resume access across the organization for up to 1,000 frontline members. Success means the request was queued, not that all updates have completed.

users.AccessResume identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/access_resume.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: failed_for_all_users, failed_for_some_users, failed_job_enqueue, restricted_action.

pub fn access_resume_response_decoder() -> decode.Decoder(
  AccessResumeResponse,
)

Decodes the response from admin.users.access.resume.

pub fn active_session_decoder() -> decode.Decoder(ActiveSession)

Decodes ActiveSession from json.

pub fn active_session_to_json(it: ActiveSession) -> json.Json

Encodes ActiveSession as json.

pub fn admin_user_decoder() -> decode.Decoder(AdminUser)

Decodes AdminUser from json.

pub fn admin_user_to_json(it: AdminUser) -> json.Json

Encodes AdminUser as json.

pub fn assign(
  team_id team_id: String,
  user_id user_id: String,
) -> slackline.Call(Assign, Nil)

admin.users.assign: Add an Enterprise user to a workspace.

users.Assign identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/assign.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: feature_not_enabled, invalid_role_for_user, invited_user_not_created, invited_user_not_reactivated, inviter_email_not_verified, invitor_cannot_see_channel, not_an_admin, team_not_found, too_many_channels, user_already_team_member, user_cannot_be_added_to_workspace, user_is_bot, user_not_found.

pub fn deactivate(
  user_id user_id: String,
) -> slackline.Call(Deactivate, Nil)

admin.users.deactivate: Deactivate a user from an enterprise organization and all its workspaces.

users.Deactivate identifies this method in slackline.Call.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: deactivation_failed, invalid_user, restricted_action, user_is_team_primary_owner, user_not_found.

pub fn get_expiration(
  user_id user_id: String,
) -> slackline.Call(GetExpiration, GetExpirationResponse)

admin.users.getExpiration: Fetches the expiration timestamp for a guest.

users.GetExpiration identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/get_expiration.

User token scopes: admin.users:read.

Rate limit tier: t4.

Documented errors: no_perms, not_permitted, paid_teams_only, target_team_not_on_org, team_not_found, user_is_not_guest, user_not_found.

pub fn get_expiration_response_decoder() -> decode.Decoder(
  GetExpirationResponse,
)

Decodes the response from admin.users.getExpiration.

pub fn guest_expiration_decoder() -> decode.Decoder(
  GuestExpiration,
)

Decodes GuestExpiration from json.

pub fn guest_expiration_to_json(it: GuestExpiration) -> json.Json

Encodes GuestExpiration as json.

pub fn invalid_access_user_decoder() -> decode.Decoder(
  InvalidAccessUser,
)

Decodes InvalidAccessUser from json.

pub fn invalid_access_user_to_json(
  it: InvalidAccessUser,
) -> json.Json

Encodes InvalidAccessUser as json.

pub fn invite(
  team_id team_id: String,
  email email: String,
  channel_ids channel_ids: List(String),
) -> slackline.Call(Invite, Nil)

admin.users.invite: Invite a user to a workspace.

users.Invite identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/invite.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: already_in_team, already_in_team_invited_user, failed_looking_up_user, failed_to_send_invite, failed_to_validate_caller, failed_to_validate_channels, failed_to_validate_custom_message, failed_to_validate_expiration, failed_to_validate_team, feature_not_enabled, invalid_email, inviter_email_not_verified, not_an_admin, team_not_found, user_disabled.

pub fn list() -> slackline.Call(ListMethod, ListResponse)

admin.users.list: List users on a workspace

users.ListMethod identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/list.

User token scopes: admin.users:read.

Rate limit tier: t4.

Documented errors: feature_not_enabled, include_deactivated_user_workspaces_invalid, invalid_cursor, team_not_found.

pub fn list_response_decoder() -> decode.Decoder(ListResponse)

Decodes the response from admin.users.list.

pub fn remove(
  team_id team_id: String,
  user_id user_id: String,
) -> slackline.Call(Remove, Nil)

admin.users.remove: Remove a user from a workspace.

users.Remove identifies this method in slackline.Call.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: cannot_modify_primary_owner, failed_to_remove_user_from_workspace, feature_not_enabled, invalid_permissions, team_not_found, user_already_deleted, user_not_found.

pub fn session_clear_settings(
  user_ids user_ids: List(String),
) -> slackline.Call(SessionClearSettings, Nil)

admin.users.session.clearSettings: Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users.

users.SessionClearSettings identifies this method in slackline.Call.

User token scopes: admin.users:write.

Rate limit tier: t4.

Documented errors: admin_unauthorized, bots_not_allowed, feature_not_enabled, not_an_admin, unknown_method, user_not_found.

pub fn session_device_decoder() -> decode.Decoder(SessionDevice)

Decodes SessionDevice from json.

pub fn session_device_to_json(it: SessionDevice) -> json.Json

Encodes SessionDevice as json.

pub fn session_get_settings(
  user_ids user_ids: List(String),
) -> slackline.Call(
  SessionGetSettings,
  SessionGetSettingsResponse,
)

admin.users.session.getSettings: Get user-specific session settings—the session duration and what happens when the client closes—given a list of users.

users.SessionGetSettings identifies this method in slackline.Call.

User token scopes: admin.users:read.

Rate limit tier: t4.

Documented errors: admin_unauthorized, bots_not_allowed, feature_not_enabled, not_an_admin, restricted_action, unknown_method, user_not_found.

pub fn session_get_settings_response_decoder() -> decode.Decoder(
  SessionGetSettingsResponse,
)

Decodes the response from admin.users.session.getSettings.

pub fn session_invalidate(
  user_id user_id: String,
  session_id session_id: Int,
) -> slackline.Call(SessionInvalidate, Nil)

admin.users.session.invalidate: Revoke a single session for a user. The user will be forced to login to Slack.

users.SessionInvalidate identifies this method in slackline.Call.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: admin_unauthorized, cannot_invalidate_primary_owner, feature_not_enabled, not_an_admin, session_invalidation_failed, session_not_found, unknown_method, user_not_found.

pub fn session_list() -> slackline.Call(
  SessionList,
  SessionListResponse,
)

admin.users.session.list: List active user sessions for an organization

users.SessionList identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/session_list.

User token scopes: admin.users:read.

Rate limit tier: t2.

Documented errors: admin_unauthorized, bots_not_allowed, feature_not_enabled, invalid_cursor, missing_team, missing_user, no_active_sessions, not_an_admin, team_not_found, unknown_method, user_not_found.

pub fn session_list_response_decoder() -> decode.Decoder(
  SessionListResponse,
)

Decodes the response from admin.users.session.list.

pub fn session_reset(
  user_id user_id: String,
) -> slackline.Call(SessionReset, Nil)

admin.users.session.reset: Wipes all valid sessions on all devices for a given user

users.SessionReset identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/session_reset.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: cannot_reset_bot, cannot_reset_primary_owner, feature_not_enabled, not_an_admin, unknown_method, user_not_found, user_session_reset_failed.

pub fn session_reset_bulk(
  user_ids user_ids: List(String),
) -> slackline.Call(SessionResetBulk, Nil)

admin.users.session.resetBulk: Enqueues an asynchronous job to wipe all valid sessions on all devices for a given list of users

users.SessionResetBulk identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/session_reset_bulk.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: cannot_reset_bot, cannot_reset_primary_owner, failed_for_some_users, feature_not_enabled, not_an_admin, restricted_action, session_reset_not_allowed, unknown_method, user_not_found, user_session_reset_failed.

pub fn session_set_settings(
  user_ids user_ids: List(String),
) -> slackline.Call(SessionSetSettings, Nil)

admin.users.session.setSettings: Configure the user-level session settings—the session duration and what happens when the client closes—for one or more users.

users.SessionSetSettings identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/session_set_settings.

User token scopes: admin.users:write.

Rate limit tier: t4.

Documented errors: admin_unauthorized, at_least_one_session_setting_required, bots_not_allowed, feature_not_enabled, not_an_admin, unable_to_update_existing_sessions, unknown_method, user_not_found.

pub fn set_admin(
  team_id team_id: String,
  user_id user_id: String,
) -> slackline.Call(SetAdmin, Nil)

admin.users.setAdmin: Set an existing regular user or owner to be a workspace or org admin.

users.SetAdmin identifies this method in slackline.Call.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: cannot_modify_primary_owner, failed_to_set_admin_on_workspaces, failed_to_set_user_to_admin, feature_not_enabled, invalid_permissions, invalid_role_for_user, not_an_admin, team_not_found, user_not_found.

pub fn set_expiration(
  user_id user_id: String,
  expiration_ts expiration_ts: Int,
) -> slackline.Call(SetExpiration, Nil)

admin.users.setExpiration: Set an expiration for a guest user

users.SetExpiration identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/set_expiration.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: cannot_modify_external_guest, failed_looking_up_user, failed_to_set_expiration, failed_to_validate_caller, failed_to_validate_expiration, failed_to_validate_team, feature_not_enabled, team_id_required_for_enterprise, team_not_found, user_is_already_deleted, user_is_deactivated, user_is_not_a_guest, user_not_found.

pub fn set_owner(
  team_id team_id: String,
  user_id user_id: String,
) -> slackline.Call(SetOwner, Nil)

admin.users.setOwner: Set an existing regular user or admin to be a workspace or org owner.

users.SetOwner identifies this method in slackline.Call.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: cannot_modify_primary_owner, failed_to_set_owner_on_workspaces, failed_to_set_user_to_owner, feature_not_enabled, invalid_role_for_user, not_an_admin, not_supported, team_not_found, user_must_be_in_workspace, user_not_found.

pub fn set_regular(
  team_id team_id: String,
  user_id user_id: String,
) -> slackline.Call(SetRegular, Nil)

admin.users.setRegular: Set an existing guest user, admin user, or owner to be a regular user.

users.SetRegular identifies this method in slackline.Call.

User token scopes: admin.users:write.

Rate limit tier: t2.

Documented errors: cannot_modify_primary_owner, cannot_set_org_admin_to_regular_at_workspace_level, cannot_set_this_guest_to_regular_at_team_level, failed_to_set_user_to_regular, feature_not_enabled, invalid_role_for_user, inviter_email_not_verified, not_an_admin, team_not_found, user_not_found.

pub fn unsupported_versions_export() -> slackline.Call(
  UnsupportedVersionsExport,
  Nil,
)

admin.users.unsupportedVersions.export: Ask Slack to send you an export listing all workspace members using unsupported software, presented as a zipped CSV file.

users.UnsupportedVersionsExport identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/admin/users/unsupported_versions_export.

User token scopes: admin.users:read.

Rate limit tier: t1.

Documented errors: could_not_export, invalid_team_id, not_an_enterprise.

pub fn user_session_settings_decoder() -> decode.Decoder(
  UserSessionSettings,
)

Decodes UserSessionSettings from json.

pub fn user_session_settings_to_json(
  it: UserSessionSettings,
) -> json.Json

Encodes UserSessionSettings as json.

✨ Search Document