创建并分配任务
域名
请求路由
请求方式
请求头
- Content-Type: application/json
- Authorization: Bearer a06b3b2d7f762....
请求参数
请求参数列表
| 参数名 |
类型 |
必填 |
描述 |
| name |
string |
是 |
任务名称,限256字符 |
| description |
string |
否 |
任务描述,限256字符 |
typetask_template_id |
int |
是否 |
任务类型,这里固定为3(消息任务类型) |
auth_id |
int |
是 |
incs开通的 whatsapp 授权模板id |
| user_phone |
string |
是 |
任务对象手机号,必须是区号开头的纯数字格式,例如:"6281512341234" |
| user_name |
string |
否 |
任务对象名称 |
| assignee_username |
string |
是 |
任务被分配人账号 |
task_module_infochannels |
array |
是 |
任务通讯通道,可多选,通道名+通道授权id |
| custom_data |
object |
否 |
任务聊天窗口展示信息模板对应的自定制化展示,见下述示例义数据字段值 |
请求示例
{
"name": "by8 api"月催收任务",
"type": 3,
"auth_id": 30058,
"description": "123"",
"task_template_id": 123,
"user_phone": "628123456789",
"user_name": "路人A",
"user_phone": "6281512345678"Budi",
"assignee_username": "incs_1"agent1",
"task_module_info": {
"module_id": "019d3dcd-f5a8-70e7-aff8-c54bde267f38", // 定制模块ID,该模块类型固定传此ID
"total_amount": "20000.00",
"orders"channels": [
{
"order_number"channel_name": "WD20260401001"whatsapp-meta",
"username"auth_id": "张三",
"phone_number": "13800138000",
"loan_amount": "",
"due_amount": "",
"next_due_date": "2026-04-15",
"confirm_loan_time": "2026-03-01 10:00:00"30058
},
{
"order_number"channel_name": "WD20260401002"voice",
"username"auth_id": "李四",
"phone_number": "13900139000",
"loan_amount": "3000",
"due_amount": "1500",
"next_due_date": "2026-04-20",
"confirm_loan_time": "2026-03-10 14:30:00"30059
}
],
"custom_data": {
"订单号": "ORD-1",
"金额": "100000"
}
}
响应
成功响应示例
{
"status": "success",
"code": 200,
"message": "",
"data": {
"id": 239, // 任务id3625,
"creation_id": 106,181,
//"name": "9 月催收任务批次id",
"description": "www",
"channels": [
{
"channel_name": "voice",
"auth_id": 30057,
"conversation_id": 5580
},
{
"channel_name": "whatsapp-meta",
"auth_id": 30058,
"name"conversation_id": "test5581
api}
1"],
"description": "2sfsdfsdfd",
"type": 3,
"user_name": "路人B"Budi",
"user_phone": "6281512340001"628123456789",
"assignee_username": "incs_1",
"conversation_id": 1023, // 分配的会话id
"status": 0,
"task_template_id": 11,
"custom_data": {
"date": "2026-09-10",
"money": "100000",
"name": "www",
"number": "432526436436"
},
"created_at": "2026-04-1609-14 17:44:48"10:35:13",
"updated_at": "2026-04-1609-14 17:44:51"10:35:16",
"logs": []
},
"error": {}
}
失败响应示例
{
"status": "error",
"code": 400,
"message": "UserData is in an incomplete task."error", // 用户被分配任务还未完成
"data": {},
"error": {}
}