Create a Slack app, then choose send-only (Incoming Webhooks) or two-way (Events API via HTTPS or Socket Mode). Install with OAuth and grant the right scopes. Optionally, deploy a CustomGPT.ai agent directly to connect Slack for an instant, no-code bot.
Prerequisites
You’ll need a Slack workspace and permission to create/install apps. Decide if your bot is send-only or two-way. For hosting, use a public HTTPS Request URL or avoid inbound ports with Socket Mode. Always verify Slack request signatures and request only minimal scopes.
Option 1 — Send-only via Incoming Webhooks
- In your Slack app, enable Incoming Webhooks.
- Generate the channel-scoped webhook URL.
- POST JSON (text or Block Kit) to the URL to send messages.
- Rotate or revoke the webhook if it’s leaked.
- This is the fastest path when you just need to push messages into Slack.
Option 2 — Two-way bot with Events API
- Add bot scopes (for example, chat:write; add read scopes only if needed).
- Configure OAuth v2; install your app to the workspace to obtain a bot token.
- Set a Request URL and subscribe to events (e.g., app_mention, message events).
- Verify Slack signatures and handle retries.
- Reply using Web API methods like chat.postMessage.
Variant — Socket Mode
Use Socket Mode when you can’t expose a public HTTPS endpoint or prefer an inside-the-firewall connection. Open a WebSocket using your app-level token; Slack delivers Events API and interactivity payloads over the socket. Trade-off: you manage a long-lived socket.
Commands & Interactivity
Add slash commands for typed triggers that hit your Request URL and must respond quickly; threaded use is limited. For richer UI, add shortcuts and modals to collect inputs and guide workflows.
How to do it with CustomGPT.ai
Goal: Connect Slack and deploy a CustomGPT.ai agent for in-Slack conversations.
- Connect CustomGPT.ai to Slack: In CustomGPT.ai, open your agent’s Integrations → Slack and click Connect; authorize in Slack.
- Deploy an agent to a channel: Choose the agent and Deploy to Slack to add it to a specific channel for direct usage.
- Control access: Configure who can invite or use the agent in your workspace.
- Automate with Zapier (optional): Use the CustomGPT Zapier app to send leads or agent messages into Slack or trigger Slack workflows.
- Build a custom Slack bot (optional): If you prefer a bespoke bot, have your Slack app call the CustomGPT Chat Completions API to generate replies, using your API key.
Notes: The steps above are documented on docs.customgpt.ai. If you need per-message routing or CRM syncing, use Zapier “Send Message” to the agent and Slack actions.
Example — Auto-reply to #support mentions
- Slack side: Create a Slack app, add chat:write, install via OAuth, subscribe to app_mention, and set the Request URL. Verify signatures on inbound events.
- Bot handler (pseudo): On app_mention, extract text → call your bot logic → post a reply with chat.postMessage.
- Tip: If you can’t host a public URL, switch the app to Socket Mode and process events over WebSocket.
Conclusion
Connecting Slack to your chatbot is a choice between wiring every webhook, event, and socket yourself or plugging into a streamlined, workspace-ready integration.
CustomGPT.ai lets you skip the boilerplate by deploying an agent directly into Slack channels, handling auth, message routing, and access control for you—and still leaves room for bespoke bots via API or Zapier when you need more.
Open your agent’s Integrations → Slack tab, connect your workspace, and test your agent live in a Slack channel.