API reference for communication engine conversation-record push after transfer to a manual agent
API overview
After an intelligent voice AI call successfully initiates a transfer-to-manual-agent request, the system immediately pushes the complete conversation history between the AI and the user to the callback URL that the customer configured in advance by using HTTP POST. This lets the agent understand the conversation context before taking over the call. The agent might not yet be ringing or have answered the call.
Item | Description |
Request method |
|
Content-Type |
|
Accept |
|
URL | The |
Timeout | Fixed at 3000 ms (3 seconds). |
Trigger conditions
The push is triggered only when both of the following conditions are met:
The transfer request is successfully initiated, rather than the agent having answered the call.
The callback address in the transfer configuration is not empty.
Request description
Request headers
Header | Type | Required | Description |
| String | Yes | Fixed value: |
| String | Yes | Fixed value: |
| String | Yes | The current timestamp in milliseconds, used for signature verification. |
| String | Yes | The authentication signature. |
Request body
Field name | Type | Required | Description |
| String | Yes | The unique call identifier. |
| String | No | The external business ID on the customer side. This field is not sent when it is empty. Its value is the original value that the customer passed when calling the API. |
| String | Yes | The calling number. |
| String | Yes | The called number. |
| JSONArray | Yes | The conversation record list. It can be an empty array |
conversationHistory array elements
Field name | Type | Required | Description |
| String | Yes | The role identifier. |
| String | Yes | The conversation text. |
Request body example
{
"callId": "1693456789012^1693454989012",
"outId": "biz-order-20260831001",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": [
{
"role": "assistant",
"content": "Hello, how can I help you?"
},
{
"role": "user",
"content": "I want to check the status of my order."
},
{
"role": "assistant",
"content": "Sure. Please provide your order number."
},
{
"role": "user",
"content": "I want to speak to a manual agent."
},
{
"role": "assistant",
"content": "Sure. I am transferring you to a manual agent. Please wait."
}
]
}
Request body example without outId
{
"callId": "1693456789012^1693454989012",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": []
}
Response description
Item | Description |
Expected HTTP status code |
|
Response body | No requirements. The system checks only the HTTP status code and does not parse the response body. You can return any content. |
Response example (recommended format)
{
"code": 0,
"msg": "success"
}
Authentication signature
The system passes timestamp and auth in HTTP headers. Use the following algorithm to verify that the request source is valid.
Signature algorithm
auth = MD5Hex( aliyunUid + callId + timestamp )
Parameter | Source | Description |
| Customer | The Alibaba Cloud account UID, converted from Long to String. |
| Request body | The unique call identifier. |
| Request header | A timestamp in milliseconds. |
Concatenate the three parameters directly without separators, then calculate the MD5 hash and output a 32-character lowercase hexadecimal string.
Java verification example
import org.apache.commons.codec.digest.DigestUtils;
public boolean verifyAuth(String auth, Long aliyunUid, String callId, String timestamp) {
String expected = DigestUtils.md5Hex(String.valueOf(aliyunUid) + callId + timestamp);
return expected.equals(auth);
}
curl examples
Complete request that includes the conversation history
curl -X POST 'https://your-server.com/dialog-push' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'timestamp: 1725091200000' \
-H 'auth: a3f5b8c2d1e4f6a7b9c0d2e3f5a6b8c9' \
-d '{
"callId": "1693456789012^1693454989012",
"outId": "biz-order-20260831001",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": [
{
"role": "assistant",
"content": "Hello, how can I help you?"
},
{
"role": "user",
"content": "I want to check my order status."
},
{
"role": "assistant",
"content": "Sure. Please provide your order number."
},
{
"role": "user",
"content": "I want to speak to a manual agent."
},
{
"role": "assistant",
"content": "Sure. I am transferring you to a manual agent. Please wait."
}
]
}'
Request without a conversation history
curl -X POST 'https://your-server.com/dialog-push' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'timestamp: 1725091200000' \
-H 'auth: e7d2a1b3c5f8e0d4a6b9c2f1e3d5a7b0' \
-d '{
"callId": "1693456789012^1693454989012",
"caller": "18612345678",
"callee": "4006007006",
"conversationHistory": []
}'
Expected response (HTTP 200)
{
"code": 0,
"msg": "success"
}
Retries and exception handling
Retry policy
Configuration item | Value | Description |
Maximum retry count | 1 | At most two executions in total: the first attempt and one retry. |
Failure scenarios
Scenario | Handling |
HTTP status code is not 200 | Retry once. If it still fails, record a log and return a failure. |
Request timeout, exceeding 3 seconds | Retry once. |
Network exception | Retry once. If it still fails, return a failure. |
Notes
Push timing: The push occurs after the transfer request is successfully initiated. The agent might not yet be ringing or have answered the call. If the agent ultimately does not answer because of a timeout or rejection, the conversation record is still pushed.
Response time: We recommend that you return HTTP 200 within 500 ms. A timeout triggers a retry.
Status code only: The system checks only whether the HTTP status code is 200 and does not parse the response body. You can return any content.
Reduced conversation record: The pushed conversation record contains only the
roleandcontentfields.outIdvalue: The pushedoutIdis the original value that the customer passed when calling the API.Asynchronous push: The push is performed asynchronously and does not block the transfer process.
Callback URL: The URL must be a publicly accessible HTTPS address.
Signature algorithm: This interface uses the same
MD5(aliyunUid + callId + timestamp)signature algorithm as the transfer variable callback interface.