Slack
Setup connector
The Slack connector enables your Leena AI Agents to integrate with your organization's Slack workspace, facilitating automated user management, channel operations, and profile updates.
Slack is a collaboration platform that enables teams to communicate and work together effectively through channels, direct messages, and integrations. The Slack connector allows Leena AI to automate workspace management, user provisioning, and channel operations seamlessly.
Overview
Leena AI supports OAuth 2.0 authentication for Slack Connector. You need to provide client secret & ID to successfully create an OAuth 2.0 connector.
Prerequisites
Before setting up the Slack connector, ensure you have:
- Administrator access to your Slack workspace
- Ability to create applications in Slack
- Access to your Leena AI workspace with connector management permissions
Setting up the Slack Connector
Step 1: Create Application in Slack
- Go to https://api.slack.com/apps
- Click on Create New App
- Choose a name for your application
- Select your workspace
- Click Create App
Step 2: Configure OAuth Permissions
- Navigate to Features → OAuth & Permissions in your app settings
- Add the redirect URL provided by Leena AI under Redirect URLs
- Scroll down to Scopes section
- Add relevant permissions (recommended scopes):
users:read- View users in workspaceusers:write- Modify user informationchannels:read- View channelschannels:manage- Manage channelsgroups:read- View private channelsgroups:write- Manage private channelschat:write- Send messagesadmin.users:write- Manage users in workspace
Step 3: Get Client ID and Client Secret
- Navigate to Basic Information in your app settings
- Scroll down to App Credentials section
- Copy the Client ID
- Click Show next to Client Secret and copy it
Important: Keep your Client Secret secure. Do not share it publicly.
Step 4: Authorize the Application
- Use the following URL format:
https://slack.com/oauth/v2/authorize?scope=REQUIRED_SCOPES&user_scope=REQUIRED_USER_SCOPES&client_id=CLIENT_ID&redirect_uri=REDIRECT_URL - Replace
CLIENT_IDwith your generated Client ID - Replace
REDIRECT_URLwith the redirect URL provided by Leena AI - Open the URL in a browser
- Review the permissions listed
- Click Allow to grant the permissions and complete the authorization process
Step 5: Create Connector in 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
- Enter the following details:
| Parameter | Description | Example |
|---|---|---|
| Client ID | OAuth application client ID | Generated from Slack app |
| Client Secret | OAuth application client secret | Generated from Slack app |
- Click Test Connection to verify the setup
- If successful, click Save to store the connector configuration
Supported Actions
Leena AI Slack connector supports the following actions:
| Action Name | Description |
|---|---|
| Invite user to a channel | Add an existing user to a specific non-archived channel |
| Invite user to a workspace | Add and invite a new user to Org's workspace |
| Get a user's information | Fetch a user's information against a unique identifier |
| Update user information | Update user information |
| Remove user from a workspace | Remove a user from an Org's workspace |
| Remove user from a channel | Remove a user from a specific channel |
| Archive channel | Archive an existing Slack channel |
Use Cases
Some of the use cases that you can achieve using Slack connector are below:
-
Onboarding Journey: Create a new user and invite them to Org's Workspace as part of the employee onboarding process.
-
Off-boarding Journey: Remove a user from the Org's workspace as part of the employee off-boarding process.
-
Profile Management: Allow users to view and update their profile information on Slack through the virtual assistant.
-
Channel Management: Automatically manage channel memberships based on project assignments or role changes.
-
Workspace Cleanup: Archive inactive channels to maintain workspace organization.
Security Best Practices
- Client Secret Security: Store Client ID and Client Secret securely
- Principle of Least Privilege: Only grant necessary permissions to the Slack app
- Access Monitoring: Monitor API usage through Slack admin panels
- Regular Audits: Review connector permissions and access logs periodically
- Token Rotation: Regularly rotate OAuth tokens for enhanced security
The connector is now ready to be used by your Leena AI Agents for automated Slack workspace management.
Invite user to a channel
This action is used to invite a new user to an existing Slack Channel.
Input Fields
| Field | Description | Type | Required |
|---|---|---|---|
| Channel | Dropdown list of available channel names to choose from | Dropdown | Yes |
| Users | Dropdown list of available usernames to choose from | Dropdown | Yes |
| Force Invite | Flag to force invite the users to a specific channel | Boolean | No |
Example Usage
Basic Channel Invitation
{
"channel": "testing",
"users": ["Shubham Agarwal – [email protected]"]
}Force Invite to Channel
{
"channel": "project-alpha",
"users": ["Shubham Agarwal – [email protected]"],
"forceInvite": true
}Invite Multiple Users
{
"channel": "general",
"users": [
"Shubham Agarwal – [email protected]",
"John Doe – [email protected]",
"Jane Smith – [email protected]"
]
}Response
Upon successful invitation, the action returns:
- Channel ID
- User IDs added
- Invitation status
- Timestamp
Use Cases
Invite a new user to an existing Slack Channel: The virtual assistant can automatically add relevant team members to specific Slack channels upon request. This is particularly useful for project managers or team leads who need to ensure that all key contributors are included in discussions, speeding up collaboration and reducing onboarding delays.
Common Use Cases
- Project Onboarding: Add new team members to project-specific channels
- Cross-functional Collaboration: Invite stakeholders from different departments
- Event Channels: Add attendees to event-specific channels
- Department Channels: Automatically add new employees to department channels
- Temporary Access: Invite contractors or consultants to relevant channels
- Team Restructuring: Add users to channels based on organizational changes
Assign user to a Workspace
This action is used to assign a user to a workspace in Slack.
Input Fields
| Field | Description | Type | Required |
|---|---|---|---|
| Workspace | Dropdown list of available workspaces | Dropdown | Yes |
| Select Channels | Dropdown list of available slack channels | Dropdown | Yes |
| Is this user a multi-channel guest user? | Flag if the user is a multi-channel guest user or not | Boolean | No |
| Is Ultra Restricted | Flag if the user is ultra restricted or not | Boolean | No |
Example Usage
Basic Workspace Assignment
{
"workspace": "Testing",
"selectChannels": ["testing", "general"]
}Assign Multi-Channel Guest
{
"workspace": "Production",
"selectChannels": ["project-alpha", "announcements"],
"isMultiChannelGuest": true,
"isUltraRestricted": false
}Assign Restricted User
{
"workspace": "Testing",
"selectChannels": ["limited-access"],
"isMultiChannelGuest": false,
"isUltraRestricted": true
}Response
Upon successful assignment, the action returns:
- User ID
- Workspace ID
- Assigned channels
- User type (guest/restricted/regular)
- Assignment timestamp
Use Cases
Assigning a user to a workspace: This enables the virtual assistant to assign users to Slack workspaces based on their channels and user types. IT or HR can request workspace assignments for new employees, ensuring they gain quick access to relevant channels and resources from day one, enhancing onboarding efficiency.
Common Use Cases
- Employee Onboarding: Automatically assign new hires to appropriate workspace and channels
- Contractor Access: Provide limited workspace access to contractors or vendors
- Guest Users: Assign guest users to specific channels for collaboration
- Department Setup: Assign users to department-specific workspaces
- Project Teams: Create workspace access for project-based teams
- Temporary Access: Assign temporary users with appropriate restrictions
Get user information
This action is used to fetch user information from Slack.
Input Fields
| Field | Description | Type | Required |
|---|---|---|---|
| User | Dropdown list of available users | Dropdown | Yes |
Example Usage
Get User Info
{
"user": "Shubham Agarwal – [email protected]"
}Get Multiple User Info (Sequential Calls)
{
"user": "John Doe – [email protected]"
}Response
The action returns user information including:
- User ID
- Display name
- Real name
- Email address
- Status (active/inactive)
- Profile information (title, department, phone)
- Time zone
- Avatar/profile picture URL
- Account creation date
- Last activity timestamp
Use Cases
Retrieval of user information: This allows the virtual assistant to retrieve user details, including roles and activity status. HR and managers can use it to access up-to-date information on team members, facilitating collaboration and confirming users' access rights for sensitive projects or channels.
Common Use Cases
- Profile Verification: Verify user information before granting access
- Directory Services: Build employee directories with up-to-date information
- Contact Information: Retrieve contact details for communication
- Access Control: Confirm user roles before granting permissions
- Audit Trail: Track user information for compliance purposes
- Integration Sync: Sync user data with other systems
Update a user profile
This action is used to update slack user profile information of an existing user.
Input Fields
| Field | Description | Type | Required | Example |
|---|---|---|---|---|
| User | Dropdown list of available users in the slack channel | Dropdown | Yes | Shubham Agarwal – [email protected] |
| Display Name | Name to be displayed on slack profile | String | No | Shubham |
| First Name | First Name of the user | String | No | Shubham |
| Last Name | Last Name of the user | String | No | Agarwal |
| Pronouns | Pronouns of the user | String | No | He / Him |
| Real Name | Real name of the user | String | No | Shubham Agarwal |
| Title / Role | Job Title or Role of the user | String | No | Vice President - Engineering |
Example Usage
Update User Title
{
"user": "Shubham Agarwal – [email protected]",
"title": "Vice President - Engineering"
}Update Full Profile
{
"user": "Shubham Agarwal – [email protected]",
"displayName": "Shubham",
"firstName": "Shubham",
"lastName": "Agarwal",
"pronouns": "He / Him",
"realName": "Shubham Agarwal",
"title": "Vice President - Engineering"
}Update Name Only
{
"user": "John Doe – [email protected]",
"firstName": "Jonathan",
"lastName": "Doe",
"displayName": "Jon"
}Update Pronouns
{
"user": "Jane Smith – [email protected]",
"pronouns": "She / Her"
}Response
Upon successful update, the action returns:
- User ID
- Updated fields
- Update timestamp
- Confirmation status
Use Cases
Update User: This enables the virtual assistant to update user details, such as job title or department upon requests made through the virtual assistant. By keeping Slack user information current, the assistant helps maintain consistency across platforms, enabling team members to quickly identify users by their updated roles or departments.
Common Use Cases
- Role Changes: Update job titles when employees get promoted or change roles
- Department Transfers: Update department information during organizational changes
- Name Changes: Update user names for legal or personal reasons
- Profile Consistency: Ensure profile information is consistent across all platforms
- Automated Updates: Sync profile updates from HR systems
- Pronoun Updates: Allow users to update their preferred pronouns
Remove user from a Channel
This action is used to remove an existing user from a slack channel.
Input Fields
| Field | Description | Type | Required |
|---|---|---|---|
| Channel | Dropdown list of available slack channels | Dropdown | Yes |
| User | Dropdown list of available users in the slack channel | Dropdown | Yes |
Example Usage
Remove User from Channel
{
"channel": "testing",
"user": "Shubham Agarwal – [email protected]"
}Remove User from Project Channel
{
"channel": "project-alpha",
"user": "John Doe – [email protected]"
}Remove Multiple Users (Sequential Calls)
{
"channel": "old-project",
"user": "Jane Smith – [email protected]"
}Response
Upon successful removal, the action returns:
- Channel ID
- User ID removed
- Removal status
- Timestamp
Use Cases
Remove user from channel: This allows the virtual assistant to remove users from specific Slack channels upon project completion or role change. For example, when employees transition to different projects, the assistant can clean up their channel access based on requests, enhancing information security and maintaining focus in active channels.
Common Use Cases
- Project Completion: Remove users from project channels after project ends
- Role Changes: Remove users from channels no longer relevant to their role
- Access Control: Remove users who no longer need access to specific channels
- Department Transfers: Remove users from old department channels
- Security Compliance: Remove access to sensitive channels when no longer needed
- Channel Cleanup: Maintain clean channel membership lists
Remove a user from Workspace
This action is used to remove an existing user from a slack workspace.
Input Fields
| Field | Description | Type | Required |
|---|---|---|---|
| Workspace | Dropdown list of available slack workspaces | Dropdown | Yes |
| User | Dropdown list of available users in the slack channel | Dropdown | Yes |
Example Usage
Remove User from Workspace
{
"workspace": "test",
"user": "Shubham Agarwal – [email protected]"
}Remove Former Employee
{
"workspace": "Production",
"user": "Former Employee – [email protected]"
}Remove Contractor Access
{
"workspace": "Development",
"user": "Contractor Name – [email protected]"
}Response
Upon successful removal, the action returns:
- Workspace ID
- User ID removed
- Removal status
- Timestamp
Use Cases
Remove user from workspace: The virtual assistant can remove former employees or project stakeholders from the Slack workspace upon requests made on the virtual assistant, ensuring compliance with security policies. This process is valuable for off-boarding, as it helps IT and HR to promptly revoke access for users who no longer require it.
Common Use Cases
- Employee Off-boarding: Remove former employees from workspace during off-boarding
- Contract Completion: Remove contractors when their contracts end
- Security Compliance: Revoke access for users who no longer need it
- Access Audit: Remove inactive or unused accounts
- Policy Enforcement: Ensure compliance with access control policies
- Workspace Cleanup: Maintain clean workspace membership
Archive Channel
This action is used to archive an existing Slack Channel.
Input Fields
| Field | Description | Type | Required |
|---|---|---|---|
| Channel | Dropdown list of active slack channels | Dropdown | Yes |
Example Usage
Archive Completed Project Channel
{
"channel": "Testing"
}Archive Old Department Channel
{
"channel": "old-marketing-team"
}Archive Temporary Event Channel
{
"channel": "conference-2024"
}Response
Upon successful archiving, the action returns:
- Channel ID
- Channel name
- Archive status
- Archive timestamp
Use Cases
Archive existing slack channel: This allows the user to archive Slack channels that are no longer active or relevant, keeping workspace communication organized. Users can request Leena AI Virtual Assistant to archive channels related to completed projects, reducing clutter and improving channel discoverability for active projects and teams.
Common Use Cases
- Project Completion: Archive channels for completed projects
- Event Cleanup: Archive temporary event or campaign channels
- Workspace Organization: Reduce clutter by archiving inactive channels
- Historical Preservation: Preserve channel history while removing from active list
- Department Restructuring: Archive channels from old organizational structures
- Seasonal Channels: Archive channels that are only active during certain periods
Best Practices
Before Archiving:
- Notify Members: Inform channel members before archiving
- Export Important Content: Save any critical information or files
- Review Activity: Confirm the channel is truly inactive
- Check Dependencies: Ensure no active workflows depend on the channel
After Archiving:
- Document Reason: Record why the channel was archived
- Retention Policy: Follow organizational data retention policies
- Restore Process: Know how to restore if needed
- Audit Trail: Maintain records of archived channels
Error Handling
Common error scenarios:
- Channel Not Found: Invalid channel name or ID
- Permission Denied: Insufficient permissions to archive
- Channel Already Archived: Channel is already in archived state
- Active Workflows: Channel has active integrations or workflows
Updated about 20 hours ago
