Export documents
/documents/exportsStarts an export of the documents GET /documents would return and answers 202 with the job (type export). Poll GET /jobs/{id}; result.download_url works for 7 days. Ids you can't see are not selected. zip: files follow the /download rules; result.files counts them and result.skipped lists {id, name, code, message} of those left out. Over 5,000 files or 2 GB it fails too_large; with none left, nothing_to_download with error.details[0].skipped. Writes a download access record per zipped file, which can't be undone. No dry run.
Headers
Makes a retry safe. Send a new UUID for each new request and reuse it only to retry that request; the first response is replayed for 24 hours.
Request body
application/json, optional
The list's filters, as in
GET /documents, such as { "deal_id": "…" }; operators nest, such as { "type": { "in": "pdf,doc" } }.filter[id][in]takes at most 100 ids; for larger zips select folders withwithin_folder_id(at most 50 per operator, each with its subtree; more is a 422).Comma-separated fields to sort by, as on the list. Prefix a field with
-for descending.- One of:
csv (default): one row per document, its fields then
folder_path. zip: the files; one under afilter[within_folder_id]folder goes under{folder name}/{path below it}/, others at the root; duplicate names becomename (1).ext; watermarked and masked PDFs are their transformed copy.csv,zip Settings for the chosen format. csv takes none.
{
"filter": {
"deal_id": "9f8e7d6c-5b4a-4938-8271-6a5b4c3d2e1f"
}
}Responses
{
"data": {
"id": "9a9d1c5e-4f2b-4c8e-9a7d-2f1e6b3c4d5a",
"type": "string",
"status": "queued",
"progress": {
"done": 1,
"total": 1
},
"result": {},
"error": {},
"created_at": "2026-06-12T10:00:00+00:00",
"updated_at": "2026-06-12T10:00:00+00:00",
"completed_at": "2026-06-12T10:00:00+00:00"
}
}Authorization failed. error.code is one of org_disabled,
ip_blocked, missing_scope, scope_disabled, user_disabled.
The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per
problem, or a code documented on the operation.
Examples
curl -X POST https://your-org-domain/kong/core/api/v2/documents/exports\
-H "Authorization: Bearer $HELM_API_KEY"\
-H "Content-Type: application/json"\
-d '{
"filter": {
"deal_id": "9f8e7d6c-5b4a-4938-8271-6a5b4c3d2e1f"
}
}'