> ## Documentation Index
> Fetch the complete documentation index at: https://help.cloudtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Forward Incoming SMS to Slack

> Our workflow automations allow you to forward inbound SMS messages to your company Slack.

> [!NOTE]
>
> Create a workflow to automatically forward an incoming SMS to a Slack channel.

**User Level**: Admin

***

## Create CloudTalk App in Slack

Before sending API calls to Slack, you must create a CloudTalk app and allow it to post in designated channels.

1. From the [Slack API apps](https://api.slack.com/apps) page, select **`Create an App`**.

   ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/a05e9cfb6a36-screenshot-2023-12-13-at-11-49-52.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=772565bfae91d67b29ea3f158873c321)

2. Select **From scratch**.

3. Enter `CloudTalk` as the **App Name** and select your business Slack workspace.

4. **`Create App`**.

5. Navigate to **Features** **>** **Incoming Webhooks** within the app pages.

   1. Turn on **Activate Incoming Webhooks**.

      ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/4a2be47ca83e-activate-incoming-webhooks.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=91a372481485df7eda667d1f6800de02)

6. Navigate to **Features >** **OAuth & Permissions**.

   1. Under *Scopes* **> Bot Token Scopes**, select **`Add an OAuth Scope`**.

      1. Select **chat:write.customize** scope.

      2. Select **`Add scopes`** when asked to add **chat:write**.

      3. Select **chat:write.public** as the last scope in this section.

         ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/ea88f15da8d2-adding-bot-scopes.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=40573014d3c11adb1cc19c50842031e6)

   2. Under *Scopes* **> User Token Scopes**, select **`Add an OAuth Scope`**.

      1. Select **chat:write**.

7. Navigate to **Settings > Install App** and select **`Install to Workspace`**.

8. Choose the channel you want your CloudTalk app to post in. **Allow**.

   ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/f667fab921e2-test-app-auth-to-channel.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=93a8116beb1ec66758e03d45f7b027ea)

9. When redirected back to **Settings > Install App**, you will be able to see the **User OAuth Token** and **Bot User OAuth Token**. You will need to copy one of these values when setting up your workflow.

   ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/981abab211bd-user-oauth-token-copy.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=bf886d877b045ef158cc5661f961f28d)

> [!WARNING]
>
> **If the admin configuring the workflow** **automation** is not added to the channel you've selected to post in, the **Bot User OAuth Token** will need to be used for the `token` value in the next steps. This is because using the **User OAuth Token** only allows posting in channels where the associated CloudTalk user is added.

***

## Slack SMS Workflow

In this example, we will automate sending a notification to Slack in response to an SMS received. This one of many ways to automate workflow with CloudTalk.

**Goal:**

* Forward a text message from an important client to the team Slack channel.

### Prerequisites

* You've successfully added an [Essential, Expert, or Custom plan with CloudTalk](https://www.cloudtalk.io/pricing)

