admin.teams.*: create and list the workspaces in an Enterprise organization, list their admins and owners, and change workspace settings (name, description, icon, discoverability, default channels).

Example

::teams ::slack::admin::teams

workspaces ::teams/list-all(::teams/ListRequest({}), 500)
map(workspaces, (t) { t.name })

Functions

admins-list

fn (request: AdminsListRequest): Map
fn (request: AdminsListRequest, opts: Map): Map

admin.teams.admins.list - List a workspace's admins (admin_ids).

Scope: admin.teams:read. Returns Slack's response body; ok: false comes back as an Err(SlackError). Cursor-paginated: pass cursor from response_metadata.next_cursor, or use admins-list-all.

Example

::teams ::slack::admin::teams

page ::teams/admins-list(::teams/AdminsListRequest({team_id: "T0123ABCDEF", limit: 100}))
page.admin_ids

admins-list-all

fn (request: AdminsListRequest): Vec
fn (request: AdminsListRequest, max-items: Int): Vec
fn (request: AdminsListRequest, max-items: Int, opts: Map): Vec

Every admin_ids entry from admin.teams.admins.list, following next_cursor until the last page or max-items (default 1000). request sets the filters; its cursor is the starting point.

Example

::teams ::slack::admin::teams

admins ::teams/admins-list-all(::teams/AdminsListRequest({team_id: "T0123ABCDEF"}))
length(admins)

create

fn (request: CreateRequest): Map
fn (request: CreateRequest, opts: Map): Map

admin.teams.create - Create a workspace. team_discoverability: open, closed, invite_only or unlisted. Returns team (the new team id).

Scope: admin.teams:write. Returns Slack's response body; ok: false comes back as an Err(SlackError).

Example

::teams ::slack::admin::teams

res ::teams/create(::teams/CreateRequest({team_domain: "acme-support", team_name: "Acme Support", team_discoverability: "invite_only"}))
res.team

list

fn (): Map
fn (request: ListRequest): Map
fn (request: ListRequest, opts: Map): Map

admin.teams.list - List every workspace in the organization (teams).

Scope: admin.teams:read. Returns Slack's response body; ok: false comes back as an Err(SlackError). Cursor-paginated: pass cursor from response_metadata.next_cursor, or use list-all.

Example

::teams ::slack::admin::teams

page ::teams/list(::teams/ListRequest({limit: 100}))
map(page.teams, %.name)

// As another organization
::teams/list(::teams/ListRequest({limit: 100}), {token: ::hot::ctx/get("tenant-b.slack.admin.token")})

list-all

fn (): Vec
fn (request: ListRequest): Vec
fn (request: ListRequest, max-items: Int): Vec
fn (request: ListRequest, max-items: Int, opts: Map): Vec

Every teams entry from admin.teams.list, following next_cursor until the last page or max-items (default 1000). request sets the filters; its cursor is the starting point.

Example

::teams ::slack::admin::teams

teams ::teams/list-all()
map(teams, %.id)

owners-list

fn (request: OwnersListRequest): Map
fn (request: OwnersListRequest, opts: Map): Map

admin.teams.owners.list - List a workspace's owners (owner_ids).

Scope: admin.teams:read. Returns Slack's response body; ok: false comes back as an Err(SlackError). Cursor-paginated: pass cursor from response_metadata.next_cursor, or use owners-list-all.

Example

::teams ::slack::admin::teams

page ::teams/owners-list(::teams/OwnersListRequest({team_id: "T0123ABCDEF", limit: 100}))
page.owner_ids

owners-list-all

fn (request: OwnersListRequest): Vec
fn (request: OwnersListRequest, max-items: Int): Vec
fn (request: OwnersListRequest, max-items: Int, opts: Map): Vec

Every owner_ids entry from admin.teams.owners.list, following next_cursor until the last page or max-items (default 1000). request sets the filters; its cursor is the starting point.

Example

::teams ::slack::admin::teams

owners ::teams/owners-list-all(::teams/OwnersListRequest({team_id: "T0123ABCDEF"}))
length(owners)

settings-info

fn (request: SettingsInfoRequest): Map
fn (request: SettingsInfoRequest, opts: Map): Map

