跳转到主要内容

创建并分配任务

域名

  • https://api.incsapp.com

请求路由

  • /external/tasks

请求方式

  • POST

请求头

  • Content-Type: application/json
  • Authorization: Bearer a06b3b2d7f762....

请求参数

请求参数列表

参数名 类型 必填 描述
name string 是 任务名称,限256字符
description string 否 任务描述,限256字符
task_template_id int 否 任务模板id
user_phone string 是 任务对象手机号,必须是区号开头的纯数字格式,例如:"6281512341234"
user_name string 否 任务对象名称
assignee_username string 是 任务被分配人账号
channels array 是 任务通讯通道,可多选,通道名+通道授权id (voice通道不需要填授权id)
custom_data object 否 任务模板对应的自定义数据字段值

请求示例

{
  "name": "8 月催收任务",
  "description": "",
  "task_template_id": 123,
  "user_phone": "628123456789",
  "user_name": "Budi",
  "assignee_username": "agent1",
  "channels": [
    {
      "channel_name": "whatsapp-meta",
      "auth_id": 30058
    },
    {
      "channel_name": "voice"
    }
  ],
  "custom_data": {
    "订单号": "ORD-1",
    "金额": "100000"
  }
}

响应

成功响应示例

{
    "status": "success",
    "code": 200,
    "message": "",
    "data": {
        "total": 1,
        "data": [
            {
                "id": 3625,
                "creation_id": 181,
                "name": "9 月催收任务",
                "description": "www",
                "channels": [
                    {
                        "channel_name": "voice",
                        "auth_id": 30090,
                        "conversation_id": 5580
                    },
                    {
                        "channel_name": "whatsapp-meta",
                        "auth_id": 30058,
                        "conversation_id": 5581
                    }
                ],
                "user_name": "Budi",
                "user_phone": "628123456789",
                "assignee_username": "incs_1",
                "status": 1,
                "task_template_id": 11,
                "custom_data": {
                    "data": "2026-09-10",
                    "money": "100000",
                    "name": "www",
                    "number": "432526436436"
                },
                "created_at": "2026-09-14 10:35:13",
                "updated_at": "2026-09-14 10:53:47"
            }
        ]
    },
    "error": {}
}

失败响应示例

{
    "status": "error",
    "code": 400,
    "message": "Data error",
    "data": {},
    "error": {}
}