Skip to main content
POST
/
tasks
/
export
cURL
curl -X POST "https://apiweb.mile.app/api/v3/tasks/export" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "download": "xlsx",
    "fields": "startTime,endTime,hubId,createdBy,flow,status",
    "status": "DONE",
    "flowId": "63d8c9b0dbd5ef20a627dd86",
    "hubId": "621dd813eb3ebf16b94d6969",
    "page": 1,
    "limit": 100,
    "sortBy": "createdTime",
    "sortOrder": "desc",
    "background": false
  }'
{
  "Direct Export (background=false)": {
    "value": {
      "status": true,
      "message": "Success",
      "total_data_be": 150,
      "last_id": "61e5477611c1b26cef05d37c",
      "last_field": "status",
      "data": {
        "time": 1644595005,
        "organizationId": "61c2fbaaf27b374e8913fe72",
        "reportType": "task",
        "link": "https://staticdev.mile.app/production-mile/20220211/task_61c2fbaaf27b374e8913fe72_1644595005.xlsx",
        "status": "Done"
      }
    }
  },
  "Background Export (background=true)": {
    "value": {
      "status": true,
      "message": "Export queued for background processing. Check status at GET /tasks/export-log",
      "total_data_be": 0,
      "data": {
        "time": 1644595005,
        "organizationId": "61c2fbaaf27b374e8913fe72",
        "reportType": "task",
        "status": "Processing"
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Body

application/json

Request body containing export parameters. Use filters to narrow down the dataset and fields parameter to select specific columns.

Request body schema for exporting tasks. Use filters to narrow down the dataset and customize the export output.

download
enum<string>
required

File type that user want to download. There are 2 types of download: enum: json,xlsx Example: xlsx

Available options:
json,
xlsx
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

doneBy
string

Name of user that completing the task. Example: Leandro

assignee
string

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

status
enum<string>

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

Available options:
UNASSIGNED,
ONGOING,
DONE
flowId
string

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

hubId
string

The identifier for the hub that generated by system. Use GET /hubs API to get the list of Hub IDs. Example: 621dd813eb3ebf16b94d6969

page
integer<int32>

Pagination of tasks result list. Example: 2. Default: 1

limit
integer<int32>

Limit of tasks result list. Example: 10. Default: 30

sortBy
string

sortBy is used to sort the result-set in ascending or descending order according to selected field. The value of this param is one of available fields on task objects. Example: flow, assignee, status, hubId, etc. Default: createdTime

sortOrder
enum<string>

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

Available options:
asc,
desc
background
boolean

If the user sets the background parameter to true, the export process will utilize background processing, and the results will be available at GET /tasks/export-log API. If the user sets the background parameter to false, the export process will run directly, and the results will be immediately available in the response. Example: true. Default: false

exportConfigId
string

Unique identifier for the export config for allow user to export data using their own configuration. Use GET /export-configs endpoint to get the list of Export Config IDs. Example: 634e98498ce07d29474a7e29

Response

Success - Export completed or queued

status
boolean

Status of response.

message
string

Message of API response.

total_data_be
integer

Total number of tasks successfully exported.

last_id
string

ID of the last task that was successfully exported.

last_field
string

Name of the last field that was successfully exported.

data
object

Export file information. Structure varies based on processing mode (direct vs background).