Skip to main content
POST
Create a new metric

Authorizations

Authorization
string
header
required

JWT authentication for organization-scoped endpoints.

Path Parameters

orgId
string
required

Organization ID

workspaceId
string
required

Workspace ID

Body

application/json

Request schema for creating a metric

title
string
required

Display name for the metric

Example:

"Daily Active Users"

ownerId
string
required
description
string

Detailed description of the metric

Example:

"Number of unique users who performed any action in the last 24 hours"

unit
string

Unit of measurement for the metric

Example:

"users"

type
enum<string>
default:custom

Category/type of the metric

Available options:
engagement,
conversion,
revenue,
nps,
csat,
ces,
ratio,
custom
targetOperator
enum<string>

Comparison operator for the target

Available options:
greater_than,
less_than,
equal_to
targetValue
number

Target value to achieve

Example:

100

targetDirection
enum<string>
default:up

Direction of improvement (up = higher is better, down = lower is better)

Available options:
up,
down
currentValue
number

Current value of the metric

Example:

150

previousValue
number

Previous value of the metric for comparison

Example:

140

periodType
enum<string>

Type of period for metric comparison

Available options:
rolling,
calendar
Example:

"calendar"

periodValue
enum<string>

Specific period value for metric comparison

Available options:
day,
week,
month,
quarter,
year,
7-day,
30-day,
90-day
Example:

"month"

timeseries
object[]

Historical values for trend analysis

Related outcomes that use this metric

id
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
outcomeIds
string[]

Array of outcome IDs to associate with this metric

Example:

Response

Success

Response containing a single metric

data
object
required

Metric data representing a measurable KPI result