Skip to main content
POST
/
tasks
/
bulk
Create multiple tasks
curl --request POST \
  --url https://apiweb.mile.app/api/v3/tasks/bulk/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "background": false,
  "tasks": [
    {
      "flow": "Visit",
      "hubId": "634e98498ce07d29474a7e29",
      "field1": "Jack Ward",
      "field2": "Gambir Jakarta",
      "field3": "-6.230815251,106.75684387",
      "startTime": "2022-11-02T07:28:23+00:00",
      "endTime": "2022-11-05T07:28:23+00:00"
    },
    {
      "flow": "Visit",
      "hubId": "634e98498ce07d29474a7e29",
      "field1": "John Birdy",
      "refId": "66544e0855d2696d401d8252"
    }
  ]
}
'
{
  "success": 2,
  "failed": 0,
  "tasks": [
    {
      "status": true,
      "message": "Task has been created",
      "_id": "62067ee1cd77000042006f89"
    },
    {
      "status": true,
      "message": "Task has been created",
      "_id": "62067ee3cd77000042006f8b",
      "refId": "66544e0855d2696d401d8252"
    }
  ]
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

application/json
tasks
object[]
required

The maximum data for creating multiple tasks is 2000 data.

background
boolean

When the background parameter is set to true , the action will be processed in the background. In this mode, the API call will return quickly with a response indicating that the create task request has been received and is being processed asynchronously in the background. When the background parameter is set to false (default), the create task will be processed directly via API. This means that the API call will wait for the create task process to complete before returning the results to the user. Default: false.

Response

Success

success
integer

Total success created task.

failed
integer

Total failed created task.

tasks
object[]

Detail of created task.