Slack

Overview

The Slack connector enables your AI Colleagues to integrate with your organization's Slack workspace, facilitating automated channel management, user administration, and collaboration workflows.

Slack is a business communication platform that offers real-time messaging, file sharing, and integrations with various business tools. The Slack connector allows Leena AI to automate Slack workflows, manage channels, administer users, and interact with workspaces seamlessly.

API Details

Leena AI integrates with Slack via REST APIs.

Documentation link: https://api.slack.com/methods

Setup

The Slack connector uses OAuth 2.0 authentication with the authorization code grant type.


Prerequisites

Before setting up the Slack connector, ensure you have:

  • Administrator access to your Slack workspace
  • Access to Slack API portal (api.slack.com)
  • Ability to create and manage Slack apps
  • Access to your Leena AI workspace with connector management permissions
  • For enterprise-level actions: Slack Enterprise Grid plan with admin privileges

Get credentials

Here is how to create an OAuth application in Slack:

  1. Log in to Slack API portal at https://api.slack.com/apps (Ensure you're signed in as an admin).
  2. Create a new Slack App:
    1. Click "Create New App"
    2. Select "From scratch"
    3. Enter your App Name (e.g., "Leena AI Integration")
    4. Select the workspace where you'll be developing your app
    5. Click "Create App"
  3. Configure OAuth & Permissions:
    1. In the left sidebar, click "OAuth & Permissions"
    2. Under "Redirect URLs", click "Add New Redirect URL"
    3. Add the Redirect URL (This will be filled later from Leena AI)
    4. Click "Save URLs"
  4. Add Required Scopes:
    1. Scroll to "Scopes" section
    2. Under "Bot Token Scopes", add the following scopes:
      • channels:read
      • channels:write.invites
      • channels:manage
      • groups:read
      • groups:write
      • groups:write.invites
      • groups:write.topic
      • im:read
      • im:write
      • mpim:read
      • mpim:write
    3. Under "User Token Scopes", add the following scopes:
      • channels:read
      • channels:write
      • groups:read
      • groups:write
      • im:read
      • im:write
      • mpim:read
      • mpim:write
      • users:read
      • users:read.email
      • users.profile:read
      • users.profile:write
      • admin (for enterprise-level actions)
  5. Get Client Credentials:
    1. Navigate to "Basic Information" in the left sidebar
    2. Under "App Credentials", locate your Client ID and Client Secret
    3. Copy and save these credentials securely (These credentials are displayed only once during creation)

Add connection

Here is how to add a connection on Leena AI:

  1. Log in to your Leena AI workspace
  2. Navigate to Settings > Integrations
  3. Search for "Slack" and select it from the list to add its new connector
  4. Start configuring the connector
    1. Auth Type: Select "OAuth 2.0" from the dropdown
    2. Client ID: OAuth application client ID from Slack
    3. Client Secret: OAuth application client secret from Slack
  5. Complete OAuth Flow and Save Configurations
    1. Click Connect in Leena AI for Slack connector setup
    2. You'll be redirected to Slack authorization page
    3. Sign in to your Slack workspace if prompted
    4. Review the permissions requested and click "Allow"
    5. You'll be redirected back to Leena AI with a successful connection
    6. The connector will be saved
  6. Copy Callback URL and Update Slack OAuth Settings
    1. Once the connector is saved in Leena AI, you can reopen the connector to view the Callback URL
    2. Copy the Callback URL from Leena AI
    3. Go back to Slack API portal > Your App > OAuth & Permissions
    4. Add the Callback URL to Redirect URLs section
    5. Save the changes

Actions

The following actions are supported for the Slack connector:

Create Channel

Creates a new public or private channel in Slack. The Agent can leverage the skill (workflow), which has been designed to create a new Slack channel, once the user raises a query to do so.


Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Channel NameThe name of the channel to be created

Optional

NameDescription
Is PrivateToggle to set whether the channel is private (default: false/public)

Here is a sample JSON input:

{
  "name": "project-alpha-team",
  "is_private": false
}

Response

Upon successful creation, the action returns the created channel details including:

  • Channel ID
  • Channel name
  • Creation timestamp
  • Channel type (public/private)

Invite User To Channel

Invites one or more users to join a Slack channel. The Agent can leverage the skill (workflow), which has been designed to add users to a channel, once the user raises a query to do so. Here are some common use cases:

  • Team Onboarding: Add new team members to relevant project channels
  • Project Setup: Invite stakeholders to new project channels
  • Cross-team Collaboration: Add members from different teams to shared channels

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
ChannelThe channel ID or name where users will be invited
UsersList of user IDs to invite to the channel

