Analytics

Export the people who viewed a deal

POST/analytics/reports/deal-viewers/exports

Starts an export of the viewer rows a list would return, as a CSV file with one column per row field, and returns 202 with a job and its Location. The body takes the same filter and sort as GET /analytics/reports/deal-viewers, and filter.deal_id is required (422 validation_failed without it). Poll GET /jobs/{id}; when it succeeds, its result.download_url gives the file for 7 days. It queues one job and sends nothing; the job can be cancelled with POST /jobs/{id}/actions/cancel.

Headers

  • Idempotency-Keystring#

    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, required

  • filterobjectRequired#

    The filters of the list, written as in GET /analytics/reports/deal-viewers. deal_id is required, such as { "deal_id": "9f3b6e2a-4c7d-4a1e-9b2f-8d0c1a3e5f70" }.

  • sortstring#

    Comma-separated fields to sort by, as on the list. Prefix a field with - for descending.

  • formatstring#

    The file format. Only csv is offered, and it is the default.

    One of: csv
{
  "filter": {
    "deal_id": "9f3b6e2a-4c7d-4a1e-9b2f-8d0c1a3e5f70"
  },
  "sort": "-views"
}

Responses

202

The export job was started.

Job
{
  "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"
  }
}
401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

Authorization failed. error.code is one of org_disabled, ip_blocked, missing_scope, scope_disabled, user_disabled.

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

Examples

curl -X POST https://your-org-domain/kong/core/api/v2/analytics/reports/deal-viewers/exports\
  -H "Authorization: Bearer $HELM_API_KEY"\
  -H "Content-Type: application/json"\
  -d '{
  "filter": {
    "deal_id": "9f3b6e2a-4c7d-4a1e-9b2f-8d0c1a3e5f70"
  },
  "sort": "-views"
}'