Skip to content

AI Agent Task Callback

曾日强 edited this page May 26, 2026 · 3 revisions

Task Status Callback

This callback is used to receive task status change notifications from NXLink AI Agent outbound tasks.


API Information

  • Callback URL: The callback is sent to the taskCallbackUrl specified when creating the task via API. If that field is not provided, the callback is sent to the AI Agent task status callback URL configured in the NXLink management console. If neither is configured, no callback is sent
  • Description: Receives task status 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
userTaskId String User-defined task ID
other String Task passthrough field provided when the task is created
autoFlowId Long AI Agent ID
autoFlowName String AI Agent name
taskName String Task name
taskDesc String Task description
taskStatus Integer Task status. See the reference table below
pauseReason Integer Pause reason. It may be empty when the task is not paused
taskKeep Integer Keep-alive flag: 0 = disabled, 1 = enabled
startupType Integer Startup type: 1 = manual, 2 = scheduled, 3 = immediate
startupAt Long Scheduled start timestamp in seconds. Present when startupType = 2
shutdownAt Long Scheduled stop timestamp in seconds. Present when startupType = 2
routeId String Selected route ID
createTs Long Task creation timestamp in seconds
statInfo Object Snapshot of task statistics at the time the callback is triggered

Statistics Object (statInfo)

Parameter Type Description
answerOrderCount Integer Answered order count, calculated when an order ends
finishOrderCount Integer Finished order count, calculated when an order ends
totalOrderCount Integer Total order count, calculated at import time
dialedOrderCount Integer Dialed order count, calculated after the first call attempt for an order
totalCallElapsed Integer Total call duration in seconds
answerCallCount Integer Answered call count, calculated when a call ends
totalCallCount Integer Total call count, calculated when a call ends
manualElapsed Integer Total manual-call duration in seconds
manualAnswerCount Integer Manually answered call count
manualFailCount Integer Manual transfer failed call count
createTs Long Statistics creation timestamp in seconds
answerRate String Answer rate
dialProgress String Dialing progress
finishRate String Completion rate
manualAnswerRate String Manual transfer success rate
avgCallDuration Integer Average call duration in seconds
avgManualDuration Integer Average manual call duration in seconds

Task Status (taskStatus) Reference

Value Description
1 Ready
2 In Progress
3 Completed
4 Failed
5 Paused
6 Paused (Insufficient Balance)

Notes

  1. The taskStatus values are aligned with the AI Agent task list API.
  2. statInfo is the current task statistics snapshot at the moment the callback is sent.
  3. If signature verification is enabled by the customer, the callback headers can be validated using the standard AI Agent OpenAPI header rules.

Request Body Example

{
  "taskId": "52145b00-abc9-4a87-94c2-ed1e1e42ec1c",
  "userTaskId": "EXT-TASK-202603250001",
  "other": "task-batch-20260325",
  "autoFlowId": 197,
  "autoFlowName": "Quick Notification",
  "taskName": "Customer Follow-up Task 0325",
  "taskDesc": "Customer satisfaction follow-up after purchase",
  "taskStatus": 2,
  "pauseReason": null,
  "taskKeep": 0,
  "startupType": 2,
  "startupAt": 1746583929,
  "shutdownAt": 1746670329,
  "routeId": "y29ND1X4kkCG_nC576sALEkvg3HjEqde",
  "createTs": 1746583800,
  "statInfo": {
    "answerOrderCount": 120,
    "finishOrderCount": 150,
    "totalOrderCount": 200,
    "dialedOrderCount": 180,
    "totalCallElapsed": 5320,
    "answerCallCount": 130,
    "totalCallCount": 210,
    "manualElapsed": 300,
    "manualAnswerCount": 5,
    "manualFailCount": 1,
    "createTs": 1746583800,
    "answerRate": "61.90%",
    "dialProgress": "90.00%",
    "finishRate": "75.00%",
    "manualAnswerRate": "83.33%",
    "avgCallDuration": 40,
    "avgManualDuration": 60
  }
}

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

Introduction

WhatsApp

Short message

Voice

Call Center(NXLink)

AI Agent(NXLink)

Call Center(Callbot)

Flash Call

Short links

邮件验证码

DID号码

通用

号码检测

Clone this wiki locally