---
title: "Query user metrics"
method: POST
path: "/_fabric/{fabric}/_api/metrics/query"
tags: ["Administration"]
---

# Query user metrics

`POST /_fabric/{fabric}/_api/metrics/query`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/metrics/query/post.ts> (a function with typed inputs; its response is checked against the schema)

Query user metrics.

## Path parameters

- `fabric` string, string, required

## Request body

- PostMetricsQuery
  - `GeoFabric` string: GeoFabric name
  - `limit` integer: Number of results we want to receive.
  - `metrics` string[]: Array of strings containing the metric names we want to receive.
  - `querytype` string, required: - *list*: Returns a list of all available metrics - *get*: Returns all the requested metrics - *sum*: Returns sum of all records for each of the requested metrics.
  - `since` integer: Unix timestamp in milliseconds of oldest entry we want to receive.

## Response `200`

Sucessfully fetched metrics details.

- AdministrationApiQueryMetricsRc200
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `result` string: Returns metrics details.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed because you do not have administrator permissions.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find specified fabric.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
