API/behavior changes

We expose one single route on the instance which accepts a bunch of parameters.

// POST /export

{
  "url": "<http://localhost:7711>",
  "apiKey": null,
  "payloadSize": "123 MiB",
  "indexes": {
    "*": {
      "filter": null,
      "overrideSettings": true
    }
  }
}
{
  "taskUid": 2,
  "indexUid": null,
  "status": "enqueued",
  "type": "export",
  "enqueuedAt": "2025-06-26T12:54:10.785864Z"
}
{
  "uid": 8,
  "progress": {
    "steps": [
      {
        "currentStep": "processing tasks",
        "finished": 0,
        "total": 2
      },
      {
        "currentStep": "Exporting index `movies`",
        "finished": 0,
        "total": 1
      },
      {
        "currentStep": "document",
        "finished": 2200,
        "total": 31944
      }
    ],
    "percentage": 3.443526
  },
  "details": {
    "url": "<http://localhost:7711>",
    "payloadSize": "1 GiB",
    "indexes": {
      "*": {
        "filter": null
      }
    }
  },
  "stats": {
    "totalNbTasks": 1,
    "status": {
      "processing": 1
    },
    "types": {
      "export": 1
    },
    "indexUids": {}
  },
  "duration": null,
  "startedAt": "2025-06-26T13:23:00.321422Z",
  "finishedAt": null,
  "batchStrategy": "stopped after the last task of type `export` because they cannot be batched with tasks of any other type."
}
{
      "uid": 6,
      "batchUid": 5,
      "indexUid": null,
      "status": "succeeded",
      "type": "export",
      "canceledBy": null,
      "details": {
        "url": "<http://localhost:7711>",
        "apiKey": "XXX...",
        "payloadSize": "1 GiB",
        "indexes": {
          "movies": {
            "matched_documents": 31944
          }
        }
      },
      "error": null,
      "duration": "PT0.446478S",
      "enqueuedAt": "2025-06-30T16:46:01.760116Z",
      "startedAt": "2025-06-30T16:46:01.772816Z",
      "finishedAt": "2025-06-30T16:46:02.219294Z"
    }

One task can retry requests in case of failure (not indefinitely, though) and can also be canceled. However, keep in mind that canceling this export task will not cancel tasks received by the targeted Meilisearch instance.

Telemetry

We send the Export Triggered event when the export route is called. It features the following parameters:

Error handling

InvalidExportUrl, InvalidExportApiKey, InvalidExportPayloadSize, InvalidExportIndexesPatterns, InvalidExportIndexFilter are new invalid requests errors. They all return a new direct error message to the user on the call to the export route.