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:

  1. Administrator access to your Slack workspace
  2. Ability to create applications in Slack
  3. Access to your Leena AI workspace with connector management permissions

Setting up the Slack Connector

Step 1: Create Application in Slack

  1. Go to https://api.slack.com/apps
  2. Click on Create New App
  3. Choose a name for your application
  4. Select your workspace
  5. Click Create App

Step 2: Configure OAuth Permissions

  1. Navigate to Features → OAuth & Permissions in your app settings
  2. Add the redirect URL provided by Leena AI under Redirect URLs
  3. Scroll down to Scopes section
  4. Add relevant permissions (recommended scopes):
    • users:read - View users in workspace
    • users:write - Modify user information
    • channels:read - View channels
    • channels:manage - Manage channels
    • groups:read - View private channels
    • groups:write - Manage private channels
    • chat:write - Send messages
    • admin.users:write - Manage users in workspace

Step 3: Get Client ID and Client Secret

  1. Navigate to Basic Information in your app settings
  2. Scroll down to App Credentials section
  3. Copy the Client ID
  4. 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

  1. 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
  2. Replace CLIENT_ID with your generated Client ID
  3. Replace REDIRECT_URL with the redirect URL provided by Leena AI
  4. Open the URL in a browser
  5. Review the permissions listed
  6. Click Allow to grant the permissions and complete the authorization process

Step 5: Create Connector in 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. Enter the following details:
ParameterDescriptionExample
Client IDOAuth application client IDGenerated from Slack app
Client SecretOAuth application client secretGenerated from Slack app
  1. Click Test Connection to verify the setup
  2. If successful, click Save to store the connector configuration

Supported Actions

Leena AI Slack connector supports the following actions:

Action NameDescription
Invite user to a channelAdd an existing user to a specific non-archived channel
Invite user to a workspaceAdd and invite a new user to Org's workspace
Get a user's informationFetch a user's information against a unique identifier
Update user informationUpdate user information
Remove user from a workspaceRemove a user from an Org's workspace
Remove user from a channelRemove a user from a specific channel
Archive channelArchive an existing Slack channel

Use Cases

Some of the use cases that you can achieve using Slack connector are below:

  1. Onboarding Journey: Create a new user and invite them to Org's Workspace as part of the employee onboarding process.

  2. Off-boarding Journey: Remove a user from the Org's workspace as part of the employee off-boarding process.

  3. Profile Management: Allow users to view and update their profile information on Slack through the virtual assistant.

  4. Channel Management: Automatically manage channel memberships based on project assignments or role changes.

  5. Workspace Cleanup: Archive inactive channels to maintain workspace organization.

Security Best Practices

  1. Client Secret Security: Store Client ID and Client Secret securely
  2. Principle of Least Privilege: Only grant necessary permissions to the Slack app
  3. Access Monitoring: Monitor API usage through Slack admin panels
  4. Regular Audits: Review connector permissions and access logs periodically
  5. 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

FieldDescriptionTypeRequired
ChannelDropdown list of available channel names to choose fromDropdownYes
UsersDropdown list of available usernames to choose fromDropdownYes
Force InviteFlag to force invite the users to a specific channelBooleanNo

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

  1. Project Onboarding: Add new team members to project-specific channels
  2. Cross-functional Collaboration: Invite stakeholders from different departments
  3. Event Channels: Add attendees to event-specific channels
  4. Department Channels: Automatically add new employees to department channels
  5. Temporary Access: Invite contractors or consultants to relevant channels
  6. 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

FieldDescriptionTypeRequired
WorkspaceDropdown list of available workspacesDropdownYes
Select ChannelsDropdown list of available slack channelsDropdownYes
Is this user a multi-channel guest user?Flag if the user is a multi-channel guest user or notBooleanNo
Is Ultra RestrictedFlag if the user is ultra restricted or notBooleanNo

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

  1. Employee Onboarding: Automatically assign new hires to appropriate workspace and channels
  2. Contractor Access: Provide limited workspace access to contractors or vendors
  3. Guest Users: Assign guest users to specific channels for collaboration
  4. Department Setup: Assign users to department-specific workspaces
  5. Project Teams: Create workspace access for project-based teams
  6. Temporary Access: Assign temporary users with appropriate restrictions

Get user information

This action is used to fetch user information from Slack.

Input Fields

FieldDescriptionTypeRequired
UserDropdown list of available usersDropdownYes

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

  1. Profile Verification: Verify user information before granting access
  2. Directory Services: Build employee directories with up-to-date information
  3. Contact Information: Retrieve contact details for communication
  4. Access Control: Confirm user roles before granting permissions
  5. Audit Trail: Track user information for compliance purposes
  6. 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

FieldDescriptionTypeRequiredExample
UserDropdown list of available users in the slack channelDropdownYesShubham Agarwal – [email protected]
Display NameName to be displayed on slack profileStringNoShubham
First NameFirst Name of the userStringNoShubham
Last NameLast Name of the userStringNoAgarwal
PronounsPronouns of the userStringNoHe / Him
Real NameReal name of the userStringNoShubham Agarwal
Title / RoleJob Title or Role of the userStringNoVice 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

  1. Role Changes: Update job titles when employees get promoted or change roles
  2. Department Transfers: Update department information during organizational changes
  3. Name Changes: Update user names for legal or personal reasons
  4. Profile Consistency: Ensure profile information is consistent across all platforms
  5. Automated Updates: Sync profile updates from HR systems
  6. 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

FieldDescriptionTypeRequired
ChannelDropdown list of available slack channelsDropdownYes
UserDropdown list of available users in the slack channelDropdownYes

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

  1. Project Completion: Remove users from project channels after project ends
  2. Role Changes: Remove users from channels no longer relevant to their role
  3. Access Control: Remove users who no longer need access to specific channels
  4. Department Transfers: Remove users from old department channels
  5. Security Compliance: Remove access to sensitive channels when no longer needed
  6. 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

FieldDescriptionTypeRequired
WorkspaceDropdown list of available slack workspacesDropdownYes
UserDropdown list of available users in the slack channelDropdownYes

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

  1. Employee Off-boarding: Remove former employees from workspace during off-boarding
  2. Contract Completion: Remove contractors when their contracts end
  3. Security Compliance: Revoke access for users who no longer need it
  4. Access Audit: Remove inactive or unused accounts
  5. Policy Enforcement: Ensure compliance with access control policies
  6. Workspace Cleanup: Maintain clean workspace membership

Archive Channel

This action is used to archive an existing Slack Channel.

Input Fields

FieldDescriptionTypeRequired
ChannelDropdown list of active slack channelsDropdownYes

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

  1. Project Completion: Archive channels for completed projects
  2. Event Cleanup: Archive temporary event or campaign channels
  3. Workspace Organization: Reduce clutter by archiving inactive channels
  4. Historical Preservation: Preserve channel history while removing from active list
  5. Department Restructuring: Archive channels from old organizational structures
  6. Seasonal Channels: Archive channels that are only active during certain periods

Best Practices

Before Archiving:

  1. Notify Members: Inform channel members before archiving
  2. Export Important Content: Save any critical information or files
  3. Review Activity: Confirm the channel is truly inactive
  4. Check Dependencies: Ensure no active workflows depend on the channel

After Archiving:

  1. Document Reason: Record why the channel was archived
  2. Retention Policy: Follow organizational data retention policies
  3. Restore Process: Know how to restore if needed
  4. 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