---
title: "Run a specific version of a meter"
method: POST
path: "/meters/run/{meterId}/{version}"
tags: ["Meters"]
---

# Run a specific version of a meter

`POST /meters/run/{meterId}/{version}`

Executes a specific version of a meter in Zuora Mediation. You can choose to run it with either a local file or event store source by providing optional configurations.

**Note on long-running meters and timeouts:** 
For large meters with many operators, this API call might take longer to return and, in some cases, can time out even though the meter run has been successfully triggered.
To safely handle this, provide a `uniqueKey` field in the request body.
If the operation times out, retry the same request with the same `uniqueKey`.
If the original run already exists, the API returns a 400 error indicating a duplicate `uniqueKey` instead of creating a new run.

## Path parameters

- `meterId` string, required
- `version` '0.0.1', required

## Headers

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

## Request body

- RunMeterVersionRequest — The request payload to run a specific version of a meter.
  - `sourceOptions` object[] — Settings for meter to run with local file.
    - `processorId` string — Source operator ID. Optional if there's only one local file source in the meter.
    - `localFileId` string — Internal ID of uploaded file.
  - `eventStoreSourceOptions` object[] — Settings for meter to run with event store.
    - `processorId` string, required — Source operator ID.
    - `startDate` string, date — Start date of event store to query from (e.g., 2025-01-01).
    - `endDate` string, date — End date of event store to query to (e.g., 2025-02-01).
  - `runtimeSourceConfigs` RuntimeSourceConfig[] — Runtime source configurations to override source settings at execution time. Applies to both NORMAL and DEBUG runs.
    - `processorId` string — ID of the source processor in the meter definition to apply this configuration to. Required when the meter has multiple sources of the same type.
    - `sourceType` 'LOCAL_FS' | 'S3' | 'SNOWFLAKE' | 'EVENT_STORE', required — Type of the source. Must match the actual source type in the meter definition.
    - `localFs` LocalFsOptions — Configuration options for LOCAL_FS sources (previously uploaded files).
      - `fileId` integer, required — The ID of the file uploaded through the "Upload a file" operation, to be used as the source.
    - `s3` S3Options — Configuration options for S3 sources (paths, connection).
      - `connectionName` string — Name of the S3 connection to use.
      - `connectionVersion` integer — Version of the S3 connection.
      - `paths` string[], required — List of S3 paths to read from.
      - `fileFormat` 'CSV' | 'EXCEL' | 'PARQUET' | 'JSON' | 'XML' | 'AVRO', required — Format of the input files.
      - `incremental` boolean — Enables incremental mode to continuously monitor for new files. When `false`, files are processed only once.
      - `monitorInterval` integer — Interval in milliseconds for checking for new files when incremental mode is enabled. This field is applicable only when `incremental` is set to `true`.
      - `retentionTime` integer — Retention time in milliseconds for processed files.
      - `batchSize` integer — Batch size for reading files.
    - `snowflake` SnowflakeOptions — Configuration options for Snowflake sources.
      - `database` string — Snowflake database name.
      - `schema` string — Snowflake schema name.
      - `table` string — Snowflake table name.
      - `query` string — Custom SQL query to execute (SELECT only).
      - `warehouse` string — Snowflake warehouse to use.
      - `role` string — Snowflake role to use.
      - `unloadFileFormat` 'CSV' | 'EXCEL' | 'PARQUET' | 'JSON' | 'XML' | 'AVRO' — File format for UNLOAD operation.
      - `queryParameters` object — Parameter values for parameterized queries (:paramName syntax).
    - `eventStore` EventStoreOptions — Configuration options for EventStore sources (date range).
      - `storeId` string, required — Event store ID to read from.
      - `startDate` string — Start date for partition pruning (YYYY-MM-DD).
      - `endDate` string — End date for partition pruning (YYYY-MM-DD).
      - `query` string — Ad-hoc SQL query for Event Store (SELECT only, mutually exclusive with date range).
  - `uniqueKey` string — Optional idempotency key for this meter run. The `uniqueKey` is scoped to the meter (not tenant-wide). When you trigger a meter run and the operation times out, you can safely retry the same request using the same `uniqueKey`. If the original request already created a run, Zuora Mediation returns a 400 error indicating a duplicate `uniqueKey` and does not start a new run. This behavior ensures idempotency and prevents duplicate meter executions.

## Response `200`

Successful meter run

- RunMeterVersionResponse — Response payload after triggering a meter run.
  - `success` boolean — Whether the API request has succeeded.
  - `data` object
    - `id` string — Internal run history ID, unique within tenant.
    - `sessionId` string — Corresponding session ID of this run.
    - `jobId` string — Corresponding job ID of this run.
    - `meterId` integer — Internal meter ID.
    - `version` string — Version of the meter.
    - `revision` integer — Revision number of this version run.
    - `runType` integer — The run type: - 1. NORMAL - 2. DEBUG
    - `runTypeDescription` string — Description of the run type.
    - `startTime` string, date-time — Start time of this run.
    - `endTime` string, date-time, nullable — End time of this run.
    - `status` integer — The run status: - 1. NEVER_RUN - 2. TESTING - 3. TESTING_FAILED - 4. TESTING_PASSED - 5. RUNNING - 6. PAUSED - 7. COMPLETED - 8. FAILED - 9. CANCELED - 10. INITIALIZING - 11. USAGE_PUSHING - 12. PUSH_COMPLETED - 13. CONSUME_COMPLETED
    - `statusDescription` string — Description of the run status.
    - `canExportSummary` boolean — Whether the summary is ready to export.
    - `hasLineageEnabled` boolean — Whether lineage feature is enabled on this run.
  - `previousPage` string — Cursor or URL for the previous page of audit records, if available. Used for backward pagination.
  - `nextPage` string — Cursor or URL 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
- `401` — Unauthorized request
- `500` — Internal server 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)
