Skip to main content

Slack

Slack is a messaging platform for teams. The Slack connector syncs Slack users and user groups into Owlie, and on Enterprise Grid it also syncs workspaces and Enterprise admin roles. It can add and remove user group members, send notifications, and, on a Slack plan with SCIM, create, update, deactivate and reactivate Slack accounts. On Enterprise Grid it also assigns workspace membership and admin roles.

Capabilities​

CapabilitySupportedDetails
SyncYesUsers, user groups and user group membership. With the Enterprise Grid profile, also workspaces, workspace membership, admin roles and role assignments.
Incremental syncNoEvery run is a full sync.
Account provisioningYesUsers: create, update attributes, disable, enable and revoke, through Slack's SCIM API. Only the SCIM profiles support it. See below.
Grant writesYesUser group membership. With the Enterprise Grid profile, also workspace membership and admin roles.
NotificationsYesMessages to a channel, or a direct message to a user found by Slack user ID or email.
Custom operationsYesEnable User Group and Disable User Group.

What the connector can do depends on the Connection profile you choose when you connect:

ProfileSlack planWhat Owlie can do
Connect one workspaceAny Slack planSync users and user groups, manage user group membership, and send notifications. Account lifecycle writes are refused.
Provision one workspaceSlack Business+Everything above, plus account provisioning with SCIM.
Connect an Enterprise Grid organizationEnterprise GridEverything above, with users read from the organization's SCIM directory, plus workspaces, workspace membership and admin roles.

Authentication​

Connect Slack. Owlie owns the Slack app you install, and Owlie holds its client ID, client secret and signing secret. You don't create a Slack app, and you don't paste a token or secret into Owlie. You approve the install in Slack, and Slack returns the tokens to Owlie through Slack's OAuth install flow.

The install gives Owlie two tokens. The bot token reads users and user groups, changes user group membership and sends messages. The user token of the person who approved the install is used for SCIM and Slack's admin.* methods, so only the SCIM and Enterprise Grid profiles request one.

Get credentials from Slack​

There is nothing to create in Slack. When you select Connect Slack, Slack shows a consent screen listing the scopes below, and whoever approves it grants them to Owlie's app.

Who approves, and where, depends on the profile:

  • Connect one workspace and Provision one workspace install into a single workspace. Pick that workspace on Slack's consent screen. For Provision one workspace, approve as a Slack owner, so Slack can grant the admin scope that SCIM needs.
  • Connect an Enterprise Grid organization installs into the whole organization. Approve as an organization owner, and choose the organization rather than one of its workspaces on the consent screen. Owlie refuses the connection if Slack connected a single workspace instead.

Every profile requests these bot scopes:

Bot scopeUsed for
team:readConfirming which workspace was installed.
users:read, users:read.emailUser sync in the workspace profiles, and finding a notification recipient by email.
usergroups:readUser group and user group membership sync.
usergroups:writemember_of_usergroup writes, and the Enable User Group and Disable User Group operations.
chat:writeNotifications.
links:read, links:writePreviews of Owlie links posted in Slack.
im:history, app_mentions:read, assistant:writeOwlie's app in Slack direct messages and mentions.

The user scopes depend on the profile:

ProfileUser scopes
Connect one workspaceNone.
Provision one workspaceadmin, for SCIM account provisioning.
Connect an Enterprise Grid organizationadmin for SCIM user sync and provisioning, admin.teams:read for workspaces, admin.users:read and admin.users:write for workspace membership, and admin.roles:read and admin.roles:write for admin roles.

Slack describes each scope in its scopes reference.

Connect Slack in Owlie​

FieldRequiredWhat to enter
Connection profileNoConnect one workspace (the default), Provision one workspace or Connect an Enterprise Grid organization. The table under Capabilities compares them.

Choose the profile before you select Connect Slack, because it decides which user scopes Owlie asks Slack for. The install fails if Slack doesn't grant the scopes the profile needs, or if the SCIM or Enterprise admin access it needs isn't available on your plan. To change the profile later, save the new one and reconnect Slack.