Optional

NameDescription
Force InviteWhen set to true and multiple user IDs are provided, continue inviting valid ones while disregarding invalid IDs

Here is a sample JSON input:

{
  "channel": "C0123456789",
  "users": ["U0123456789", "U9876543210"],
  "force": true
}

Response

Upon successful invitation, the action returns:

  • Channel details
  • List of invited users
  • Invitation status

Remove User From Channel

Removes a user from a Slack channel. The Agent can leverage the skill (workflow), which has been designed to remove a user from a channel, once the user raises a query to do so. Here are some common use cases:

  • Project Offboarding: Remove members who are no longer part of a project
  • Access Management: Revoke channel access for specific users
  • Team Restructuring: Update channel membership during organizational changes

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
ChannelThe channel ID from which the user will be removed
UserThe user ID of the member to be removed

Here is a sample JSON input:

{
  "channel": "C0123456789",
  "user": "U0123456789"
}

Response

Upon successful removal, the action returns:

  • Confirmation of successful removal
  • Channel ID
  • User ID of removed member

Get User Info

Retrieves detailed information about a Slack user. The Agent can leverage the skill (workflow), which has been designed to fetch user details, once the user raises a query to do so. Here are some common use cases:

  • User Lookup: Get profile information for a specific user
  • Directory Search: Find user details by their Slack ID
  • Profile Verification: Verify user information for workflows

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
UserThe user ID of the Slack member to look up

Here is a sample JSON input:

{
  "user": "U0123456789"
}

Response

The action returns comprehensive user information including:

  • User ID
  • Display name
  • Real name
  • Email address
  • Title/Role
  • Profile image URL
  • Status information
  • Timezone details

Lookup User By Email

Finds a Slack user by their email address. The Agent can leverage the skill (workflow), which has been designed to search for users by email, once the user raises a query to do so. Here are some common use cases:

  • User Discovery: Find Slack user ID from corporate email
  • Integration Mapping: Map external system users to Slack users
  • Onboarding Workflows: Locate new employees in Slack by their email

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
EmailThe email address of the user to search for

Here is a sample JSON input:

{
  "email": "[email protected]"
}

Response

The action returns user details including:

  • User ID
  • Display name
  • Real name
  • Email address
  • Profile information
  • Account status

Update User

Updates a Slack user's profile information. The Agent can leverage the skill (workflow), which has been designed to modify user profile details, once the user provides the information to be updated. Here are some common use cases:

  • Profile Updates: Modify user's display name, title, or other profile fields
  • Status Management: Update user's status text and expiration
  • Custom Field Updates: Modify workspace-specific custom profile fields
  • Role Changes: Update user's title/role information

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
UserThe user ID of the member to be updated

Optional

NameDescription
Display NameThe user's display name shown in Slack
First NameThe user's first name
Last NameThe user's last name
PronounsThe user's preferred pronouns
Real NameThe user's full real name
Title / RoleThe user's job title or role
Status TextThe user's status message
Status Expiration TimeWhen the status should expire (datetime)
Custom FieldsWorkspace-specific custom profile fields (dynamically loaded based on workspace configuration)

Here is a sample JSON input:

// Update Basic Profile

{
  "user": "U0123456789",
  "profile": {
    "display_name": "John D.",
    "first_name": "John",
    "last_name": "Doe",
    "title": "Senior Engineer"
  }
}

// Update Status

{
  "user": "U0123456789",
  "profile": {
    "status_text": "In a meeting",
    "status_expiration": "2025-08-27T15:00:00"
  }
}

// Update with Custom Fields

{
  "user": "U0123456789",
  "profile": {
    "display_name": "John D.",
    "title": "Senior Engineer"
  },
  "customFields": {
    "Xf0123456789": "Engineering",
    "Xf9876543210": "Building A"
  }
}

Response

Upon successful update, the action returns:

  • Updated user profile details
  • Confirmation of modified fields
  • User ID

Archive Channel

Archives an existing Slack channel. The Agent can leverage the skill (workflow), which has been designed to archive a channel, once the user raises a query to do so. Here are some common use cases:

  • Project Completion: Archive channels for completed projects
  • Workspace Cleanup: Remove inactive channels from the main list
  • Organizational Restructuring: Archive obsolete team channels

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
ChannelThe channel ID of the channel to archive

Here is a sample JSON input:

{
  "channel": "C0123456789"
}

