---
title: "Register client usage metrics"
method: POST
path: "/api/client/metrics"
tags: ["Client"]
---

# Register client usage metrics

`POST /api/client/metrics`

Registers usage metrics. Stores information about how many times each flag was evaluated to enabled and disabled within a time frame. If provided, this operation will also store data on how many times each feature flag's variants were displayed to the end user.

## Request body

- ClientMetricsSchema — Client usage metrics, accumulated in buckets of hour by hour by default
  - `appName` string, required — The name of the application that is evaluating toggles
  - `instanceId` string — A [(somewhat) unique identifier](https://docs.getunleash.io/sdks/node#advanced-usage) for the application
  - `sdkVersion` string — An SDK version identifier. Usually formatted as "unleash-client-<language>:<version>"
  - `platformName` string — The platform the application is running on. For languages that compile to binaries, this can be omitted
  - `platformVersion` string — The version of the platform the application is running on. Languages that compile to binaries, this is expected to be the compiler version used to assemble the binary.
  - `yggdrasilVersion` string — The semantic version of the Yggdrasil engine used by the client. If the client is using a native engine this can be omitted.
  - `specVersion` string — The version of the Unleash client specification the client supports
  - `sdkFlavor` string — The identifier of an integration built on top of an Unleash SDK (e.g. an OpenFeature provider). Sent so adoption of the integration can be tracked alongside sdkVersion.
  - `sdkFlavorVersion` string — The version of the integration identified by sdk flavor, that has been built on top of an Unleash SDK
  - `bucket` object, nullable — Holds all metrics gathered over a window of time. Typically 1 hour wide. May be omitted or null when the request only carries impact metrics.
    - `start` union, required — A representation of a date. Either as a date-time string or as a UNIX timestamp.
      - string, date-time — An [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339.html)-compliant timestamp.
      - integer — A [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time).
    - `stop` union, required — A representation of a date. Either as a date-time string or as a UNIX timestamp.
      - string, date-time — An [RFC-3339](https://www.rfc-editor.org/rfc/rfc3339.html)-compliant timestamp.
      - integer — A [UNIX timestamp](https://en.wikipedia.org/wiki/Unix_time).
    - `toggles` object, required — an object containing feature names with yes/no plus variant usage

## Response `202`

This response has no body.

## Other responses

- `204` — This response has no body.
- `400` — The request data does not match what we expect.

---

[API](https://skmtc.net/unleash/apis/unleash-api-2.md) · [All operations](https://skmtc.net/unleash/apis/unleash-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/unleash/unleash-api-2/versions/3ead4e02c359/schema)