The connection test calls Slack's auth.test method with the bot token. Connecting doesn't start a sync. Run the first sync yourself when you're ready.

Entities​

EntityIn SlackIdentifierKey attributesSyncCreateUpdateDeleteGrants (as target)
UserA Slack member. This is the account entity.id (for example U0123ABCD), or emailemail, userName, firstName, lastName, displayName, title, deleted, isAdmin, isOwnerYesYesYesYesNo
User GroupA Slack user group, the handle people mention, such as @oncall.id (for example S0123ABCD)name, handle, description, is_disabled, team_id, user_countYesNoNoNomember_of_usergroup
Admin RoleAn Enterprise admin role at the organization or at one workspace.org:<organization ID>:<role ID> or workspace:<workspace ID>:<role ID>roleId, name, scopeType, scopeId, isKnown, isAssignableYesNoNoNoassigned_admin_role
WorkspaceA workspace in an Enterprise Grid organization.id (for example T0123ABCD)name, domain, url, discoverabilityYesNoNoNomember_of_workspace

Workspaces and admin roles sync only with the Enterprise Grid profile.

  • Users. The workspace profiles read users with Slack's users.list method and skip bots and Slackbot. The Enterprise Grid profile reads the organization's users through SCIM, which returns fewer fields: the ID, username, email, name, display name, title, timezone and whether the account is active. Owlie shows a deactivated Slack user as inactive.
  • User groups. Owlie syncs disabled groups too, with is_disabled set. On Enterprise Grid it reads the groups of each workspace the install was authorized for.
  • Admin roles. Slack lists role assignments, not roles, so a role at a scope appears in Owlie once someone holds it there. For example, the User Admin role (Rl03) at organization E0123ABCD has the ID org:E0123ABCD:Rl03. Roles assigned on a single channel aren't synced.

Grant kinds​

Grant kindIn SlackPrincipal → targetWritableQualifiersPasses access through
member_of_usergroupThe user is a member of a user group.User → User GroupYesNoneNo
assigned_admin_roleThe user holds an Enterprise admin role at one scope.User → Admin RoleYesNoneNo
member_of_workspaceThe user is a member of a workspace in an Enterprise Grid organization.User → WorkspaceYesNoneNo

member_of_usergroup works with every profile and uses the bot token and its usergroups:write scope. Slack's usergroups.users.update method replaces a group's whole member list, and Slack has no method that adds or removes one member. To add or remove a user, Owlie reads the current list, writes it back with the user added or removed, and checks the member list in Slack's answer. The write fails if that list doesn't show the change. Slack doesn't allow an empty user group, so Owlie refuses to remove a group's last member. Disable the group with the Disable User Group operation instead.

assigned_admin_role needs the Enterprise Grid profile and its admin.roles:write scope. Owlie writes through admin.roles.addAssignments and admin.roles.removeAssignments. Slack answers these methods with success even when it refuses the user or the scope, and lists the refusal in the answer. Owlie treats any refusal as a failed write. The target's ID says where the role applies: org:E0123ABCD:Rl03 assigns User Admin for the organization, and workspace:T0123ABCD:Rl03 assigns it in one workspace. Owlie writes only Slack's standard roles, and only at the scopes Slack allows for each:

RoleRole IDOrganizationWorkspace
Analytics AdminRl0LYesYes
Audit Logs AdminRl0CYesYes
Channel AdminRl01YesYes
Channel ManagerRl0AYesYes
Conversation AdminRl05YesYes
DLP AdminRl09YesNo
Exports AdminRl0FYesNo
Integrations ManagerRl0DYesNo
Legal Holds AdminRl04YesNo
Message Activity ManagerRl0EYesNo
Role AdminRl02YesYes
Sales AdminRl0GYesNo
Security AdminRl0JYesNo
Slack Platform DeveloperRl0BYesYes
User AdminRl03YesYes
Workflow AdminRl0KYesNo

Owlie still syncs any other role it finds, named Slack role <role ID> with isKnown set to false, but never writes it. isAssignable on each synced role says whether Owlie can write it at that scope.

