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:
- Log in to Slack API portal at https://api.slack.com/apps (Ensure you're signed in as an admin).
- Create a new Slack App:
- Click "Create New App"
- Select "From scratch"
- Enter your App Name (e.g., "Leena AI Integration")
- Select the workspace where you'll be developing your app
- Click "Create App"
- Configure OAuth & Permissions:
- In the left sidebar, click "OAuth & Permissions"
- Under "Redirect URLs", click "Add New Redirect URL"
- Add the Redirect URL (This will be filled later from Leena AI)
- Click "Save URLs"
- Add Required Scopes:
- Scroll to "Scopes" section
- 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
- 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)
- Get Client Credentials:
- Navigate to "Basic Information" in the left sidebar
- Under "App Credentials", locate your Client ID and Client Secret
- 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:
- Log in to your Leena AI workspace
- Navigate to Settings > Integrations
- Search for "Slack" and select it from the list to add its new connector
- Start configuring the connector
- Auth Type: Select "OAuth 2.0" from the dropdown
- Client ID: OAuth application client ID from Slack
- Client Secret: OAuth application client secret from Slack
- Complete OAuth Flow and Save Configurations
- Click Connect in Leena AI for Slack connector setup
- You'll be redirected to Slack authorization page
- Sign in to your Slack workspace if prompted
- Review the permissions requested and click "Allow"
- You'll be redirected back to Leena AI with a successful connection
- The connector will be saved
- Copy Callback URL and Update Slack OAuth Settings
- Once the connector is saved in Leena AI, you can reopen the connector to view the Callback URL
- Copy the Callback URL from Leena AI
- Go back to Slack API portal > Your App > OAuth & Permissions
- Add the Callback URL to Redirect URLs section
- 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
| Name | Description |
|---|---|
| Channel Name | The name of the channel to be created |
Optional
| Name | Description |
|---|---|
| Is Private | Toggle 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
| Name | Description |
|---|---|
| Channel | The channel ID or name where users will be invited |
| Users | List of user IDs to invite to the channel |
Optional
| Name | Description |
|---|---|
| Force Invite | When 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
| Name | Description |
|---|---|
| Channel | The channel ID from which the user will be removed |
| User | The 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
| Name | Description |
|---|---|
| User | The 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
| Name | Description |
|---|---|
| The 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
| Name | Description |
|---|---|
| User | The user ID of the member to be updated |
Optional
| Name | Description |
|---|---|
| Display Name | The user's display name shown in Slack |
| First Name | The user's first name |
| Last Name | The user's last name |
| Pronouns | The user's preferred pronouns |
| Real Name | The user's full real name |
| Title / Role | The user's job title or role |
| Status Text | The user's status message |
| Status Expiration Time | When the status should expire (datetime) |
| Custom Fields | Workspace-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
| Name | Description |
|---|---|
| Channel | The 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
| Name | Description |
|---|---|
| Select Channels | List of channel IDs the user will be added to initially |
| User Email | Email address of the user to invite |
| Workspace | The workspace ID where the user will be invited |
Optional
| Name | Description |
|---|---|
| Full name of the user | The invited user's full name |
| Custom Message | A 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 password | Enable 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 yet | Enable 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
| Name | Description |
|---|---|
| Workspace | The workspace ID from which the user will be removed |
| User | The 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
| Name | Description |
|---|---|
| Workspace | The workspace ID where the user will be assigned |
| User | The user ID of the member to be assigned |
Optional
| Name | Description |
|---|---|
| Select Channels | List of channel IDs the user will be added to in the workspace |
| Is Restricted | Set to true if the user should be a multi-channel guest user |
| Is Ultra Restricted | Set 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)
Updated 1 day ago
