Skip to main content
GET
/
tasks
Read tasks
curl --request GET \
  --url https://apiweb.mile.app/api/v3/tasks \
  --header 'Authorization: Bearer <token>'
{
  "status": true,
  "message": "Success.",
  "tasks": {
    "current_page": 1,
    "data": [
      {
        "_id": "670391525629320817090499",
        "flow": "House Inspection",
        "hubId": "6703914e77af81f988097019",
        "status": "ONGOING",
        "startTime": "2024-10-07T07:44:18+00:00",
        "endTime": "2025-10-07T07:44:18+00:00",
        "assignee": [
          "jhondie@gmail.com"
        ],
        "assignedBy": "System",
        "title": "Ophelia (Demo Data 9)",
        "content": "76124 Paul Crossroad Suite 868",
        "flowId": "6703914f77af81f98809701b",
        "createdFrom": "API",
        "assignedTime": "2024-10-07T07:44:18+00:00",
        "createdTime": "2024-10-07T07:44:18+00:00",
        "assignedVehicle": null
      },
      {
        "_id": "670391525629320817090496",
        "flow": "House Inspection",
        "hubId": "6703914e77af81f988097019",
        "status": "ONGOING",
        "startTime": "2024-10-07T07:44:18+00:00",
        "endTime": "2025-10-07T07:44:18+00:00",
        "assignee": [
          "jhondie@gmail.com"
        ],
        "assignedBy": "System",
        "title": "Maxie (Demo Data 8)",
        "content": "6859 Sebastian Stravenue",
        "flowId": "6703914f77af81f98809701b",
        "createdFrom": "API",
        "assignedTime": "2024-10-07T07:44:18+00:00",
        "createdTime": "2024-10-07T07:44:18+00:00",
        "assignedVehicle": null
      }
    ],
    "first_page_url": "https://apiweb.mile.app/api/v3/tasks?limit=20&hubId=6703914e77af81f988097019&sortBy=startTime&fields=assignedBy%2CassignedTime%2Cassignee%2Ccontent%2CcreatedTime%2CendTime%2CcreatedFrom%2Cflow%2CflowId%2ChubId%2CstartTime%2Cstatus%2C_id%2Ctitle%2Clabel&page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "https://apiweb.mile.app/api/v3/tasks?limit=20&hubId=6703914e77af81f988097019&sortBy=startTime&fields=assignedBy%2CassignedTime%2Cassignee%2Ccontent%2CcreatedTime%2CendTime%2CcreatedFrom%2Cflow%2CflowId%2ChubId%2CstartTime%2Cstatus%2C_id%2Ctitle%2Clabel&page=1",
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "active": false
      },
      {
        "url": "https://apiweb.mile.app/api/v3/tasks?limit=20&hubId=6703914e77af81f988097019&sortBy=startTime&fields=assignedBy%2CassignedTime%2Cassignee%2Ccontent%2CcreatedTime%2CendTime%2CcreatedFrom%2Cflow%2CflowId%2ChubId%2CstartTime%2Cstatus%2C_id%2Ctitle%2Clabel&page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "active": false
      }
    ],
    "next_page_url": null,
    "path": "https://apiweb.mile.app/api/v3/tasks",
    "per_page": 20,
    "prev_page_url": null,
    "to": 10,
    "total": 10
  },
  "metadata": {
    "counting": {
      "doneTotal": 0,
      "ongoingTotal": 0
    },
    "sourceDataTask": "-"
  },
  "dataVersion": "1728463665"
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Query Parameters

page
integer
default:1

The page number of results to retrieve. Example: 2

limit
integer
default:20

Specifies the maximum number of items to retrieve in a single request. Example: 10

Required range: 1 <= x <= 1000
fields
string

Fields is for selecting the specific fields that you can choose by multiples to show in the response using a string with a comma delimiter. Example: startTime,endTime,hubId,createdBy,flow,status

flow
string

List flow name that user need to get, string with comma (,) delimiter. Use Flow /flows API to get the list of flow names. Example: Visit,Delivery,Pickup

flowId
string

The identifier for the flow that generated by system. Use Flow /flows API to get the list of flow id. Comma (,) delimiter for filter multiple flow. Example: 63d8c9b0dbd5ef20a627dd86,73d8c9b0dbd5ef20a627dd87

doneBy
string

Name of user that completing the task. Example: Leandro

assignee
string

User email for a given task. Example: leandro@mile.app

status
string

Status of task according to task's data condition. There are 3 types of status: enum: UNASSIGNED,ONGOING,DONE Example: UNASSIGNED

hubId
string

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

active
string

state of active means we only need to retrieve tasks which startTime and endTime is still relevant with the current time. Example: true

isVisit
string

state of visit means we only need to retrieve tasks which endTime is still relevant with the current time. Example: true

routingResultId
string

This key is related to the routing process. When a visit success dispatches the routingResultId will exist on task body. Example: 66791ba47b28d74dab531db2

sortBy
string

sortBy is used to sort the result-set in ascending or descending order according to selected field. Example: createdTime,orderIndex,startTime,doneTime Default: createdTime

sortOrder
string

sortOrder is to decide ascending or descending order Example: asc or desc. Default: desc

timeBy
string

Optional filter to range data between one of the following options : enum: createdTime,startTime,doneTime Example: startTime

timeFrom
string<date-time>

Used to set the start limit of the data range to retrieve based on timeBy with format (Y-m-d H:i:s) Example: 2023-01-01 00:00:00

timeTo
string

Used to set the end limit of the data range to retrieve based on timeBy with format (Y-m-d H:i:s) Example: 2023-01-01 23:59:59

lazyLoad
integer

Used to set the lazy load mode or cursor method pagination for the task list. If set to 1, it will ignore page parameter and using cursor parameter for pagination. Example: 1

cursor
string

Used in conjunction with lazyLoad parameter. If lazyLoad is set to 1, this parameter will be used to get the next page of data. The value should be the last task ID Example: 670391525629320817090499

Response

Success

status
boolean

Status of response.

message
string

Message of API response.

task
object

Detail of object task.