> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# 8x8 Contact Center

> Route 8x8 Contact Center calls to a Synthflow AI agent through a Forward to External IVR node, with handback to a queue.

The 8x8 Contact Center integration routes inbound contact center calls to a Synthflow AI agent from inside your IVR script. Calls reach Synthflow over a [SIP trunk](/telephony-integrations) rather than the public phone network, using 8x8's bring-your-own-carrier (BYOC) routing.

When the agent ends the call, the caller resumes in the 8x8 IVR, so you can hand them to a queue for agent-assisted service.

> **Note**
>
> 8x8 Contact Center numbers support **inbound calls only**. Synthflow AI agents answer calls routed from 8x8, but outbound calls from an agent towards an 8x8 number are not supported. Only the **US** and **EU** regions are supported.

## Call flow

1. A customer calls 8x8 Contact Center.
2. The IVR script routes the call to the Synthflow agent through a **Forward to External IVR** node, which dials the agent across the Synthflow SIP trunk.
3. The Synthflow agent handles the conversation.
4. When a handback is needed, the agent ends the call using an end-call reason defined in its prompt.
5. The call resumes in the 8x8 IVR at the node's **Resume** exit, for example a queue.

## Prerequisites

* A Synthflow agent with an 8x8 Contact Center number attached. [Import the number](#number-import), then attach it under **Deploy**.
* 8x8 Contact Center, with admin access to the [8x8 Admin Console](https://admin.8x8.com).

## Number import

In Synthflow, select **Phone Numbers** → **New Phone Number** → **Import a Custom Number**, and fill in these fields:

| Field              | Value                                |
| ------------------ | ------------------------------------ |
| **Phone Provider** | 8x8 Contact Center                   |
| **Friendly Name**  | A label such as `8x8 Contact Center` |

Synthflow generates the 12-digit, digit-only identifier used for SIP routing. You do not need an E.164 number. 8x8 is IP-authenticated, so there are no SIP credentials to enter, and Synthflow fills in `sip.8x8.com` as the SIP domain.

> **Warning**
>
> 8x8 Contact Center authenticates Synthflow against separate **US** and **EU** environments. Configure your 8x8 instance in the same region as your Synthflow workspace, or calls fail. The **Global** region is not supported.

Select **Import**, then attach the number to your inbound agent under **Deploy**. Keep the generated number at hand for the 8x8 routing steps.

## 8x8 configuration

Complete these steps in the 8x8 Admin Console.

### Phone channel and IVR script

1. Go to **Contact Center** and create a phone channel.
2. Attach a phone IVR script to the channel.

### Forward to External IVR node

In the IVR script editor, add a **Forward to External IVR** node to your call flow. The node points at the Synthflow SIP trunk instead of a dialable phone number. In the node's **Phone Number** field, enter the value for your region, replacing `{SynthflowAgentNumber}` with the generated number attached to your Synthflow agent:

| Region | **Phone Number** field value                                   |
| ------ | -------------------------------------------------------------- |
| EMEA   | `AdvIvrPSTN-byoc_emea_outbyocsynthflow_{SynthflowAgentNumber}` |
| NA     | `AdvIvrPSTN-byoc_na_outbyocsynthflow_{SynthflowAgentNumber}`   |

Use the generated identifier with no spaces, dashes, or brackets. If Synthflow generated `482917364058` and your contact center is in EMEA, enter `AdvIvrPSTN-byoc_emea_outbyocsynthflow_482917364058`.

### Resume exit

On the **Resume** exit of the **Forward to External IVR** node, add the routing the call follows after the AI conversation, for example **Forward to Queue**. Callers land here when the Synthflow agent hands the call back.

### Sample script

A minimal working script has four nodes:

1. **Say:** 8x8 answers the call and plays a greeting.
2. **Forward to External IVR:** forwards the call to the Synthflow agent.
3. **Say** on the **Resume** exit: plays a message after the agent ends the call and the script resumes.
4. **DefaultTermination:** hangs up. Replace it with **Forward to Queue** when the caller should reach a human.

## Synthflow configuration

Define an end-call reason in the agent's prompt so it can hand callers back to the contact center. When the agent ends the call, 8x8 resumes it at the **Resume** exit. For example:

```
If the user requests to speak with a human agent, end the call to redirect them to the contact center.
```

## Call transfers \[#transfers]

[Call transfer](/call-transfers) actions do not work over the 8x8 SIP trunk. Instead, the agent ends the call and 8x8 performs the transfer at the **Resume** exit of the **Forward to External IVR** node.

1. Define an end-call reason in the agent's prompt for the case that should reach a person, as shown in [Synthflow configuration](#synthflow-configuration).
2. On the **Resume** exit, add the 8x8 routing node that handles the transfer, for example **Forward to Queue**.

Because the caller is back inside your script, the transfer uses your existing 8x8 queues, skills, and routing rules, and it stays in 8x8 reporting.

## Data Augmentation API \[#pass-variables-back-to-8x8]

The handback at the **Resume** exit returns the caller, but not the data your agent collected. To make that data available in 8x8 Contact Center, attach it to the interaction with the [8x8 Contact Center Data Augmentation API](https://help.8x8.com/docs/8x8-contact-center-data-augmentation-api). Variables set through this API persist on the interaction. Your IVR script can route on them after the resume, and human agents see them when the interaction is offered.

Call the API while the caller is still with the Synthflow agent, from a during-the-call [custom action](/about-custom-actions) or from your own backend. Send a `POST` request to `https://<your cluster>.8x8.com/api/v1/interaction/data/{identifier}`. Authenticate with HTTP Basic Authentication, using your 8x8 tenant ID as the username and your tenant's action token as the password. The `{identifier}` path segment identifies the interaction the variables attach to.

8x8 sends the interaction's call ID to Synthflow in the `X-8x8-CID` header on the incoming call. It is available as the variable `{X-8x8-CID}` in prompts and custom actions, like other [custom X-headers](/pass-call-context#custom-x-headers). Use `{X-8x8-CID}` as the `{identifier}` in the request URL.

The request body lists the variables to set, with attributes that control how 8x8 treats each one:

```json
{
  "data": [
    {
      "variables": [
        {
          "name": "_queueId",
          "value": "201",
          "ivr": "true",
          "display": "true",
          "displayName": "Queue ID",
          "dataType": "text"
        }
      ]
    }
  ]
}
```

* `ivr` makes the variable available to routing logic in your IVR script, for example to branch at the **Resume** exit based on what the caller told the agent.
* `display` and `displayName` control whether and how the variable appears to the human agent when the interaction is offered.
* `privacy` masks sensitive values before they are stored or displayed.

Variable names must begin with an underscore, contain only alphanumeric characters, and be under 25 characters with no spaces. The [Data Augmentation API documentation](https://help.8x8.com/docs/8x8-contact-center-data-augmentation-api) has the full request and response reference, including how to retrieve interaction context with `GET`.

## Troubleshooting

* **Calls do not reach the Synthflow agent.** Confirm the **Phone Number** field in the **Forward to External IVR** node exactly matches the format for your region and uses the generated Synthflow number. Confirm the number attached to your Synthflow agent is active.
* **Calls do not resume in the 8x8 IVR after the AI conversation.** Confirm the **Resume** exit of the **Forward to External IVR** node connects to a valid routing node, such as **Forward to Queue**, and that the agent's end-call reason is defined in its prompt.
* **The agent never triggers the handback.** Review the agent's prompt. Confirm the end-call condition is clearly defined and matches the phrases callers actually use.
* **A transfer action on the agent does nothing.** Transfer actions do not work over the 8x8 SIP trunk. Hand the call back to 8x8 and transfer in the script, as described in [Call transfers](#transfers).

## FAQ

#### Can I send different callers to different destinations after the AI conversation?

Yes, but the branching happens in your 8x8 script. Every handback returns to the same **Resume** exit. To branch on what the caller told the agent, set variables with the [Data Augmentation API](#pass-variables-back-to-8x8) and route on them after the **Resume** exit.

#### Does the caller hear anything when the call returns to 8x8?

Only what your script plays. Add a **Say** node on the **Resume** exit to acknowledge the handback before the caller is queued or transferred.