Export the views of a document
/documents/{document_id}/views/exportsStarts a CSV export of one document's views as GET /documents/{document_id}/views lists them, and answers 202 with the job. Needs the permission to manage user documents, else 403 missing_permission; a document the token cannot read returns 404. Columns: id, user_id, user_type, intent, created_at, updated_at. The body takes filter and sort as the list does. Poll GET /jobs/{id}; result.download_url gives the file for 7 days.
Path parameters
The document's id.
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 filters of the list, written as in
GET /documents/{document_id}/views, such as { "user_type": "investor" }. Operators nest the same way, such as { "created_at": { "gte": "2026-10-01" } }.Comma-separated fields to sort by, as on the list. Prefix a field with
-for descending.- One of:
The file format. Only csv is offered, and it is the default.
csv
{
"filter": {
"user_type": "investor"
}
}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/{document_id}/views/exports\
-H "Authorization: Bearer $HELM_API_KEY"\
-H "Content-Type: application/json"\
-d '{
"filter": {
"user_type": "investor"
}
}'