Slack DM Integration
Overview
By integrating a Slack App with QueryPie, you can receive Direct Message notifications from QueryPie.
This document applies to QueryPie version 10.2.6 or later.
For instructions on Slack integration with version 10.2.5 or earlier, please refer to the 10.1.0 version manual.
Prerequisite Permissions for Configuration
Slack Workspace Administrator account: Required to install Apps in your Slack Workspace.
QueryPie Owner and Approval Admin permission accounts.
Creating DM App in Slack API (via Manifest File)
Create a dedicated Slack App for QueryPie DM integration using an App Manifest.
Navigate to https://api.slack.com/apps and click
Create an App
.In the "Create an app" modal, select how you want to create the app. Click
From a manifest
.In the "Pick a workspace" modal, select the Slack Workspace you want to integrate with QueryPie, then proceed to the next step.
In the "Create app from manifest" modal, you will enter the App Manifest in JSON format. Delete any pre-filled content and paste the following App Manifest. Then, proceed to the next step.
Remember to change the values within
{{..}}
to your desired values.CODE{ "display_information": { "name": "{{name}}" }, "features": { "bot_user": { "display_name": "{{display_name}}", "always_online": false } }, "oauth_config": { "scopes": { "bot": [ "chat:write", "users:read.email", "users:read" ] } }, "settings": { "interactivity": { "is_enabled": true }, "org_deploy_enabled": false, "socket_mode_enabled": true, "token_rotation_enabled": false } }
Review the settings and click the
Create
button to complete the App creation.
Installing Slack App to Slack Workspace
In your newly created Slack App's settings page, navigate to Settings > Install App. Click the
Install to Workspac
e button to install the app into your Slack Workspace.On the permission request page, click
Allow
.You should now see the dedicated Slack DM App created in your selected Slack Workspace.
Obtaining Bot User OAuth Token
In your Slack App's settings, navigate to the Features > OAuth & Permissions menu. In the "OAuth Tokens for Your Workspace" section, copy the Bot User OAuth Token and keep it for later use.

Creating App-Level Token
Although Socket Mode and related permissions can be enabled when creating a Slack app with an App Manifest, an App-Level Token (which starts with xapp-) is not automatically generated.
App-Level Tokens are security credentials; automatic generation/exposure via a manifest would be a security risk.
The App Manifest only defines the app's configuration; actual authentication tokens are generated and managed separately.
Follow these steps to manually create an App-Level Token:
In your Slack App's settings page, navigate to the Settings > Basic Information menu. Go to the "App-Level Tokens" section and click the
Generate Token and Scopes
button.In the "Generate an app-level token" modal, click the Add Scope button and add the
connections:write
scope.In the "App-Level Token generated" modal, copy the app token and store it securely for later use. Remember, App-Level Tokens start with
xapp-
.
Configuring Slack DM in QueryPie
In QueryPie, navigate to the Admin > General > System > Integrations > Slack menu. Click the
Configure
button to open the settings modal.In the settings modal, enter the App Token and the Bot User OAuth Token that you copied earlier.
Configure the additional settings as needed. To receive Workflow notifications via DM and to approve/reject requests directly within Slack messages, enable all setting toggles:
Send Workflow Notification via Slack DM: Enables sending Slack DMs for workflow requests.
Allow Users to approve or reject on Slack DM: Enables approval or rejection functionalities directly within Slack DMs.
Click the
Save
button to complete the setup.
Managing Slack DM Settings
After registering the Slack Configuration, you can view the current setup status on the screen.
Click the
Edit
button to change the entered settings.
Test Slack DM for Workflow Requests
Using a DB Access Request as an example, perform a test to ensure the Slack DM functionality is working correctly.
In QueryPie, navigate to the User > Workflow page. Click the Submit Request button, select DB Access Request, and proceed to the request creation screen. Fill in the necessary information and submit the request.
The designated approver(s) will receive a DM notification from the Slack App you configured, informing them of the pending request.
If the Allow Users to approve or reject on Slack DM setting is enabled, the approver can directly enter a reason and approve or reject the request within the DM.
Clicking the
Details
button in the DM will redirect the approver to the QueryPie Admin page, where they can view detailed information about the request and then approve or reject it.