> ## 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.

# Using Your Salesforce Integration in Call Flow HTTP Requests

> Call Salesforce from your call flow without entering credentials, using your connected Salesforce integration.

> [!NOTE]
>
> The **HTTP Request** step can call your Salesforce org directly. When the endpoint is your Salesforce org address, CloudTalk signs the request with your connected Salesforce integration, so you never enter Salesforce credentials in the call flow.

**User level:** Admin

***

## Before You Start

* Your Salesforce integration must be connected and active in CloudTalk (**Dashboard** > **Integrations**). See [Configure Salesforce](https://help.cloudtalk.io/en/articles/3368501-configure-salesforce.md).

* The endpoint must use your org's own domain, for example `https://yourcompany.my.salesforce.com/...`. Other Salesforce addresses such as `login.salesforce.com` or Marketing Cloud are not supported.

* You need to know which Salesforce REST API call you want to make. Salesforce's API documentation lists the available endpoints.

## Set Up the Request

1. Add an **HTTP Request** step to your call flow (see the [HTTP Request Step](https://help.cloudtalk.io/en/articles/6883940-http-request-step.md) guide).

2. In **Endpoint**, enter the full Salesforce API URL on your org domain.

3. Choose the **Method** and fill in **Request Headers** and **Request Body** as the Salesforce API requires. For a JSON body, add the header `Content-Type: application/json`.

4. Do not add an Authorization header. CloudTalk adds authentication for you using the connected integration.

5. Save the flow.

Every time a call reaches the step, CloudTalk sends the request to Salesforce on behalf of your integration. You can use dynamic variables such as `#{{call.external_number}}` in the endpoint, headers and body, exactly as in any HTTP Request step.

## Example: Log an Inbound Call as a Salesforce Task

<table>
  <tbody>
    <tr>
      <td>
        **Field**
      </td>

      <td>
        **Value**
      </td>
    </tr>

    <tr>
      <td>
        **Endpoint**
      </td>

      <td>
        `https://yourcompany.my.salesforce.com/services/data/v58.0/sobjects/Task`
      </td>
    </tr>

    <tr>
      <td>
        **Method**
      </td>

      <td>
        POST
      </td>
    </tr>

    <tr>
      <td>
        **Headers**
      </td>

      <td>
        `Content-Type` = `application/json`
      </td>
    </tr>

    <tr>
      <td>
        **Body**
      </td>

      <td>
        `Subject` = `Inbound call from #{{call.external_number}}`

        `Status` = `Completed`

        `Priority` = `Normal`
      </td>
    </tr>

    <tr>
      <td>
        **Parse response**
      </td>

      <td>
        Off (fire and forget)
      </td>
    </tr>
  </tbody>
</table>

## Using the Salesforce Response in a Condition Splitter

With **Parse response** enabled, the Salesforce answer is stored as a single block. In a [Condition Splitter](https://help.cloudtalk.io/en/articles/5763009-caller-based-routing-with-conditions.md) you can:

* Check the status code: select **HTTP Response**, path `statusCode`, for example equals `200`.

* Check whether the answer contains a value: select **HTTP Response**, path `body`, operand **contains**.

> [!TIP]
>
> **Note:** Reading a specific Salesforce field from the response (for example, `records.0.Id`) is not supported at this time.

## If the Integration Is Not Available

If your Salesforce integration is disabled, not connected, or the endpoint does not match the org it is connected to, the request is not sent to Salesforce. The step is logged as failed and the call flow continues to the next step. Callers are not affected.

## Good to Know

* Communication requires HTTPS.

* When Parse response is on, the flow waits up to 10 seconds for Salesforce to answer. When it is off, the request is sent and the flow moves on after at most 3 seconds.

* Requests count against your Salesforce API limits like any other API call.

***

*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

- [HTTP Request Step](https://help.cloudtalk.io/en/articles/6883940-http-request-step.md)
- [How to send an automatic SMS using Call Flow Designer](https://help.cloudtalk.io/en/articles/8249875-how-to-send-an-automatic-sms-using-call-flow-designer.md)
- [Routing & Call Flow Design guide](https://help.cloudtalk.io/en/articles/10559796-routing-call-flow-design-guide.md)


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