---
title: "Create a new metric prototype for the request account"
method: POST
path: "/metric-prototypes"
tags: ["metric-prototypes"]
---

# Create a new metric prototype for the request account

`POST /metric-prototypes`

Creates a new metric prototype and returns the definition

## Request body

- MetricPrototypePost — The configurable attributes of a metric prototype
  - `default_frequency` integer — Frequency at which the value of the metrics will be populated in timeseries
  - `default_name` string, required
  - `description` string — Description about the metric prototype
  - `display` string — Display name of the metric prototype. If not provided it will be populated from the default name.
  - `expression` string, required — Computation query to calculate the value of the metric
  - `filter` union
    - string — String predicate expression involving log attributes for the specified log type
    - unknown
  - `group_by` string — An string attribute name for the specified log type that specify grouping
  - `log_type` 'cdn-logs' | 'csp-reports' | 'pageviews' | 'proxy-logs', required — The type of logs from which the metric values need to be fetched

## Response `200`

The metric prototype was successfully created

- MetricPrototype — State values for metric prototype
  - `default_frequency` integer — Frequency at which the value of the metrics will be populated in timeseries
  - `default_name` string
  - `description` string — Description about the metric prototype
  - `display` string — Display name of the metric prototype. If not provided it will be populated from the default name.
  - `expression` string — Computation query to calculate the value of the metric
  - `filter` union
    - string — String predicate expression involving log attributes for the specified log type
    - unknown
  - `group_by` string — An string attribute name for the specified log type that specify grouping
  - `log_type` 'cdn-logs' | 'csp-reports' | 'pageviews' | 'proxy-logs' — The type of logs from which the metric values need to be fetched
  - `href` string — A reference to this metric prototype
  - `created` string — An iso8601 formatted timestamp
  - `created_by` integer — Reference to the user that created this metric prototype

---

[API](https://skmtc.dev/webscale/apis/webscale-apis.md) · [All operations](https://skmtc.dev/webscale/apis/webscale-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/webscale/webscale-apis/revisions/c98d872b50cb/schema)
