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
| Capability | Supported | Details |
|---|---|---|
| Sync | Yes | Users, user groups and user group membership. With the Enterprise Grid profile, also workspaces, workspace membership, admin roles and role assignments. |
| Incremental sync | No | Every run is a full sync. |
| Account provisioning | Yes | Users: create, update attributes, disable, enable and revoke, through Slack's SCIM API. Only the SCIM profiles support it. See below. |
| Grant writes | Yes | User group membership. With the Enterprise Grid profile, also workspace membership and admin roles. |
| Notifications | Yes | Messages to a channel, or a direct message to a user found by Slack user ID or email. |
| Custom operations | Yes | Enable User Group and Disable User Group. |
What the connector can do depends on the Connection profile you choose when you connect:
| Profile | Slack plan | What Owlie can do |
|---|---|---|
| Connect one workspace | Any Slack plan | Sync users and user groups, manage user group membership, and send notifications. Account lifecycle writes are refused. |
| Provision one workspace | Slack Business+ | Everything above, plus account provisioning with SCIM. |
| Connect an Enterprise Grid organization | Enterprise Grid | Everything 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
adminscope 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 scope | Used for |
|---|---|
team:read | Confirming which workspace was installed. |
users:read, users:read.email | User sync in the workspace profiles, and finding a notification recipient by email. |
usergroups:read | User group and user group membership sync. |
usergroups:write | member_of_usergroup writes, and the Enable User Group and Disable User Group operations. |
chat:write | Notifications. |
links:read, links:write | Previews of Owlie links posted in Slack. |
im:history, app_mentions:read, assistant:write | Owlie's app in Slack direct messages and mentions. |
The user scopes depend on the profile:
| Profile | User scopes |
|---|---|
| Connect one workspace | None. |
| Provision one workspace | admin, for SCIM account provisioning. |
| Connect an Enterprise Grid organization | admin 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
| Field | Required | What to enter |
|---|---|---|
| Connection profile | No | Connect 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
| Entity | In Slack | Identifier | Key attributes | Sync | Create | Update | Delete | Grants (as target) |
|---|---|---|---|---|---|---|---|---|
| User | A Slack member. This is the account entity. | id (for example U0123ABCD), or email | email, userName, firstName, lastName, displayName, title, deleted, isAdmin, isOwner | Yes | Yes | Yes | Yes | No |
| User Group | A Slack user group, the handle people mention, such as @oncall. | id (for example S0123ABCD) | name, handle, description, is_disabled, team_id, user_count | Yes | No | No | No | member_of_usergroup |
| Admin Role | An 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, isAssignable | Yes | No | No | No | assigned_admin_role |
| Workspace | A workspace in an Enterprise Grid organization. | id (for example T0123ABCD) | name, domain, url, discoverability | Yes | No | No | No | member_of_workspace |
Workspaces and admin roles sync only with the Enterprise Grid profile.
- Users. The workspace profiles read users with Slack's
users.listmethod 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_disabledset. 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 organizationE0123ABCDhas the IDorg:E0123ABCD:Rl03. Roles assigned on a single channel aren't synced.
Grant kinds
| Grant kind | In Slack | Principal → target | Writable | Qualifiers | Passes access through |
|---|---|---|---|---|---|
member_of_usergroup | The user is a member of a user group. | User → User Group | Yes | None | No |
assigned_admin_role | The user holds an Enterprise admin role at one scope. | User → Admin Role | Yes | None | No |
member_of_workspace | The user is a member of a workspace in an Enterprise Grid organization. | User → Workspace | Yes | None | No |
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:
| Role | Role ID | Organization | Workspace |
|---|---|---|---|
| Analytics Admin | Rl0L | Yes | Yes |
| Audit Logs Admin | Rl0C | Yes | Yes |
| Channel Admin | Rl01 | Yes | Yes |
| Channel Manager | Rl0A | Yes | Yes |
| Conversation Admin | Rl05 | Yes | Yes |
| DLP Admin | Rl09 | Yes | No |
| Exports Admin | Rl0F | Yes | No |
| Integrations Manager | Rl0D | Yes | No |
| Legal Holds Admin | Rl04 | Yes | No |
| Message Activity Manager | Rl0E | Yes | No |
| Role Admin | Rl02 | Yes | Yes |
| Sales Admin | Rl0G | Yes | No |
| Security Admin | Rl0J | Yes | No |
| Slack Platform Developer | Rl0B | Yes | Yes |
| User Admin | Rl03 | Yes | Yes |
| Workflow Admin | Rl0K | Yes | No |
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.
| Operation | What happens in Slack |
|---|---|
| Provision | Creates an active user with the identity's email, first name, last name, display name and a generated username. |
| Update attributes | Updates the username, display name, title, timezone, first name, last name and email. Owlie sends nothing when no attribute changed. |
| Disable | Deactivates the account through SCIM, so the user can't sign in. |
| Enable | Reactivates the account. |
| Revoke | Removes 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:
- First initial and last name (
jdoe) - First initial, middle initial and last name
- First and last name (
johndoe) - 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.