---
title: "Run metrics queries"
method: POST
path: "/v1/metricsQueries"
tags: ["metricsQuery"]
---

# Run metrics queries

`POST /v1/metricsQueries`

Execute multiple metrics queries. Limits of this API are described in [Metrics Query Error Messages](https://help.sumologic.com/docs/metrics/metrics-queries/metric-query-error-messages/). For general information about Metrics Queries see [Metrics Queries](https://help.sumologic.com/docs/metrics/metrics-queries/).

## Request body

- MetricsQueryRequest — A list of metrics queries to run along with the time range for the query.
  - `queries` MetricsQueryRow[], required — A list of metrics queries.
    - `rowId` string, required — Row id for the query row, A to Z letter.
    - `query` string, required — A metric query consists of a metric, one or more filters and optionally, one or more [Metrics Operators](https://help.sumologic.com/?cid=10144). Strictly speaking, both filters and operators are optional. Most of the [Metrics Operators](https://help.sumologic.com/?cid=10144) are allowed in the query string except `fillmissing`, `outlier`, `quantize` and `timeshift`. * `fillmissing`: Not supported in API. * `outlier`: Not supported in API. * `quantize`: Only supported through `quantization` param. * `timeshift`: Only supported through `timeshift` param. In practice, your metric queries will almost always contain filters that narrow the scope of your query. For more information about the query language see [Metrics Queries](https://help.sumologic.com/?cid=1079).
    - `quantization` integer — Segregates time series data by time period. This allows you to create aggregated results in buckets of fixed intervals (for example, 5-minute intervals). The value is in milliseconds.
    - `rollup` string — We use the term rollup to refer to the aggregation function Sumo Logic uses when quantizing metrics. Can be `Avg`, `Sum`, `Min`, `Max`, `Count` or `None`.
    - `timeshift` integer — Shifts the time series from your metrics query by the specified amount of time. This can help when comparing a time series across multiple time periods. Specified as a signed duration in milliseconds.
  - `timeRange` ResolvableTimeRange, required
    - `type` string, required — Type of the time range. Value must be either `CompleteLiteralTimeRange` or `BeginBoundedTimeRange`.

## Response `200`

A set of time series grouped by the query.

- MetricsQueryResponse
  - `queryResult` TimeSeriesRow[] — A list of the time series returned by metric query.
    - `rowId` string, required — Row id for the query row as specified in the request.
    - `timeSeriesList` TimeSeriesList, required
      - `timeSeries` TimeSeries[], required — A list of timeseries returned by corresponding query.
        - `metricDefinition` MetricDefinition, required
          - `metric` string — Name of the metric returning the timeseries.
          - `dimensions` object — Metric dimensions / metadata related to each timeseries.
        - `points` Points, required — The `values` and `timestamps` are of the same length, and points are sorted by time ascending.
          - `timestamps` integer[], required — Array of timestamps of datapoints in milliseconds.
          - `values` number[], required — Array of values of datapoints corresponding to timestamp array.
      - `unit` string — Unit of the query.
      - `timeShiftLabel` string — Time shift value if specified in request in human readable format.
      - `resultContext` MetricsQueryResultContext
        - `quantizationGranularity` integer — Quantization granularity. Size of the quantization bucket/quant in milliseconds.
        - `rollup` string — We use the term rollup to refer to the aggregation function Sumo Logic uses when quantizing metrics. Can be `Avg`, `Sum`, `Min`, `Max`, `Count` or `Rate`.
        - `actualQueryTimeRange` Iso8601TimeRange — A simple time range class, where the start and end points are specified in UTC in [RFC3339](https://tools.ietf.org/html/rfc3339) format
          - `start` string, date-time, required — Start time in UTC in [RFC3339](https://tools.ietf.org/html/rfc3339) format
          - `end` string, date-time, required — End time in UTC in [RFC3339](https://tools.ietf.org/html/rfc3339) format
  - `errors` ErrorResponse, required
    - `id` string, required — An identifier for the error; this is unique to the specific API request.
    - `errors` ErrorDescription[], required — A list of one or more causes of the error.
      - `code` string, required — An error code describing the type of error.
      - `message` string, required — A short English-language description of the error.
      - `detail` string — An optional fuller English-language description of the error.
      - `meta` object — An optional list of metadata about the error.

## Other responses

- `default` — Operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/revisions/e4e4c7554890/schema)
