---
title: "Preview DCI history export selection"
method: POST
path: "/v1/data-export/metrics"
tags: ["Data Export"]
---

# Preview DCI history export selection

`POST /v1/data-export/metrics`

## Request

- Base URL: `http://127.0.0.1:8000`
- URL: `http://127.0.0.1:8000/v1/data-export/metrics`
- Auth: HTTP bearer

Resolve the metrics that the export request given in the body would select, without running the export. The result lists each metric with its classifier tag, owner, unit, origin and the history tier that would actually be read. Use it to let the operator review and narrow the selection, then pass the chosen metrics to POST /v1/data-export as "dciList". Format and anonymization fields of the request are ignored.

## Request body

- DataExportRequest
  - `rootObjectId` integer: Root of the object subtree searched for tagged DCIs; required unless dciList is given
  - `tagPatterns` string[]: Glob patterns (* and ? wildcards) matched against DCI system tag, e.g. "eed.*"
  - `dciList` object[]: Explicit metric selection; when not empty, rootObjectId and tagPatterns are ignored
    - `ownerId` integer, required: Object ID of the DCI owner
    - `dciId` integer, required: DCI ID
  - `timeFrom` union, required: Start of export period (ISO 8601 string or UNIX time in seconds)
    - string, date-time
    - integer
  - `timeTo` union, required: End of export period, inclusive (ISO 8601 string or UNIX time in seconds)
    - string, date-time
    - integer
  - `tier` 'raw' | 'hourly' | 'daily': History tier to export. Aggregated tiers produce one row per bucket with average in "value" and additional min, max and count columns; metrics for which the requested tier is not available fall back to raw samples.
  - `format` 'csv': Output format
  - `anonymize` boolean: Replace object names with class-based pseudonyms and metric identifiers with stable pseudonyms
  - `keepMapping` boolean: Produce pseudonym mapping file (anonymized exports only), downloadable with type=mapping

## Response `200`

Selected metrics

- object
  - `metrics` DataExportMetric[]
    - `ownerId` integer: Object ID of the DCI owner
    - `dciId` integer: DCI ID
    - `tag` string: System (classifier) tag
    - `name` string: DCI name
    - `description` string: DCI description
    - `unit` string: Unit name
    - `origin` string: Data origin name (e.g. snmp, agent, push, computed)
    - `dataType` string: Transformed data type name
    - `tier` 'raw' | 'hourly' | 'daily': History tier that export will read for this metric
  - `skippedCount` integer: Number of matching DCIs excluded as non-numeric, table, or inaccessible

## Other responses

- `400`: Invalid request
- `401`: Unauthorized
- `403`: No read access to root object
- `404`: Root object not found

## Changes

- **2026-10-19** `290af90fdb5a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/netxms/apis/netxms-api/changes/v1/data-export/metrics/post.md)

---

[API](https://skmtc.dev/netxms/apis/netxms-api.md) - [All operations](https://skmtc.dev/netxms/apis/netxms-api/llms.txt) - [OpenAPI document](https://skmtc.dev/netxms/apis/netxms-api/revisions/740d85ba6674?raw)
