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

# WhatsApp inside Salesforce

> How to create a custom tab so your advisors can see and reply to WhatsApp conversations without leaving the CRM.

You can embed the Treble conversation inbox **inside Salesforce**, as one more tab in the navigation bar. The advisor logs in to Salesforce, clicks the tab, and replies to WhatsApp from there.

<img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-tab-5.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=012e13587eb22ff95ebfa2cb70474e7b" alt="The Treble WhatsApp tab inside Salesforce" className="mx-auto" width="3024" height="1714" data-path="images/salesforce-custom-tab-5.png" />

<Note>
  This is configured in Salesforce, with an administrator user, and is independent of the data integration. You can have it with either of the two integration types.
</Note>

<div class="hr" />

## Before you start

<Steps>
  <Step title="Have your Treble API key at hand">
    You can find it in the Treble platform, under **Settings → Developers → API KEY**.

    <Warning>
      The API key is a credential. Treat it like a password: don't publish it, don't paste it in open channels, and don't share it outside your Salesforce administration team.
    </Warning>
  </Step>

  <Step title="Confirm that your advisors exist as agents in Treble">
    The tab logs in with the **Salesforce user's email**. If that email doesn't match a Treble agent, the tab won't be able to open their inbox.
  </Step>
</Steps>

<div class="hr" />

## 1. Create the web tab

<Steps>
  <Step title="Go to Setup → Tabs">
    Search for "tabs" in the Setup search bar and open **Tabs**. Scroll down to the **Web Tabs** section and click **New**.

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-tab-1.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=68052676e21154c95cdbf87bf5ebbf40" alt="Create a new Web Tab in Salesforce" className="mx-auto" width="3024" height="1718" data-path="images/salesforce-custom-tab-1.png" />
  </Step>

  <Step title="Choose the tab style">
    In step 1, leave the default style (full page). Click **Next**.
  </Step>

  <Step title="Define the name and height">
    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-tab-2.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=e3fcb875706bd4f03946fd18dda76b6a" alt="Web tab properties" className="mx-auto" width="3024" height="1716" data-path="images/salesforce-custom-tab-2.png" />

    | Field | Suggested value |
    | - | - |
    | **Tab Label** | `Treble WhatsApp` |
    | **Tab Name** | `Treble_WhatsApp` |
    | **Tab Style** | The icon and color you prefer |
    | **Content Frame Height (pixels)** | `600` |

    <Tip>
      600 pixels works well on most screens. If your advisors work on large monitors and the inbox looks cramped, you can increase it later by editing the tab.
    </Tip>
  </Step>

  <Step title="Enter the Treble URL">
    In step 3, in the **Button or Link URL** field, paste:

    ```
    https://agent-api.treble.ai/agent/login/salesforce?email={!$User.Email}&apiKey=TU_API_KEY
    ```

    Replace `TU_API_KEY` with the key Treble gave you. Leave `{!$User.Email}` as is: it's a Salesforce merge field that automatically inserts the email of the user who opens the tab, and it's what makes each advisor see **their own** inbox.

    In **Encoding**, leave `Unicode (UTF-8)`.

    <Warning>
      Don't replace `{!$User.Email}` with a fixed email. If you do, all your advisors would log in to the same person's inbox.
    </Warning>
  </Step>

  <Step title="Define visibility and save">
    In steps 4 and 5, choose which profiles can see the tab and which apps it should appear in. Save.
  </Step>
</Steps>

<div class="hr" />

## 2. Add the tab to the navigation bar

Creating the tab doesn't make it visible on its own: you have to add it to the app.

<Steps>
  <Step title="Open the navigation editor">
    In the app where you want it (for example *Sales*), click the **pencil icon** at the end of the navigation bar.

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-tab-3.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=5c4663f0e993504cd583e05446768b0e" alt="Pencil icon to edit the navigation" className="mx-auto" width="3024" height="1712" data-path="images/salesforce-custom-tab-3.png" />
  </Step>

  <Step title="Add Treble WhatsApp">
    Click **Add More Items**, search for the tab you created and add it. Drag it to the position you want and click **Save**.

    <img src="https://mintcdn.com/trebleai/n_48dzI5l_tB6XfZ/images/salesforce-custom-tab-4.png?fit=max&auto=format&n=n_48dzI5l_tB6XfZ&q=85&s=d453b899547b302b9fe307e46a091143" alt="Add Treble WhatsApp to the navigation items" className="mx-auto" width="3024" height="1714" data-path="images/salesforce-custom-tab-4.png" />
  </Step>
</Steps>

<Check>
  Done. The **Treble WhatsApp** tab appears in the navigation bar and opens the inbox of the advisor who is logged in.
</Check>

<div class="hr" />

## What the advisor sees

Inside the tab they have:

* **Conversations**: the active conversations assigned to them, to read and reply to.
* **Contacts**: the contact list, from which they can create a new one or send a template (HSM) to open a conversation.

<Info>
  The inbox shows the conversations **assigned to that advisor**. If an advisor says they don't see anything, the most likely reason is simply that they don't have any conversations assigned at that moment, not that the tab is misconfigured.
</Info>

<div class="hr" />

## Common issues

<AccordionGroup>
  <Accordion title="The tab appears blank or doesn't load">
    It's usually one of these:

    1. **The API key is wrong or incomplete.** Check that it was pasted in full, with no trailing spaces.
    2. **The Salesforce user's email doesn't match a Treble agent.** The tab logs in with the logged-in user's email; if it doesn't exist in Treble, there's no inbox to show.
    3. **Browser restrictions.** Some security settings block embedded content. Salesforce warns about this on the tab creation screen.
  </Accordion>

  <Accordion title="The advisor logs in to Salesforce but can't get into Treble">
    A Salesforce session is **not** a Treble session. The tab uses the Salesforce user's email to identify the agent, but that agent needs to exist in Treble and have their own credentials.

    If the advisor can't log in, the way forward is to reset their **Treble** password, not their Salesforce one. And if they don't exist as an agent, you need to create them first.

    <a class="article-link" href="/en/docs/agent-platform/admin/tags-teams#create-a-new-agent"><p>Create a new agent</p><Icon icon="arrow-up-right-from-square" iconType="solid" /></a>
  </Accordion>

  <Accordion title="All advisors see the same inbox">
    `{!$User.Email}` was replaced with a fixed email in the URL. Edit the tab and put the merge field back.
  </Accordion>

  <Accordion title="The tab doesn't appear in the navigation bar">
    Creating the tab and adding it to the app are two different steps. Review step 2 of this guide, and confirm that the advisor's profile has the tab set as visible.
  </Accordion>

  <Accordion title="The inbox looks cut off vertically">
    Increase the **Content Frame Height** value in the tab settings.
  </Accordion>
</AccordionGroup>

<div class="hr" />

## Next steps

<CardGroup cols={2}>
  <Card title="Transfer to an advisor" icon="headset" href="/en/docs/integrations/salesforce/blocks/human-transfer">
    How a conversation reaches an advisor's inbox.
  </Card>

  <Card title="Launch conversations from Salesforce" icon="bolt" href="/en/docs/integrations/salesforce/embed/automation-flow-package">
    Trigger a Treble campaign from an automation flow.
  </Card>
</CardGroup>


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