Skip to main content
GET
/
tasks
/
export-log
cURL
curl -X GET "https://apiweb.mile.app/api/v3/tasks/export-log?page=1&limit=10&sortBy=requestAt&sortOrder=desc" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "status": true,
  "message": "Success",
  "total": 25,
  "data": [
    {
      "_index": "export",
      "_type": "_doc",
      "_id": "exp_61e5477611c1b26cef05d37c",
      "_score": 1,
      "_source": {
        "organizationId": "61c2fbaaf27b374e8913fe72",
        "dataType": "task",
        "dataName": "Task Export - January 2024",
        "status": "Done",
        "requestAt": "2024-01-15T10:30:00+00:00",
        "completedAt": "2024-01-15T10:32:15+00:00",
        "email": "john.doe@mile.app",
        "fileUrl": "https://staticdev.mile.app/production-mile/20240115/task_61c2fbaaf27b374e8913fe72_1705315800.xlsx",
        "fileType": "xlsx",
        "totalRecords": 1247,
        "errorMessage": null
      }
    },
    {
      "_index": "export",
      "_type": "_doc",
      "_id": "exp_61e5477611c1b26cef05d38d",
      "_score": 1,
      "_source": {
        "organizationId": "61c2fbaaf27b374e8913fe72",
        "dataType": "data",
        "dataName": "Customer Data Export",
        "status": "Processing",
        "requestAt": "2024-01-15T11:00:00+00:00",
        "completedAt": null,
        "email": "john.doe@mile.app",
        "fileUrl": null,
        "fileType": "xlsx",
        "totalRecords": 0,
        "errorMessage": null
      }
    },
    {
      "_index": "export",
      "_type": "_doc",
      "_id": "exp_61e5477611c1b26cef05d39e",
      "_score": 1,
      "_source": {
        "organizationId": "61c2fbaaf27b374e8913fe72",
        "dataType": "vehicle",
        "dataName": "Fleet Report - December 2023",
        "status": "Failed",
        "requestAt": "2024-01-14T09:00:00+00:00",
        "completedAt": "2024-01-14T09:05:30+00:00",
        "email": "john.doe@mile.app",
        "fileUrl": null,
        "fileType": "xlsx",
        "totalRecords": 0,
        "errorMessage": "Query timeout: Dataset too large"
      }
    }
  ],
  "params": {
    "from": 0,
    "size": 10,
    "query": {
      "bool": {
        "must": [
          {
            "term": {
              "organizationId.keyword": "61c2fbaaf27b374e8913fe72"
            }
          },
          {
            "range": {
              "requestAt": {
                "lte": "2024-01-15T12:00:00+00:00",
                "gte": "2023-12-16T12:00:00+00:00"
              }
            }
          }
        ]
      }
    },
    "sort": [
      {
        "requestAt": {
          "order": "desc"
        }
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Use a valid Bearer token to authenticate.

Query Parameters

sortBy
string

Field name to sort the results by. Sorts the export log entries based on the specified field. Example: requestAt, status, dataType, dataName Default: requestAt

sortOrder
enum<string>

Sort order for the results. Use asc for ascending or desc for descending order. Example: desc Default: desc

Available options:
asc,
desc
limit
integer

Maximum number of export log entries to return per page. Controls pagination size. Example: 20 Default: 10 Min: 1, Max: 100

Required range: 1 <= x <= 100
page
integer

Page number for pagination. Use in combination with limit to navigate through results. Example: 1 Default: 1 Min: 1

Required range: x >= 1
dataName
string

Filter export logs by the name of the exported data. Useful for finding exports of specific entities. Example: Task Export - January 2024, Driver List

dataType
enum<string>

Filter export logs by type of data that was exported. Helps narrow down results to specific export categories. Example: task, data, vehicle

Available options:
task,
data,
vehicle,
driver,
route
status
enum<string>

Filter export logs by processing status. Use to find exports that are still processing, completed, or failed. Example: Done, Processing, Failed

Available options:
Processing,
Done,
Failed
email
string

Filter export logs by user email who initiated the export. If not provided, defaults to the authenticated user's email. Example: john.doe@mile.app Default: Current user's email

Response

Success - Export log retrieved

status
boolean

Status of response.

message
string

Message of API response.

total
integer

Total number of export log entries matching the filters (across all pages).

data
object[]

Array of export log entries from ElasticSearch.

params
object

ElasticSearch query parameters used for this request (for debugging purposes).