AI Agent Task ‐ Call Record Callback - nxtele/nxcloud-doc-en GitHub Wiki

Call Record Callback

This callback is used to receive call record notifications from NXLink AI Agent tasks.


API Information

  • Callback URL: The callback is sent to the callCallbackUrl specified when creating the task or appending contacts via API. If that field is not provided, the callback is sent to the AI Agent call record callback URL configured in the NXLink management console. If neither is configured, no callback is sent
  • Description: Receives call record callback notifications
  • Method: POST
  • Content-Type: application/json
  • Authentication Required: Optional (decided by the customer)

Request Parameters

Header Parameters (Optional)

Parameter Type Required Example Value Description
accessKey String No AK-6230339248928541113-2133 User identity key
ts String No 1655710885431 Request timestamp in milliseconds
bizType String No 100 Business type, fixed value: 100
action String No nxai Business action, fixed value: nxai
sign String No 6e9506557d1f289501d333ee2c365826 API request signature

Body Parameters

Parameter Type Description
taskId String Task ID, which is the internal system task ID
userTaskId String Caller-defined task ID
contactId String Contact ID
other String Contact passthrough field provided when the task is created or contacts are appended
autoFlowId Long AI Agent ID
orderHead Integer First-call indicator: 0-No, 1-Yes
orderTail Integer Last-call indicator: 0-No, 1-Yes
callerPhone String Caller phone number
calleePhone String Callee phone number
realPhone String Real phone number
callId String Call ID
callStatus Integer Call status (see details below)
callResult Integer Call result (see details below)
createTs Long Creation timestamp (seconds)
opTs Integer Operation timestamp (seconds)
callStart Long Call start timestamp (seconds)
callAnswer Long Call answer timestamp (seconds)
callEnd Long Call end timestamp (seconds)
callRingTime Long Ring duration
callElapsed Long Call duration in seconds
lineId String Selected line ID
routeId String Selected route ID
callAudioUrl String Call recording URL
userIntent String User intent
callSummary String Call summary
turnTime Integer Dialogue turn count
manualCallStart Integer Manual call start timestamp (seconds)
manualCallAnswer Integer Manual call answer timestamp (seconds)
manualCallEnd Integer Manual call end timestamp (seconds)
manualCallStatus Integer Manual call status
manualElapsed Integer Manual call duration
agentName String Agent account name
agentId String Agent account ID
agentGroupName String Agent group name
agentGroupId String Agent group ID
sipAddr String SIP address
sipCode String SIP response code
hangupReason String Hangup reason
attributes Array Custom variables
autoFlowName String AI Agent name

Notes

  1. taskId is the internal system task ID, and userTaskId is the caller-defined task ID.

Call Status (callStatus) Reference

Value Description
1 Pending
2 Scheduling
3 Dialing
4 Ringing
5 In Call
6 TTS Synthesizing
7 Paused
10 Call Completed
11 Invalid Number
12 Unreachable
13 User Busy
14 User Busy and Rejected
15 User Rejected
16 Scheduling Error
17 TTS Synthesis Failed
18 Unknown Error
19 Blacklisted Number
20 Stopped (Manual stop or insufficient balance)
21 Insufficient Customer Balance
22 Invalid Number Direction
23 Invalid Number
24 Ring No Answer
25 No Response
26 Early Media - Voicemail
27 Ring Timeout
28 No Available Route
29 Line Service Unavailable

Call Result (callResult) Reference

Value Description
1 Completed – Connected
2 Human Voice Detected
3 Completed – AI Hung Up
6 No Answer – Agent Hung Up Quickly
7 No Answer – User Hung Up Quickly
8 No Answer – User Rejected During Ringing
9 No Answer – Timeout
10 No Answer – Blacklisted Number
11 No Answer – Restricted Number
12 Unreachable
13 Call Rejected
14 Temporarily Unreachable
15 Line Busy
16 Call Exception
17 Completed – User Hung Up
18 Voicemail
19 Completed – Early Media Voicemail
20 Silence
21 System Error

Request Body Example

{
  "taskId": "972e65ad-bfa5-4f35-845f-1867009b2c34",
  "userTaskId": "EXT-TASK-202603250001",
  "contactId": "fde45ccd-9902-43a4-8e2e-ca4dba5a93e0",
  "other": "contact-ext-001",
  "autoFlowId": 207,
  "orderHead": 1,
  "orderTail": 1,
  "callerPhone": "00000",
  "calleePhone": "852385xxxx",
  "realPhone": "85xxxx",
  "callId": "fe90a9af-e14c-4330-8faa-2631e761124a",
  "callStatus": 10,
  "callResult": 17,
  "createTs": 1742378329,
  "opTs": 1742378340,
  "callStart": 1742378340,
  "callAnswer": 1742378343,
  "callEnd": 1742378480,
  "callRingTime": 3,
  "callElapsed": 137,
  "lineId": "lineID",
  "routeId": "routeID",
  "callAudioUrl": "https://nxai-gz-1259196162.cos.ap-guangzhou.myqcloud.com/20250319/xxxxxx.wav",
  "userIntent": "",
  "callSummary": "",
  "turnTime": 0,
  "manualCallStart": 0,
  "manualCallAnswer": 0,
  "manualCallEnd": 0,
  "manualCallStatus": 0,
  "manualElapsed": 0,
  "agentName": "",
  "agentId": "",
  "agentGroupName": "",
  "agentGroupId": "",
  "sipAddr": "xxxxx",
  "sipCode": "200",
  "hangupReason": "NORMAL_CLEARING",
  "attributes": [
    {
      "name": "Name",
      "key": "sys.name",
      "value": "haier"
    },
    {
      "name": "Phone Number",
      "key": "sys.phoneNumber",
      "value": "85238531065"
    }
  ],
  "autoFlowName": "test-ai agent"
}

Response Body Parameters

Parameter Type Required Example Value Description
code Integer Yes 0 Business response code. 0 indicates success
data Object No {} Business data payload

Response Example

Body Example

{
  "code": 0,
  "data": ""
}

Error Codes

Code Description
1001 Authentication failed (missing public parameters)
1002 Authentication failed (parameter error)
1003 Authentication failed (invalid signature)
1004 Authentication failed (timestamp expired)
1005 Authentication failed (insufficient authority)
20000 Business Error