---
title: "Send metrics in bulk"
method: POST
path: "/api/client/metrics/bulk"
tags: ["Unleash Edge"]
---

# Send metrics in bulk

`POST /api/client/metrics/bulk`

This operation accepts batched metrics from any client. Metrics will be inserted into Unleash's metrics storage

## Request body

- BulkMetricsSchema — A batch of metrics accumulated by Edge (or other compatible applications). Includes both application registrations as well usage metrics from clients
  - `applications` BulkRegistrationSchema[], required — A list of applications registered by an Unleash SDK
    - `connectVia` object[] — A list of applications this app registration has been registered through. If connected directly to Unleash, this is an empty list. This can be used in later visualizations to tell how many levels of proxy or Edge instances our SDKs have connected through
      - `appName` string, required
      - `instanceId` string, required
    - `appName` string, required — The name of the application that is evaluating toggles
    - `environment` string, required — Which environment the application is running in
    - `instanceId` string, required — A [(somewhat) unique identifier](https://docs.getunleash.io/sdks/node#advanced-usage) for the application
    - `interval` number — How often (in seconds) the application refreshes its features
    - `started` union — 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).
    - `strategies` string[] — Enabled [strategies](https://docs.getunleash.io/concepts/activation-strategies) in the application
    - `projects` string[] — The list of projects used in the application
    - `sdkVersion` string — The version the sdk is running. Typically <client>:<version>
    - `sdkType` 'frontend' | 'backend' | 'null', nullable — The sdk type
  - `metrics` ClientMetricsEnvSchema[], required — a list of client usage metrics registered by downstream providers. (Typically Unleash Edge)
    - `featureName` string, required — Name of the feature checked by the SDK
    - `appName` string, required — The name of the application the SDK is being used in
    - `environment` string, required — Which environment the SDK is being used in
    - `timestamp` union — 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).
    - `yes` integer — How many times the toggle evaluated to true
    - `no` integer — How many times the toggle evaluated to false
    - `variants` object — How many times each variant was returned
  - `impactMetrics` ImpactMetricsSchema[] — a list of custom impact metrics registered by downstream providers. (Typically Unleash Edge)
    - union — Used for reporting impact metrics from SDKs
      - object
        - `name` string, required — Name of the impact metric
        - `help` string, required — Human-readable description of what the metric measures
        - `type` 'counter' | 'gauge', required — Type of the metric
        - `samples` object[], required — Samples of the numeric metric
          - `value` number, required — The value of the metric sample
          - `labels` object — Optional labels for the metric sample
      - object
        - `name` string, required — Name of the impact metric
        - `help` string, required — Human-readable description of what the metric measures
        - `type` 'histogram', required — Type of the metric
        - `samples` object[], required — Samples of the histogram metric
          - `count` number, required — Total count of observations
          - `sum` number, required — Sum of all observed values
          - `buckets` object[], required — Histogram buckets
            - `le` union, required — Upper bound of the bucket
              - …
            - `count` number, required — Count of observations in this bucket
          - `labels` object — Optional labels for the metric sample
  - `seenTokens` string[] — A list of API tokens observed by downstream providers. (Typically Unleash Edge)

## Response `202`

This response has no body.

## Other responses

- `400` — The request data does not match what we expect.
- `413` — The request body is larger than what we accept. By default we only accept bodies of 100kB or less
- `415` — The operation does not support request payloads of the provided type. Please ensure that you're using one of the listed payload types and that you have specified the right content type in the "content-type" header.

---

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