---
title: "POST /subscriptions/{subscriptionId}/metrics:getBatch"
method: POST
path: "/subscriptions/{subscriptionId}/metrics:getBatch"
---

# POST /subscriptions/{subscriptionId}/metrics:getBatch

`POST /subscriptions/{subscriptionId}/metrics:getBatch`

Lists the metric values for multiple resources.

## Path parameters

- `subscriptionId` string, uuid, required

## Query parameters

- `api-version` string, required
- `starttime` string
- `endtime` string
- `interval` string
- `metricnamespace` string, required
- `metricnames` string[], required
- `aggregation` string
- `top` integer
- `orderby` string
- `filter` string
- `rollupby` string

## Request body

- ResourceIdList — The comma separated list of resource IDs to query metrics for.
  - `resourceids` string[] — The list of resource IDs to query metrics for.

## Response `200`

The request has succeeded.

- MetricResultsResponse — The metrics result for a resource.
  - `values` MetricResultsResponseValuesItem[] — The collection of metric data responses per resource, per metric.
    - `starttime` string, required — The start time, in datetime format, for which the data was retrieved.
    - `endtime` string, required — The end time, in datetime format, for which the data was retrieved.
    - `interval` string — The interval (window size) for which the metric data was returned in ISO 8601 duration format with a special case for 'FULL' value that returns single datapoint for entire time span requested (*Examples: PT15M, PT1H, P1D, FULL*). This may be adjusted and different from what was originally requested if AutoAdjustTimegrain=true is specified.
    - `namespace` string — The namespace of the metrics been queried
    - `resourceregion` string — The region of the resource been queried for metrics.
    - `resourceid` string — The resource that has been queried for metrics.
    - `value` Metric[], required — The value of the collection.
      - `id` string, required — The metric Id.
      - `type` string, required — The resource type of the metric resource.
      - `name` LocalizableString, required — The localizable string class.
        - `value` string, required — The invariant value.
        - `localizedValue` string — The display name.
      - `displayDescription` string — Detailed description of this metric.
      - `errorCode` string — 'Success' or the error details on query failures for this metric.
      - `errorMessage` string — Error message encountered querying this specific metric.
      - `unit` 'Count' | 'Bytes' | 'Seconds' | 'CountPerSecond' | 'BytesPerSecond' | 'Percent' | 'MilliSeconds' | 'ByteSeconds' | 'Unspecified' | 'Cores' | 'MilliCores' | 'NanoCores' | 'BitsPerSecond', required — The unit of the metric.
      - `timeseries` TimeSeriesElement[], required — The time series returned when a data query is performed.
        - `metadatavalues` MetadataValue[] — The metadata values returned if $filter was specified in the call.
          - `name` LocalizableString — The localizable string class.
            - `value` string, required — The invariant value.
            - `localizedValue` string — The display name.
          - `value` string — The value of the metadata.
        - `data` MetricValue[] — An array of data points representing the metric values. This is only returned if a result type of data is specified.
          - `timeStamp` string, date-time, required — The timestamp for the metric value in ISO 8601 format.
          - `average` number, double — The average value in the time range.
          - `minimum` number, double — The least value in the time range.
          - `maximum` number, double — The greatest value in the time range.
          - `total` number, double — The sum of all of the values in the time range.
          - `count` number, double — The number of samples in the time range. Can be used to determine the number of values that contributed to the average value.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/monitor-insights.md) · [All operations](https://skmtc.net/azure/apis/monitor-insights/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/monitor-insights/versions/af342767e7a8/schema)