member_of_workspace needs the Enterprise Grid profile and its admin.users:write scope. Owlie adds a user with admin.users.assign and removes one with admin.users.remove. Adding a user who is already a member succeeds without a change.

Every Grant write addresses the user by Slack user ID, so Owlie must already know the user's Slack account, from a sync or from provisioning.

Provisioning behaviour and limits​

Account provisioning goes through Slack's SCIM API with the user token, and needs the Provision one workspace or Connect an Enterprise Grid organization profile. With Connect one workspace, Owlie refuses every lifecycle write before calling Slack.

OperationWhat happens in Slack
ProvisionCreates an active user with the identity's email, first name, last name, display name and a generated username.
Update attributesUpdates the username, display name, title, timezone, first name, last name and email. Owlie sends nothing when no attribute changed.
DisableDeactivates the account through SCIM, so the user can't sign in.
EnableReactivates the account.
RevokeRemoves the user's managed Grants, then deactivates the account. The default provisioning profile's revoke state is disabled.

Slack never erases a user. If you set the provisioning profile's revoke state to deleted, Owlie sends a SCIM delete, which Slack also treats as deactivation. A delete for a user Slack no longer has succeeds.

The default provisioning profile requires an email. It builds the username from the identity's name, trying these forms in order:

  1. First initial and last name (jdoe)
  2. First initial, middle initial and last name
  3. First and last name (johndoe)
  4. First initial and last name with a number

If Slack reports that the email or username is already in use, Owlie reports that the user already exists.

On Enterprise Grid, provisioning creates the organization account only. Add member_of_workspace Grants to put the user in workspaces.

User group membership is the only Grant a workspace profile can write. Owlie doesn't sync or write channels, channel membership or channel-scoped admin roles, and it doesn't create, rename or delete user groups. Enable User Group and Disable User Group take the group's ID as usergroupId, for example S0123ABCD, and call Slack's usergroups.enable and usergroups.disable methods.

Notifications go through Slack's chat.postMessage method with the bot token. A notification needs text and one target: channel (a channel ID), userId (a Slack user ID such as U0123ABCD, which sends a direct message) or email, which Owlie looks up in Slack first. When more than one is set, Owlie uses the channel, then the user ID, then the email. It can also carry Block Kit blocks, a threadTs to reply in a thread, and unfurlLinks. To send Owlie's notifications to Slack, choose this connection in notification settings.

Troubleshooting​

"Slack account lifecycle requires SCIM (Business+ or Enterprise Grid); this installation is sync and entitlements only." The connection uses Connect one workspace, which can't provision accounts. Choose Provision one workspace or Connect an Enterprise Grid organization and reconnect Slack.

"Slack SCIM and Enterprise admin operations require an eligible user token. Reconnect Slack and grant the required optional admin scope." Owlie has no user token for a SCIM or admin.* call. Reconnect Slack as a Slack owner (an organization owner for Enterprise Grid) and approve the admin scopes on the consent screen.

"This Slack operation is not available on your Slack plan or with the current token permissions." Slack refused the call for your plan or the granted scopes. Check that your plan matches the profile, then reconnect Slack to grant the profile's scopes.

"Slack does not allow a user group to become empty; disable the group instead (disable-usergroup op)." The Grant removal would leave the group with no members. Run Disable User Group on the group instead.

"Slack did not apply the user group membership change." Slack's answer didn't show the user added or removed. Check the group in Slack, then retry.

"Slack workspace membership requires the Enterprise Grid connection profile." A member_of_workspace write ran on a workspace profile. Workspace membership needs Connect an Enterprise Grid organization.

"Slack admin role … is read-only at … scope." The role isn't one of the standard roles above, or Slack doesn't allow it at that scope. For example, DLP Admin (Rl09) can be assigned only at the organization. Assign it in Slack instead.

"Slack rejected the admin role change for …" Slack refused the user or the scope named in the role's ID. Check that the user belongs to that organization or workspace.

"No Slack user found for …" A notification's email doesn't match a Slack user in the workspace. Use the email the person has in Slack, or send to their Slack user ID.

Changelog​

The Slack connector is at version 1. Owlie shows each connector's changelog with the connector in the catalog.