---
title: "How to build a ChatGPT Slack bot with Zapier"
description: "Want ChatGPT to help you answer questions in Slack? With Zapier, it's easy. This post will show you how to build two kinds of ChatGPT Slack bots."
image: "https://images.ctfassets.net/lzny33ho1g45/3WvaGdX8hwcdBhLyyrkaUn/bbfe56fc9ec009d2395dc1a0ee033937/Group_12419.jpg"
---

# How to build a ChatGPT Slack bot with Zapier

Want ChatGPT to help you answer questions in Slack? With Zapier, it's easy. This post will show you how to build two kinds of ChatGPT Slack bots.

At Zapier, everyone works remotely—so [Slack](https://zapier.com/apps/slack/integrations) is our central hub for communication. And one of our favorite ways to get even more out of Slack is by connecting it to other tools, like [ChatGPT](https://zapier.com/apps/chatgpt/integrations), using Zapier.

By integrating ChatGPT with Slack, you can build AI-powered bots that answer questions, summarize information, and retrieve company data—all without leaving your chat window.

In this post, I'll show you how to build two kinds:

- **A ChatGPT reply bot:** This bot auto-responds when someone posts a message in a designated Slack channel.
- **A ChatGPT slash command bot:** This bot auto-responds when someone types a custom command (like `/askchatgpt`) in any Slack channel.

Let's get into it.

### Skip ahead

- [Before you build a ChatGPT bot](#before)
- [Create a ChatGPT reply bot in Slack](#reply-bot)
- [Create a ChatGPT slash command bot](#slash-command-bot)

## Before you build a ChatGPT Slack bot

To build either bot, you'll need an OpenAI account and an API key.

If you already have an account for ChatGPT, that means you’ve got an OpenAI account, too. Otherwise, [create one here](https://platform.openai.com/signup). 

Once you're logged in, head to the [API keys page](https://platform.openai.com/api-keys), click **+Create a new secret key** in the top-right corner, then **+Create secret key. **A pop-up will display your new key. Be sure to copy it now and save it somewhere because you won’t be able to view the key a second time. (But if you lose it, all good—just generate another.)

## Create a ChatGPT reply bot in Slack

With Zapier, you can create automated workflows (we call them Zaps) that send information between apps. You can [create a Zap](https://zapier.com/editor) from scratch or use a template to get started fast. 

Using a template is easy. Click on the Zap template below, which will take you to the Zap editor. You'll be prompted to create a Zapier account if you don't have one already. After that's done, just follow the setup instructions below.

### Set up your Slack trigger

Time to set up your trigger—the event that starts your Zap. 

Choose **Slack** for your trigger app and **New Message Posted to Channel **as your action event. If you're using the Zap template, this will already be selected for you. Then click **Select** to connect your account. First time doing this? Just click **+Connect a new account** in the modal that appears, then click **Continue**.

Next, select the channel where your ChatGPT bot will answer questions. Click the dropdown menu to see the list of channels in your selected Slack account, pick one, then click **Continue**. 

Now click **Test trigger**. Zapier will find a recently posted message in your chosen channel and use it to set up the rest of your Zap. After you pick a record, click **Continue with selected record.**

### Set up your ChatGPT action

Now let's set up your action—the event your Zap will perform once it's triggered. 

Choose **ChatGPT** as your action app and **Conversation **as your action event. If you're using the Zap template, this will already be selected for you. 

Now connect your account. If this is the first time you've connected OpenAI to Zapier, you'll be taken to a window where you enter that API key from earlier. Drop in that key, then click **Yes, Continue to ChatGPT (OpenAI)**.

Click **Continue** to move on to configuring this step. 

Pick the ChatGPT model you'd like to use. Then, in the _User Message_ field, map  data from your Slack step, pulling in a sample question posted in your Slack channel of choice. To map data from a previous step, click the **+ sign** in the field or type a forward slash (/).

Finally, give your OpenAI bot some instructions. For the purposes of this tutorial, I’m going to build a content assistant to answer my teammates' questions about blog content. But you can tailor your instructions to suit any use case. 

Click **Continue**, then test your step.** **Zapier will pull the response from your bot, according to how you customized your fields. Once your action is working, click the **+ **button below your action step. (If you're using a template, just click into the next step.)

### Set up your Slack action

Now, you'll set up the final step: sending your ChatGPT response to Slack. 

If you're not using the template, choose **Slack** for your action app and **Send Channel Message** for your action event. Again, you'll be asked to connect your Slack account. In most cases, this will be the same account you connected earlier. When you're done, click **Continue.**

Now, set up how the message from your ChatGPT bot will look in Slack and where it'll be posted. Select the Slack channel from your previous Slack step.

Add any other context you want to the _Message Text_** **field, and make sure to pick **Full Response **from the data dropdown, as that contains your response from ChatGPT.

You can also customize where the message comes from, such as from a bot or yourself. If you choose a bot, you can customize things like the bot name and the icon that appears next to it.

If you'd like your bot to reply in a thread rather than in your Slack channel (and I recommend this), navigate down to the _Thread _field. Click in the field and select the timestamp (shown in Zapier as _Ts_) of the parent message in the dropdown to let Zapier know which message to create a thread for.

Once you've customized your message, click **Continue, **then click **Test action.** Zapier will post a message in your chosen Slack channel to make sure your Zap is working.

If everything looks good with the message thread that Zapier posted to your question, your Zap is ready to use! If something looks off or your test fails, go back and adjust until your message looks how you'd like it to.

## Build a ChatGPT slash command bot

Now you know how to integrate ChatGPT with Slack to reply to particular channel messages. But what if you don't want to limit yourself to just one channel? 

With a [slash command bot](https://zapier.com/blog/how-to-build-chat-bot/), you can send prompts from _any_ channel in your Slack account. Here's how to set it up.

### Create your Slack app and set up your webhook trigger

To create a command bot in Slack, you'll need to start by building a Slack app. Don't worry, it's not as intimidating as it sounds. First go to the [Slack API page](https://api.slack.com/apps) and click **Create an App**.

In the pop-up window, choose whether you want to build _from scratch_ or _from a manifest_—basically, a short text file with JSON or some other structured information serving as a blueprint for what you want to build.

For simplicity, let's build from scratch. You'll be prompted to pick an app name and workspace.

Slack will then show you a bunch of information about your new app. In the left-hand menu, under _Features_, click **Slash Commands**. Then click **Create New Command**.

From there, choose the word or phrase you want to use as your command. Then, you can add a short description of what the command does, as well as a usage hint that lets people know how to use it.

We still need to add the _Request URL_, which we'll get from Zapier's webhooks integration.

In a new tab or window, make a new Zap using **Webhooks by Zapier **as the trigger app and **Catch Hook** as the trigger event.

Click **Continue** twice to reach the _Test_ tab, where you'll see your webhook URL. Copy it.

With that webhook link copied, go back to your Slack slash command's setup page and paste the link into the _Request URL_ field. Then save your settings and install the app into your Slack workspace.

Now it's time to test your slash command. Zapier will use the information from your test throughout the rest of your Zap. Just open Slack and type in your command followed by the prompt you'd like to send to ChatGPT.

After that, go back to the Zap editor and click **Test Trigger.** Zapier will pull in your test prompt from Slack, as well as other information, like the channel and username.

Once you see your webhook working correctly, click **Continue.**

### Set up your ChatGPT action

Now let's set up the ChatGPT action step. Start by choosing **ChatGPT** as your trigger app and **Conversation **as your trigger event, then click **Continue**.

Connect your OpenAI account to Zapier and click **Continue.**

Next, customize how you'll send the prompt to ChatGPT. Since your prompt is just going to be what you typed into Slack, click in the _Message_ field and select **Text **from the _Insert Data_ dropdown.

Once you've finished customizing these fields, click **Continue**. 

Next, click **Test Step.** If everything works smoothly, click the **+ **button below your action step.

### Set up your Slack action

Now it's time to set up your Slack action step and customize how your results from ChatGPT look when they make it to Slack.

You'll follow the same steps that we did previously. Pick **Slack** as your action app and choose **Send Channel Message** as your action event. Then connect your Slack account with Zapier.

Now, to customize your message. One of the differences between this Zap and the previous one we built is that we want to be able to post ChatGPT results in any channel, not just one specific one. 

Instead, click the **kebab menu** (⋮) to the right of the _Channel_ field and choose **Custom**—then click the **+ sign** or type a forward slash (/) to map that to the channel name from your trigger step.

This will let your Zap know to post your ChatGPT result where your slash command was entered rather than in one specific channel.

After that, you can customize your message, as well as the name and icon of your bot, just like we did in the previous Zap. Once you're done customizing, click **Continue.**

Finally, click **Test step**. Zapier will send a test message to your Slack channel for you to look at. If your message looks good, you're ready to use your Zap! Or you can tinker with it until your message looks just right.

## Bring the power of ChatGPT to Slack

ChatGPT Slack bots are amazing for streamlining work, whether you're answering FAQs, pulling data from other apps, or summarizing messages on demand. And beyond the two workflows we covered in this post, there are _so_ many other ways you can leverage AI easily and [securely](https://zapier.com/security-compliance). 

Explore more ways to [orchestrate AI with Zapier](https://zapier.com/blog/zapier-ai-guide/)—or, if you're eager to just start building, dive straight into our [Zap editor](http://zapier.com/editor).

_This article was originally published in April 2023. It was most recently updated in November 2025 by Steph Spector._