post https://a.klaviyo.com/api/custom-metrics
Create a new custom metric.
Custom metric objects must include a name
and definition
.
Rate limits:
Burst: 1/s
Steady: 15/m
Daily: 15/d
Scopes:
metrics:write
Responses
Create a new custom metric.
Custom metric objects must include a name
and definition
.
Rate limits:
Burst: 1/s
Steady: 15/m
Daily: 15/d
Scopes:
metrics:write
xxxxxxxxxx
18curl --request POST \
--url https://a.klaviyo.com/api/custom-metrics \
--header 'Authorization: Klaviyo-API-Key your-private-api-key' \
--header 'accept: application/vnd.api+json' \
--header 'content-type: application/vnd.api+json' \
--header 'revision: 2025-04-15' \
--data '
{
"data": {
"type": "custom-metric",
"attributes": {
"definition": {
"aggregation_method": "count"
}
}
}
}
'
xxxxxxxxxx
77}
{
"data": {
"type": "custom-metric",
"id": "925e385b52fb405715f3616c337cc65c",
"attributes": {
"name": "My custom metric",
"created": "2025-04-15T00:00:00Z",
"updated": "2025-04-15T00:00:00Z",
"definition": {
"aggregation_method": "value",
"metric_groups": [
{
"metric_id": "AAAAAA",
"metric_filters": [
{
"property": "my_string_property",
"filter": {
"type": "string",
"operator": "starts-with",
"value": "some_substring"
}
},
{
"property": "my_numeric_property",
"filter": {