* You have created a CloudTalk app in Slack and connected it to your desired Slack channel (see [Create CloudTalk App in Slack](#h_a6528e6336)).

* Token permissions for your team Slack channel include **chat:write** permissions, meaning your workplace allows data coming in from another app to post on Slack channels in place of an individual user. You can reference the Slack API help guide to [read about how Slack tokens work](https://api.slack.com/authentication/token-types).

## **Send SMS Notification to Channel**

From your dashboard, navigate to **Workflow Automations**.

1. Select **+Add Workflow** and name your workflow.

2. Start by defining a **[trigger](https://help.cloudtalk.io/en/articles/5648924-triggers.md)**. In this example, our trigger will be the receipt of an SMS. Under **Object**, we will select **Message**. For **Action**, we select **received**.

   *Adjust your own specifications as necessary.*

   ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/3c3334f79013-image.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=86212a1e1faeb61fb2094aa0b89092fc)

3. Now we can choose to set up an optional **[condition](https://help.cloudtalk.io/en/articles/5649346-conditions.md)**. The condition will define an additional situation or category that must be met in order for our automated Slack notification to go out.

4. In our example, we only care if the SMS which was received (our trigger) was a from a particular important client. Therefore, we want to set a condition wherein the system will check if SMS sender has the same number as the important client. To populate the field correctly, click into the first input labeled **Property**, and view the list of available phrases to the right, labeled under **Useful data for your Workflow**. We will choose the phrase labeled **sender**.

   ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/c46a6103d997-image.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=4787caf298dfe8c79e6b1b8b9b21cea7)

   ```
   Important: You must choose from this list of tag words in order for your condition to work correctly. You should see the Property input populate with a value that looks like the structure of the one in the picture (event.properties.tags) 
   ```

5. In the drop-down menu labeled **Operand**, we will choose **is equal to** from the dropdown list. When selecting your own operand, make sure it fits logically into your final statement (e.g., "is greater than or equal to" would best be paired with a number value).

6. In the Value input, we fill in the value which we want the **sender** to be **equal to** in order for our action to occur. Refer to the paired **Example Values** in the **Useful data for your Workflow** sidebar. In our example, the suggested value will be the important client's phone number, entered in the format shown.

   ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/5034078fdedb-image.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=d9ca21d9d27e2fecb4f3a582271bb0cd)

   Click **`Confirm and continue`**`.` We have just created a condition that will scan the CloudTalk numbers of all SMS messages received, checking if the sender number is equivalent to the important client's number.

7. The next step is to choose an [action](https://help.cloudtalk.io/en/articles/5649782-actions.md) which will happen when our conditions are met. We select the **Action type Send notification to Slack.**

8. Under **Values**, various Keys in each key-format-value set are prepopulated and cannot be changed. You will use the value part of these sets to configure your Slack notifications. In the configuration set where the **Key** refers to ***token***, replace the x's with the actual token value to authorize communication between CloudTalk and your Slack workspace. To connect to Slack, you must use either the User OAuth Token or the Bot User OAuth Token, which can be found in your Slack app settings (see [Create CloudTalk App in Slack](https://help.cloudtalk.io/en/articles/5959405-send-transcriptions-to-slack.md#h_3248403432)).

   ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/c61af317f267-image.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=0eb91c224b30de7198ca67233fcf2481)

   1. The **Bot User OAuth** allows posting in any public Slack channel, while the **User OAuth** requires you to be added to the channel.

   2. *Refer to the [Slack help center](https://slack.com/help/articles/215770388-Create-and-regenerate-API-tokens) for additional guidance on Slack tokens.*

9. Enter the name of your Slack channel in the **Value** input in the configuration set where the **Key** refers to ***channel***.

10. In the configuration set where the **Key** refers to ***text***, you can choose to enter a dynamic value—one that will be populated based on information from the system. To do this, click into the field, then select a keyword from the **Useful Data for Your Workflow** section, as described in step 4 of this guide..

11. We have chosen three dynamic values for the **text** or content portion of our message which will send to slack. We know the Slack notification will contain the phone number, recipient phone number and the content of the SMS received.

    ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/f077aa39551c-image.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=679a97526440455e837569980cdbe6e7)

12. Click Confirm and continue to finish the action step configuration.

13. Click **Save** to finish the workflow configuration.

14. To activate your Slack notifications, enable your workflow by switching the toggle next to the workflow name to the On position.

    ![](https://mintcdn.com/cloudtalk/0B2VFDHod1TeIVNA/images/help-center/articles/5671117/803a594dac5f-image.png?fit=max\&auto=format\&n=0B2VFDHod1TeIVNA\&q=85\&s=827518d3118454457350e7818dfba894)

We have now accomplished our goal of forwarding a text message from an important client to the team Slack channel, a process which we can later edit and toggle **off** or **on** at our choosing.

## Troubleshooting Tips

* When it comes to Slack:

  * Confirm your team's Slack app is up and running and that you are signed in

  * Check that you have successfully authorized Slack to access CloudTalk

  * Make sure your token scopes include **chat:write** permissions. Refer to the [Slack API guides](https://api.slack.com/authentication/token-types) or the [Slack help center](https://slack.com/help/articles/215770388-Create-and-regenerate-API-tokens) for assistance.

- Faulty conditions are often the result of unrecognized values in the **Property** input, or value in the **Value** input which will always result in no matches.

- After clicking into the **Property** input, you *must click one of the **pre-selected keywords*** within the **Useful data for your Workflow** section to the right.

- You can also refer to the **Useful data for your Workflow** section to validate whether the **Value** you entered seems to be a good match for the property you've chosen.

- When setting a value for a condition that searches entered phone numbers, make sure you are using the number recognized through CloudTalk. Format matters. If the suggested value example in the **Useful data for your Workflow** section has a number with the format "*[+55 55 5555 5555](ct+tel://+555555555555)*" (no hyphens included) but the entered value looks like "*[+55 55 5555 5555](ct+tel://+555555555555)*" (hyphens included), your condition will never find matches.

***

*Need help or have a question?* Just reach out through our [Support portal](https://support.cloudtalk.io/hc/en-us/requests/new?ticket_form_id=26305535257884) — we’re here for you.


## Related topics

- [Workflow Automations guide](https://help.cloudtalk.io/en/articles/10568412-workflow-automations-guide.md)
- [Configuring Workflow Automations](https://help.cloudtalk.io/en/articles/5450779-configuring-workflow-automations.md)
- [Send Transcriptions to Slack](https://help.cloudtalk.io/en/articles/5959405-send-transcriptions-to-slack.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.