# Deflection API V3 — Developer Guide

- **Applies to:** Sprinklr Deflection API V3 (`/api/v3/deflect`)
- **V2 API reference:** [Deflection API | Sprinklr Developer Portal](https://dev.sprinklr.com/deflection-api)


## 1. Overview

The **Deflection API** allows you to deflect customer calls to digital channels by providing options in IVR. This enables seamless redirection of customer interactions from voice to modern engagement channels such as WhatsApp Business, Apple Business Chat, or Sprinklr Live Chat.

This endpoint replaces the V2 path `/api/v2/deflect` with a simplified V3 resource:

| Operation | Method | Path |
|  --- | --- | --- |
| Deflect call to digital channel | `POST` | `/api/v3/deflect` |


## 2. Base URLs and environments

All API calls are sent to the production endpoint:

```
https://api3.sprinklr.com/{env}/api/v3
```

So the deflection resource in production is:

```
https://api3.sprinklr.com/{env}/api/v3/deflect
```

Replace `{env}` with your assigned environment identifier (`prod0`, `prod2`, `prod11`, etc.).

## 3. Authentication and common headers

All Deflection API calls are authenticated with OAuth 2.0. See API Overview for portal registration, API key and secret generation, and the Authorize flow.

| Header | Value | Purpose | Required on |
|  --- | --- | --- | --- |
| `Authorization` | `Bearer {{accessToken}}` | Authenticates the user with the server | All requests |
| `Key` | `{{apiKey}}` | Authenticates the application with the server | All requests |
| `Content-Type` | `application/json` | Declares the request body media type | All requests |
| `Accept` | `application/json` | Declares the acceptable response type | All requests |


## 4. Write operation

### 4.1 Deflect a call

**`POST /api/v3/deflect`**

Deflects a customer call to a specified digital channel.

#### Request parameters

| **Parameter** | **Required/Optional** | **Description** | **Type** |
|  --- | --- | --- | --- |
| assetId | Required | ID of the asset to be sent. | String |
| snId | Required | Social network ID of the profile for which deflection is being done. | String |
| accountId | Required | Account ID to use for replying. | String |
| deflectionType | Required | Channel being deflected to. | String |
| createCase | Optional | Whether or not a new case needs to be created. Default: true. | Boolean |
| caseNumber | Optional | Case number to which the conversation needs to be linked. | String |
| customProperties | Optional | Map of case custom properties and values. | Map<String, List> |
| messageCustomProperties | Optional | Map of outbound message custom properties and values. | Map<String, List> |
| comment | Optional | Any comments to be included from previous cases/interactions. | String |
| configId | Optional | ID of configuration containing logic for case association. | String |
| urlShortnerId | Optional | ID of the URL shortener when sending a deflection link (used in SMS for Apple Business Chat or Live Chat). | String |
| viaDeflectionType | Optional | Channel used for deflection (e.g., SMS). | String |
| viaAccountId | Optional | Account ID of the via channel. | String |


#### Example — Request

```bash
curl --location --request POST 'https://api3.sprinklr.com/{env}/api/v3/deflect' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {TOKEN}' \
--header 'api-key: {API KEY}' \
--header 'Accept: application/json' \
--data '{
  "assetId": "6a8e35a68efcd69ba4fdc844",
  "snId": "13183512964",
  "accountId": 66014972,
  "deflectionType": "WHATSAPP_BUSINESS"
}'
```

### Example — Response

```json
{
  "errors": []
}
```

### 4.2 Example — viaAccount Deflection

Deflecting to a social channel using another social channel, e.g., deflecting to Sprinklr Live Chat via SMS.

```bash
curl --location --request POST 'https://api3.sprinklr.com/{env}/api/v3/deflect' \
--header 'Authorization: Bearer {Access Token}' \
--header 'api-key: {API KEY}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
  "assetId": "6a8e35a68efcd69ba4fdc844",
  "snId": "13183512964",
  "accountId": 100022,
  "deflectionType": "SPRINKLR_LIVE_CHAT",
  "viaDeflectionType": "SMS",
  "viaAccountId": 100122,
  "createCase": true
}'
```

## 5. Response format and parameters

The V3 envelope is consistent across endpoints:

```json
{
  "errors": []
}
```

## 6. Response codes

| **HTTP Code** | **Scenario** | **Description** |
|  --- | --- | --- |
| 200 OK | Success | Deflection executed successfully |
| 400 Bad Request | Invalid Parameters | Missing or invalid request parameters |
| 401 Unauthorized | Authentication Failed | Invalid or missing Authorization token |
| 403 Forbidden | Insufficient Permissions | User lacks permission to perform deflection |
| 404 Not Found | Resource Missing | Asset or account not found |
| 500 Internal Server Error | Server Error | Unexpected server‑side error occurred |


## 7. Migration from V2 to V3

The Deflection API in **V3** continues to provide the same functionality and request/response behavior as in V2.
The only change is the **endpoint path**, updated for consistency with other V3 APIs.

| **Operation** | **V2 Endpoint** | **V3 Endpoint** | **Key Differences** |
|  --- | --- | --- | --- |
| Deflect call to digital channel | `POST /api/v2/deflect` | `POST /api/v3/deflect` | Path updated from `/api/v2` to `/api/v3`. |
| Deflect via another channel | `POST /api/v2/deflect` | `POST /api/v3/deflect` | Same operation; only path changed. |