Skip to main content
PUT
/
task
/
{taskid}
Update task by ID
curl --request PUT \
  --url https://apiweb.mile.app/api/v3/task/{taskid} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "flow": "Visit",
  "hubId": "634e98498ce07d29474a7e29",
  "field1": "John Birdy",
  "field2": "Gambir Jakarta",
  "field3": "-6.230815251,106.75684387",
  "startTime": "2022-11-02T07:28:23+00:00",
  "endTime": "2022-11-05T07:28:23+00:00"
}
'
{
  "status": true,
  "message": "Success",
  "task": {
    "_id": "6352736c628401059b37a2e2",
    "flow": "Visit",
    "hubId": "634e98498ce07d29474a7e29",
    "startTime": "2022-11-02T07:28:23+00:00",
    "organizationId": "634e98098ce07d29474a7e22",
    "status": "UNASSIGNED",
    "hub": {
      "_id": "634e98498ce07d29474a7e29",
      "name": "Jakarta",
      "lat": -6.205154152722965,
      "lng": 106.84667067970608
    },
    "orderIndex": 10,
    "field1": "John Birdy",
    "field2": "Gambir Jakarta",
    "field3": "-6.230815251,106.75684387",
    "createdFrom": "API",
    "endTime": "2022-11-05T07:28:23+00:00",
    "createdBy": "Roger",
    "updatedTime": "2022-11-01T07:28:23+00:00",
    "createdTime": "2022-11-01T07:28:23+00:00"
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Path Parameters

taskId
string
required

Unique identifier for the task that generated by system. Example: 6352736c628401059b37a2e2

Body

application/json
flow
string
required

The unique name of organization's flow. Use GET /flows API to get the list of flow names. Example: Visit

hubId
string
required

Fundamental entity within an organization, serving as the central point for managing various operational components. Use GET /hubs endpoint to get the list of Hub IDs. Example: 634e98498ce07d29474a7e29

field1
string

This field's type & value is according to Flow's setting. Use GET /flow/{flowName}/task API to get example of payload. Example: John Birdy

field2
string

This field's type & value is according to Flow's setting. Use GET /flow/{flowName}/task API to get example of payload. Example: Gambir Jakarta

field3
string

This field's type & value is according to Flow's setting. Use GET /flow/{flowName}/task API to get example of payload. Example: -6.230815251,106.75684387

startTime
string<date-time>

Start time refers to the designated time for users to begin a task. If startTime is not provided, it will default to the configured time in the flow. You can view the datetime format here. Example: 2022-11-02T07:28:23+00:00

endTime
string<date-time>

End time is the deadline for completing a task. If endTime is not specified, it will default to the configured time in the flow.The task cannot be completed if the date has passed the endtime. You can view the datetime format here Example: 2022-11-05T07:28:23+00:00

assignee
object[]

You can assign tasks using user email according to their task hub. To assign tasks to multiple users, use a comma (',') as a separator. Example: ['leandro@mile.app']

Response

Success

status
boolean

Status of response.

message
string

Message of API response.

task
object

Detail of object task.