Create an AI Agent outbound task. You can either create an empty task first and import contacts later, or submit the initial contact list together with the task.
https://api-hk.nxlink.ai/openapi/aiagent/task/createPOSTapplication/jsonNXLink is deployed across multiple global regions. Please select the appropriate service endpoint based on your business location.
| Code | Region | NXLink Website | API Gateway |
|---|---|---|---|
| APAC | Hong Kong | https://app.nxlink.ai |
https://api-hk.nxlink.ai |
| AMER | Americas | https://chl-nxlink.nxcloud.com |
https://chl-api.nxlink.ai |
| APAC(IDN) | Indonesia | https://idn.nxlink.ai |
https://api-idn.nxlink.ai |
| Parameter | Type | Required | Example Value | Description |
|---|---|---|---|---|
| accessKey | String | Yes | AK-6230339248928541113-2133 |
User identity identifier |
| ts | String | Yes | 1655710885431 |
Current request timestamp in milliseconds. The server allows a maximum time difference of 60 seconds |
| bizType | String | Yes | 100 |
Business type. Fixed value: 100 |
| action | String | Yes | nxai |
Business action. Fixed value: nxai |
| sign | String | Yes | 6e9506557d1f289501d333ee2c365826 |
API request signature. See common conventions, Signature Algorithm |
| Parameter | Type | Required | Example Value | Description |
|---|---|---|---|---|
| userTaskId | String | No | "EXT-TASK-202603250001" |
Caller-defined task ID. If supplied, it must be unique within the tenant. A duplicate returns business code 20000. |
| other | String | No | "task-batch-20260325" |
Task passthrough field. The same value is returned in the task status callback and task list API |
| taskName | String | Yes | "Customer Follow-up Task 0325" |
Task name |
| taskDesc | String | No | "Customer satisfaction follow-up after purchase" |
Task description |
| autoFlowId | Long | Yes | 197 |
AI Agent ID. You can obtain it from List AI Agents |
| agentGroupId | String | Conditional | "12345" |
Required when the published AI Agent workflow takes the human-transfer group from the task. Use the skill group ID for Omni tenants or the agent group number for legacy CC tenants. Omit this field for other workflows. |
| routeId | String | Yes | "y29ND1X4kkCG_nC576sALEkvg3HjEqde" |
Route ID. You can obtain it from List Routes |
| taskKeep | Integer | Yes | 0 |
Keep-alive flag: 0 = disabled, 1 = enabled |
| startupType | Integer | Yes | 1 |
Startup type: 1 = manual, 2 = scheduled, 3 = immediate |
| startupAt | Long | No | 1746583929 |
Required when startupType = 2; scheduled start timestamp in seconds |
| shutdownAt | Long | No | 1746670329 |
Scheduled stop timestamp in seconds; omit if no stop time is needed |
| zoneSecond | Integer | Yes | 28800 |
Task timezone offset in seconds. Example: UTC+8 = 28800 |
| weekDay | String | Yes | "1,2,3,4,5,6,7" |
Allowed dialing weekdays separated by commas. 1 = Monday, ..., 7 = Sunday |
| firstFifteen | String | Yes | "9,10,11,14,15,16,17" |
Allowed hours for the first 15-minute slot of each hour, corresponding to HH:00~HH:15 |
| secondFifteen | String | Yes | "9,10,11,14,15,16,17" |
Allowed hours for the second 15-minute slot of each hour, corresponding to HH:15~HH:30 |
| thirdFifteen | String | Yes | "9,10,11,14,15,16,17" |
Allowed hours for the third 15-minute slot of each hour, corresponding to HH:30~HH:45 |
| fourthFifteen | String | Yes | "9,10,11,14,15,16,17" |
Allowed hours for the fourth 15-minute slot of each hour, corresponding to HH:45~HH+1:00 |
| orderMaxCall | Long | Yes | 1 |
Maximum redial attempts per contact |
| replayInterval | Long | Yes | 600 |
Redial interval in seconds. For example, 10 minutes = 600 |
| maxCall | Integer | No | 20 |
Maximum concurrent calls. 0 means the system default behavior is used |
| maxRingTime | Integer | No | 40 |
Maximum ringing time in seconds. 0 means the system default behavior is used |
| taskCallbackUrl | String | No | "https://example.com/webhook/task" |
Callback URL for task status changes |
| callCallbackUrl | String | No | "https://example.com/webhook/call" |
Call record callback URL for the contacts imported with this request. If omitted, the console call record callback setting applies. |
| countryCode | String | No | "86" |
Default country code. Use this when phone numbers in callList do not include the country code |
| callList | Array | No | Initial contact list imported during task creation. Omit or pass an empty array to create an empty task first and import contacts later |
callList Element)| Parameter | Type | Required | Example Value | Description |
|---|---|---|---|---|
| contactId | String | Yes | "52145b00-abc9-4a87-94c2-ed1e1e42x4rfvmh" |
Contact ID, unique within the task. |
| other | String | No | "contact-ext-001" |
Contact passthrough field. The same value is returned in the call record callback |
| name | String | Yes | "Jones" |
Contact name |
| phoneNumber | String | Yes | "13800000001" |
Phone number |
| params | Array | No | Variable list |
params Element)| Parameter | Type | Required | Example Value | Description |
|---|---|---|---|---|
| name | String | Yes | "customerName" |
Variable name. It must match an existing variable defined in the workflow |
| value | Object | No | "Lucy" |
Variable value. Values are converted to strings before import. Send a string to control its representation. |
startupType) Reference| Value | Description |
|---|---|
1 |
Manual |
2 |
Scheduled |
3 |
Immediate |
| Field | Value Range | Description |
|---|---|---|
weekDay |
1~7 |
Allowed weekdays, where 1 = Monday and 7 = Sunday |
firstFifteen |
0~23 |
00~15 minutes of each hour |
secondFifteen |
0~23 |
15~30 minutes of each hour |
thirdFifteen |
0~23 |
30~45 minutes of each hour |
fourthFifteen |
0~23 |
45~60 minutes of each hour |
callList or pass an empty array, then import contacts later through the append-contacts API.code: 0 when individual contacts fail to import. Check successCount, totalCount, and errList. If creation or import throws an exception and the request fails as a whole, the task and its initial contact import are rolled back together.{
"userTaskId": "EXT-TASK-202603250001",
"other": "task-batch-20260325",
"taskName": "Customer Follow-up Task 0325",
"taskDesc": "Customer satisfaction follow-up after purchase",
"autoFlowId": 197,
"routeId": "y29ND1X4kkCG_nC576sALEkvg3HjEqde",
"taskKeep": 0,
"startupType": 2,
"startupAt": 1746583929,
"shutdownAt": 1746670329,
"zoneSecond": 28800,
"weekDay": "1,2,3,4,5,6,7",
"firstFifteen": "9,10,11,14,15,16,17",
"secondFifteen": "9,10,11,14,15,16,17",
"thirdFifteen": "9,10,11,14,15,16,17",
"fourthFifteen": "9,10,11,14,15,16,17",
"orderMaxCall": 1,
"replayInterval": 600,
"maxCall": 20,
"maxRingTime": 40,
"taskCallbackUrl": "https://example.com/webhook/task",
"callCallbackUrl": "https://example.com/webhook/call",
"countryCode": "86",
"callList": [
{
"contactId": "c3d79370-9f3a-4da2-84dd-2d2200f40e11",
"other": "contact-ext-001",
"name": "Lucy",
"phoneNumber": "13800000001",
"params": [
{
"name": "customerName",
"value": "Lucy"
},
{
"name": "orderNo",
"value": "SO202603250001"
}
]
},
{
"contactId": "5f6f6f6f-7a7b-4c4d-9e9f-101010101010",
"other": "contact-ext-002",
"name": "Tom",
"phoneNumber": "13800000002",
"params": [
{
"name": "customerName",
"value": "Tom"
}
]
}
]
}
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Result code |
| message | String | Result message |
| traceId | String | Trace ID for request tracking |
| data | Object | Response payload |
data Object| Parameter | Type | Description |
|---|---|---|
| taskId | String | Created task ID |
| userTaskId | String | User-defined task ID |
| taskStatus | Integer | Task status. 1 = Ready, 2 = In Progress, 3 = Completed, 4 = Failed, 5 = Paused, 6 = Paused (Insufficient Balance) |
| successCount | Integer | Number of successfully imported contacts |
| totalCount | Integer | Total number of processed contacts |
| errList | Array | Error list containing records that failed to be imported |
errList Element| Parameter | Type | Description |
|---|---|---|
| contactId | String | Contact ID of the failed record. This is the primary identifier for the error item |
| name | String | Contact name |
| phoneNumber | String | Phone number that failed to be imported |
| errMsg | String | Failure reason |
{
"code": 0,
"message": "success",
"traceId": "3287f5aa-b8db-4dd7-97b0-03fabac2f4c7",
"data": {
"taskId": "52145b00-abc9-4a87-94c2-ed1e1e42ec1c",
"userTaskId": "EXT-TASK-202603250001",
"taskStatus": 1,
"successCount": 2,
"totalCount": 2,
"errList": []
}
}
{
"code": 0,
"message": "success",
"traceId": "dbdd93a9-cb7c-4c0d-8f98-01755b1883b6",
"data": {
"taskId": "52145b00-abc9-4a87-94c2-ed1e1e42ec1c",
"userTaskId": "EXT-TASK-202603250001",
"taskStatus": 1,
"successCount": 1,
"totalCount": 2,
"errList": [
{
"contactId": "5f6f6f6f-7a7b-4c4d-9e9f-101010101010",
"name": "lucy",
"phoneNumber": "1312895-xxx",
"errMsg": "Illegal phone number format:1312895-xxx"
}
]
}
}
{
"code": 20000,
"message": "autoFlowId not found",
"traceId": "8a731fe8-81b0-4a7f-9785-b214977e30ef"
}
| 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 |