Search...
Menu

Task Status Callback

Task Status Callback

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


API Information

  • Callback URL: Uses the taskCallbackUrl provided at task creation. Events from task creation and platform management operations can use the task status callback configured in the console when that field is omitted. Scheduler events such as scheduled starts and automatic completion use the task’s own taskCallbackUrl.
  • 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
previousTaskStatus Integer Task status before the change. May be null for the initial event.
taskStatus Integer Task status. See the reference table below
statusEventKey String Task status event identifier for deduplication. May be empty for older events.
statusEventTs Long Status event time in Unix milliseconds. May be null for older events.
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 Task statistics read before the callback is sent.

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, calculated as dialed orders divided by total orders.
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. Status fields come from the event. Statistics are read before delivery and may be newer than the event.
  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

json Copy
{
  "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",
  "previousTaskStatus": 1,
  "taskStatus": 2,
  "statusEventKey": "task-status-event-example",
  "statusEventTs": 1746583929000,
  "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
  }
}

Acknowledging Delivery

Return HTTP 200 OK after accepting the callback. The response body may be empty. The sender ignores the body and treats other HTTP status codes as failures that may trigger a retry. When available, use statusEventKey to deduplicate deliveries.

Last modified: 2026-12-03