---
title: "Create a job to export audit trail data for a meter"
method: POST
path: "/meters/{meterId}/auditTrail/export"
tags: ["Audit Trail"]
---

# Create a job to export audit trail data for a meter

`POST /meters/{meterId}/auditTrail/export`

Creates a background job to export the audit trail entries for a specific meter in Zuora Mediation. 
This API is for large-scale, offline access to audit data. Only one export job is processed per tenant 
at a time, and each export has a record limit, for example, up to 5 million rows per report. 
Use the returned `requestId` as the `requestId` query parameter with the "Retrieve the list of export jobs for a meter" 
operation to track the status of that specific job and retrieve the generated file names from `fileList`. 
Then use the "Retrieve the presigned URL for an export job" operation with each `fileKey` in `fileList` to 
download the files.

## Path parameters

- `meterId` integer, required

## Query parameters

- `exportType` 'SAMPLE' | 'ERROR', required
- `runType` 'DEBUG' | 'NORMAL', required
- `sessionIds` string[]
- `runStatuses` string[]
- `operatorIds` string[]
- `queryFromTime` string, required
- `queryToTime` string, required
- `format` 'csv' | 'parquet' | 'avro'
- `compression` 'none' | 'gzip' | 'lz4' | 'zstd'

## Headers

- `Content-Type` string, required
- `Accept-Encoding` string
- `Content-Encoding` string
- `Zuora-Entity-Ids` string
- `Zuora-Org-Ids` string
- `Zuora-Track-Id` string

## Response `200`

OK

- ExportAuditTrailResponse
  - `success` boolean — Indicates whether the request was successful.
  - `data` object — List of audit trail entries for the specified meter. Each object represents a recorded event or operation associated with the meter.
  - `previousPage` string, nullable — Cursor for the previous page of audit records, if available. Used for backward pagination.
  - `nextPage` string, nullable — Cursor for the next page of audit records, if available. Used for forward pagination.
  - `error` Error
    - `code` string — Machine-readable error code identifying the failure type.
    - `message` string — Human-readable description of the error that provides more context about what went wrong.
    - `detail` object — Additional structured details about the error, such as validation issues or parameter-specific information.

## Other responses

- `400` — Bad Request - Invalid or missing parameters.
- `401` — Unauthorized - Authentication failed.
- `500` — Internal Server Error - Unexpected error.

---

[API](https://skmtc.dev/zuora/apis/api-reference.md) · [All operations](https://skmtc.dev/zuora/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/zuora/api-reference/revisions/d11e237f3e54/schema)