Response

Upon successful archival, the action returns:

  • Confirmation of successful archival
  • Channel ID
  • Archival timestamp

Invite User To Workspace

Invites a new user to a Slack Enterprise Grid workspace. The Agent can leverage the skill (workflow), which has been designed to invite users to workspaces, once the user raises a query to do so.

Note: This action is available only for Slack Enterprise Grid organizations.

Here are some common use cases:

  • Employee Onboarding: Invite new employees to the corporate Slack workspace
  • Guest Access: Invite external collaborators as guests
  • Multi-workspace Management: Add users to specific workspaces in Enterprise Grid

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
Select ChannelsList of channel IDs the user will be added to initially
User EmailEmail address of the user to invite
WorkspaceThe workspace ID where the user will be invited

Optional

NameDescription
Full name of the userThe invited user's full name
Custom MessageA custom message to include in the invitation email
Is this user a multi-channel guest user?Set to true if the user should be a restricted (multi-channel) guest
Is this user a single-channel guest user?Set to true if the user should be an ultra-restricted (single-channel) guest
Allow invited user to sign in via email and passwordEnable email/password authentication for the invited user
Timestamp when guest account should be disabled (in seconds)Unix timestamp for automatic guest account expiration
Allow this invite to be resent in the future if a user has not signed up yetEnable resending of invitation (default: false)

Here is a sample JSON input:

// Basic Invitation

{
  "channel_ids": ["C0123456789", "C9876543210"],
  "email": "[email protected]",
  "team_id": "T0123456789",
  "real_name": "Jane Smith"
}

// Guest Invitation with Expiration

{
  "channel_ids": ["C0123456789"],
  "email": "[email protected]",
  "team_id": "T0123456789",
  "real_name": "External Contractor",
  "is_restricted": true,
  "guest_expiration_ts": "1735689600",
  "custom_message": "Welcome to our project collaboration space!"
}

// Single-Channel Guest

{
  "channel_ids": ["C0123456789"],
  "email": "[email protected]",
  "team_id": "T0123456789",
  "is_ultra_restricted": true
}

Response

Upon successful invitation, the action returns:

  • Invitation confirmation
  • User details
  • Workspace information
  • Invitation status

Remove User From Workspace

Removes a user from a Slack Enterprise Grid workspace. The Agent can leverage the skill (workflow), which has been designed to remove users from workspaces, once the user raises a query to do so.

Note: This action is available only for Slack Enterprise Grid organizations.

Here are some common use cases:

  • Employee Offboarding: Remove departing employees from workspaces
  • Access Revocation: Remove user access due to role changes
  • Guest Cleanup: Remove expired guest accounts

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
WorkspaceThe workspace ID from which the user will be removed
UserThe user ID of the member to be removed

Here is a sample JSON input:

{
  "team_id": "T0123456789",
  "user": "U0123456789"
}

Response

Upon successful removal, the action returns:

  • Confirmation of successful removal
  • User ID
  • Workspace ID
  • Removal timestamp

Assign User To Workspace

Assigns an existing Slack Enterprise Grid organization user to an additional workspace. The Agent can leverage the skill (workflow), which has been designed to assign users to workspaces, once the user raises a query to do so.

Note: This action is available only for Slack Enterprise Grid organizations.

Here are some common use cases:

  • Team Transfers: Add users to new team workspaces
  • Project Access: Grant access to project-specific workspaces
  • Cross-functional Collaboration: Enable multi-workspace access for users

Input Parameters

Here are the input parameters required to set up this action:

Mandatory

NameDescription
WorkspaceThe workspace ID where the user will be assigned
UserThe user ID of the member to be assigned

Optional

NameDescription
Select ChannelsList of channel IDs the user will be added to in the workspace
Is RestrictedSet to true if the user should be a multi-channel guest user
Is Ultra RestrictedSet to true if the user should be a single-channel guest user

Here is a sample JSON input:

// Basic Assignment

{
  "team_id": "T0123456789",
  "user_id": "U0123456789"
}

// Assignment with Channels

{
  "team_id": "T0123456789",
  "user_id": "U0123456789",
  "channel_ids": ["C0123456789", "C9876543210"]
}

// Guest Assignment

{
  "team_id": "T0123456789",
  "user_id": "U0123456789",
  "channel_ids": ["C0123456789"],
  "is_restricted": true
}

Response

Upon successful assignment, the action returns:

  • Confirmation of successful assignment
  • User ID
  • Workspace ID
  • List of channels assigned (if applicable)