admin.teams.settings.info - Get a workspace's settings (team).

Scope: admin.teams:read. Returns Slack's response body; ok: false comes back as an Err(SlackError).

Example

::teams ::slack::admin::teams

res ::teams/settings-info(::teams/SettingsInfoRequest({team_id: "T0123ABCDEF"}))
res.team.name

settings-set-default-channels

fn (request: SettingsSetDefaultChannelsRequest): Map
fn (request: SettingsSetDefaultChannelsRequest, opts: Map): Map

admin.teams.settings.setDefaultChannels - Set the channels new members join automatically.

Scope: admin.teams:write. Returns Slack's response body; ok: false comes back as an Err(SlackError).

Example

::teams ::slack::admin::teams

::teams/settings-set-default-channels(::teams/SettingsSetDefaultChannelsRequest({team_id: "T0123ABCDEF", channel_ids: ["C0123ABCDEF"]}))

settings-set-description

fn (request: SettingsSetDescriptionRequest): Map
fn (request: SettingsSetDescriptionRequest, opts: Map): Map

admin.teams.settings.setDescription - Set a workspace's description.

Scope: admin.teams:write. Returns Slack's response body; ok: false comes back as an Err(SlackError).

Example

::teams ::slack::admin::teams

::teams/settings-set-description(::teams/SettingsSetDescriptionRequest({team_id: "T0123ABCDEF", description: "Customer support"}))

settings-set-discoverability

fn (request: SettingsSetDiscoverabilityRequest): Map
fn (request: SettingsSetDiscoverabilityRequest, opts: Map): Map

admin.teams.settings.setDiscoverability - Set who can find and join a workspace: open, closed, invite_only or unlisted.

Scope: admin.teams:write. Returns Slack's response body; ok: false comes back as an Err(SlackError).

Example

::teams ::slack::admin::teams

::teams/settings-set-discoverability(::teams/SettingsSetDiscoverabilityRequest({team_id: "T0123ABCDEF", discoverability: "invite_only"}))

settings-set-icon

fn (request: SettingsSetIconRequest): Map
fn (request: SettingsSetIconRequest, opts: Map): Map

admin.teams.settings.setIcon - Set a workspace's icon from an image URL.

Scope: admin.teams:write. Returns Slack's response body; ok: false comes back as an Err(SlackError).

Example

::teams ::slack::admin::teams

::teams/settings-set-icon(::teams/SettingsSetIconRequest({team_id: "T0123ABCDEF", image_url: "https://example.com/icon.png"}))

settings-set-name

fn (request: SettingsSetNameRequest): Map
fn (request: SettingsSetNameRequest, opts: Map): Map

admin.teams.settings.setName - Rename a workspace.

Scope: admin.teams:write. Returns Slack's response body; ok: false comes back as an Err(SlackError).

Example

::teams ::slack::admin::teams

::teams/settings-set-name(::teams/SettingsSetNameRequest({team_id: "T0123ABCDEF", name: "Acme Customer Support"}))

Types

AdminsListRequest

AdminsListRequest type {
    team_id: Str,
    cursor: Str?,
    limit: Int?
}

CreateRequest

CreateRequest type {
    team_domain: Str,
    team_name: Str,
    team_description: Str?,
    team_discoverability: Str?
}

ListRequest

ListRequest type {
    cursor: Str?,
    limit: Int?
}

OwnersListRequest

OwnersListRequest type {
    team_id: Str,
    cursor: Str?,
    limit: Int?
}

SettingsInfoRequest

SettingsInfoRequest type {
    team_id: Str
}

SettingsSetDefaultChannelsRequest

SettingsSetDefaultChannelsRequest type {
    team_id: Str,
    channel_ids: Vec<Str>
}

SettingsSetDescriptionRequest

SettingsSetDescriptionRequest type {
    team_id: Str,
    description: Str
}

SettingsSetDiscoverabilityRequest

SettingsSetDiscoverabilityRequest type {
    team_id: Str,
    discoverability: Str
}

SettingsSetIconRequest

SettingsSetIconRequest type {
    team_id: Str,
    image_url: Str
}

SettingsSetNameRequest

SettingsSetNameRequest type {
    team_id: Str,
    name: Str
}