Skip to main content
POST
cURL
Create a new metric and attach it to one or more deployments.
This endpoint is available only for API version 2025-12-01. Send the whitecircle-version: 2025-12-01 header.
To create a policy instead of a metric, use the /api/policy/create endpoint.

Authorizations

Authorization
string
header
required

API Key required. Format: Bearer wc-your-api-key

Headers

whitecircle-version
string
required

API Version

Body

application/json
name
string
required
flagged_content
string
required
allowed_content
string | null
applies_to
null | enum<string>
Available options:
input,
output,
any
Example:

"input"

content_type
null | enum<string>
Available options:
session,
artifact,
any
Example:

"session"

mode
null | enum<string>
Available options:
prod,
shadow
Example:

"prod"

deployment_ids
string[] | null
severity_level_id
string<uuid> | null
country_codes
string[] | null
rollout_percentage
integer<int32> | null

Response

Success

id
string
required
name
string
required
flagged_content
string
required
applies_to
enum<string>
required
Available options:
input,
output,
any
Example:

"input"

content_type
enum<string>
required
Available options:
session,
artifact,
any
Example:

"session"

mode
enum<string>
required
Available options:
prod,
shadow
Example:

"prod"

deployment_ids
string[]
required
country_codes
string[]
required
rollout_percentage
integer<int32>
required
Required range: x >= 0
revision_id
string
required
created_at
string<date-time>
required
allowed_content
string | null
severity_level_id
string<uuid> | null
deleted_at
string<date-time> | null