openapi: 3.0.2
info:
title: Klaviyo Accounts Metrics API
version: '2026-04-15'
description: The Klaviyo REST API. Please visit https://developers.klaviyo.com for more details.
contact:
name: Klaviyo Developer Experience Team
email: developers@klaviyo.com
url: https://developers.klaviyo.com
termsOfService: https://www.klaviyo.com/legal/api-terms
license:
name: License
url: https://www.klaviyo.com/legal
servers:
- url: https://a.klaviyo.com
description: Production
security:
- Klaviyo-API-Key: []
tags:
- name: Metrics
description: metrics
paths:
/api/metrics:
get:
operationId: get_metrics
summary: Get Metrics
description: 'Get all metrics in an account.
Requests can be filtered by the following fields:
integration `name`, integration `category`
Returns a maximum of 200 results per page.
*Rate limits*:
Burst: `10/s`
Steady: `150/m`
**Scopes:**
`metrics:read`'
parameters:
- name: fields[flow]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- archived
- created
- name
- status
- trigger_type
- updated
explode: false
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: filter
in: query
description: 'For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#filtering
Allowed field(s)/operator(s):
`integration.name`: `equals`
`integration.category`: `equals`'
schema:
type: string
example: equals(integration.name,'example')
- name: include
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
schema:
type: array
items:
type: string
enum:
- flow-triggers
explode: false
- name: page[cursor]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#pagination
required: false
schema:
type: string
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricResponseCollectionCompoundDocument'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 10/s
steady: 150/m
x-klaviyo-scopes:
- metrics:read
/api/metrics/{id}:
get:
operationId: get_metric
summary: Get Metric
description: 'Get a metric with the given metric ID.
*Rate limits*:
Burst: `10/s`
Steady: `150/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: Metric ID
required: true
schema:
description: Metric ID
type: string
- name: fields[flow]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- archived
- created
- name
- status
- trigger_type
- updated
explode: false
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: include
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
schema:
type: array
items:
type: string
enum:
- flow-triggers
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricResponseCompoundDocument'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 10/s
steady: 150/m
x-klaviyo-scopes:
- metrics:read
/api/metric-properties/{id}:
get:
operationId: get_metric_property
summary: Get Metric Property
description: 'Get a metric property with the given metric property ID.
*Rate limits*:
Burst: `1/s`
Steady: `15/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the metric property
required: true
schema:
description: The ID of the metric property
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: additional-fields[metric-property]
in: query
description: 'Request additional fields not included by default in the response. Supported values: ''sample_values'''
required: false
schema:
type: array
items:
type: string
enum:
- sample_values
explode: false
- name: fields[metric-property]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- inferred_type
- label
- property
- sample_values
explode: false
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: include
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
schema:
type: array
items:
type: string
enum:
- metric
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricPropertyResponseCompoundDocument'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
x-klaviyo-scopes:
- metrics:read
/api/custom-metrics:
get:
operationId: get_custom_metrics
summary: Get Custom Metrics
description: 'Get all custom metrics in an account.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: fields[custom-metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- definition
- definition.aggregation_method
- definition.metric_groups
- name
- updated
explode: false
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: include
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
schema:
type: array
items:
type: string
enum:
- metrics
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetCustomMetricResponseCollectionCompoundDocument'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Custom Metrics
post:
operationId: create_custom_metric
summary: Create Custom Metric
description: '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`'
parameters:
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
requestBody:
description: Create a custom metric.
required: true
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/CustomMetricCreateQuery'
responses:
'201':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/PostCustomMetricResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
daily: 15/d
x-klaviyo-scopes:
- metrics:write
x-klaviyo-subtag: Custom Metrics
/api/custom-metrics/{id}:
get:
operationId: get_custom_metric
summary: Get Custom Metric
description: 'Get a custom metric with the given custom metric ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the custom metric
required: true
schema:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: fields[custom-metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- definition
- definition.aggregation_method
- definition.metric_groups
- name
- updated
explode: false
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: include
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
schema:
type: array
items:
type: string
enum:
- metrics
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetCustomMetricResponseCompoundDocument'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Custom Metrics
patch:
operationId: update_custom_metric
summary: Update Custom Metric
description: 'Update a custom metric with the given custom metric ID.
*Rate limits*:
Burst: `1/s`
Steady: `15/m`
Daily: `15/d`
**Scopes:**
`metrics:write`'
parameters:
- name: id
in: path
description: The ID of the custom metric
required: true
schema:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
requestBody:
description: Update a custom metric by ID.
required: true
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/CustomMetricPartialUpdateQuery'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/PatchCustomMetricResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
daily: 15/d
x-klaviyo-scopes:
- metrics:write
x-klaviyo-subtag: Custom Metrics
delete:
operationId: delete_custom_metric
summary: Delete Custom Metric
description: 'Delete a custom metric with the given custom metric ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:write`'
parameters:
- name: id
in: path
description: The ID of the custom metric
required: true
schema:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'204':
description: Success
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:write
x-klaviyo-subtag: Custom Metrics
/api/mapped-metrics:
get:
operationId: get_mapped_metrics
summary: Get Mapped Metrics
description: 'Get all mapped metrics in an account.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: fields[custom-metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- definition
- definition.aggregation_method
- definition.metric_groups
- name
- updated
explode: false
- name: fields[mapped-metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- updated
explode: false
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: include
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
schema:
type: array
items:
type: string
enum:
- custom-metric
- metric
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMappedMetricResponseCollectionCompoundDocument'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Mapped Metrics
/api/mapped-metrics/{id}:
get:
operationId: get_mapped_metric
summary: Get Mapped Metric
description: 'Get the mapped metric with the given ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The type of mapping.
required: true
schema:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
- name: fields[custom-metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- definition
- definition.aggregation_method
- definition.metric_groups
- name
- updated
explode: false
- name: fields[mapped-metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- updated
explode: false
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: include
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#relationships
schema:
type: array
items:
type: string
enum:
- custom-metric
- metric
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMappedMetricResponseCompoundDocument'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Mapped Metrics
patch:
operationId: update_mapped_metric
summary: Update Mapped Metric
description: 'Update the mapped metric with the given ID.
*Rate limits*:
Burst: `1/s`
Steady: `15/m`
Daily: `30/d`
**Scopes:**
`metrics:write`'
parameters:
- name: id
in: path
description: The type of mapping.
required: true
schema:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
requestBody:
description: Update a mapped metric by ID
required: true
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/MappedMetricPartialUpdateQuery'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/PatchMappedMetricResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
daily: 30/d
x-klaviyo-scopes:
- metrics:write
x-klaviyo-subtag: Mapped Metrics
/api/metric-aggregates:
post:
operationId: query_metric_aggregates
summary: Query Metric Aggregates
description: 'Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific metrics, and custom events (not to be confused with [custom metrics](https://developers.klaviyo.com/en/reference/custom_metrics_api_overview), which are not supported at this time). Queries must be passed in the JSON body of your `POST` request.
To request campaign and flow performance data that matches the data shown in Klaviyo''s UI, we recommend the [Reporting API](https://developers.klaviyo.com/en/reference/reporting_api_overview).
Results can be filtered and grouped by time, event, or profile dimensions.
To learn more about how to use this endpoint, check out our new [Using the Query Metric Aggregates Endpoint guide](https://developers.klaviyo.com/en/docs/using-the-query-metric-aggregates-endpoint).
For a comprehensive list of request body parameters, native Klaviyo metrics, and their associated attributes for grouping and filtering, please refer to the [metrics attributes guide](https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes).
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
requestBody:
description: Retrieve Metric Aggregations
required: true
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/MetricAggregateQuery'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/PostMetricAggregateResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- create_metric_aggregate
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
/api/metrics/{id}/flow-triggers:
get:
operationId: get_flows_triggered_by_metric
summary: Get Flows Triggered by Metric
description: 'Get all flows where the given metric is being used as the trigger.
*Rate limits*:
Burst: `10/s`
Steady: `150/m`
**Scopes:**
`flows:read`
`metrics:read`'
parameters:
- name: id
in: path
description: ''
required: true
schema:
type: string
- name: fields[flow]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- archived
- created
- name
- status
- trigger_type
- updated
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetFlowResponseCollection'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_flow_triggers_for_metric
- get_metric_flow_triggers
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 10/s
steady: 150/m
x-klaviyo-scopes:
- flows:read
- metrics:read
/api/metrics/{id}/relationships/flow-triggers:
get:
operationId: get_ids_for_flows_triggered_by_metric
summary: Get IDs for Flows Triggered by Metric
description: 'Get the IDs of all flows where the given metric is being used as the trigger.
*Rate limits*:
Burst: `10/s`
Steady: `150/m`
**Scopes:**
`flows:read`
`metrics:read`'
parameters:
- name: id
in: path
description: ''
required: true
schema:
type: string
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricFlowTriggersRelationshipsResponseCollection'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_flow_trigger_ids_for_metric
- get_metric_relationships_flow_triggers
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 10/s
steady: 150/m
x-klaviyo-scopes:
- flows:read
- metrics:read
/api/metrics/{id}/metric-properties:
get:
operationId: get_properties_for_metric
summary: Get Properties for Metric
description: 'Get the metric properties for the given metric ID.
*Rate limits*:
Burst: `1/s`
Steady: `15/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the metric
required: true
schema:
description: The ID of the metric
type: string
example: 925e38
- name: additional-fields[metric-property]
in: query
description: 'Request additional fields not included by default in the response. Supported values: ''sample_values'''
required: false
schema:
type: array
items:
type: string
enum:
- sample_values
explode: false
- name: fields[metric-property]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- inferred_type
- label
- property
- sample_values
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricPropertyResponseCollection'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_metric_metric_properties
- get_metric_properties
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
x-klaviyo-scopes:
- metrics:read
/api/metrics/{id}/relationships/metric-properties:
get:
operationId: get_property_ids_for_metric
summary: Get Property IDs for Metric
description: 'Get the IDs of metric properties for the given metric.
*Rate limits*:
Burst: `1/s`
Steady: `15/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the metric
required: true
schema:
description: The ID of the metric
type: string
example: 925e38
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricPropertiesRelationshipsResponseCollection'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_metric_relationships_metric_properties
- get_metric_relationships_properties
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
x-klaviyo-scopes:
- metrics:read
/api/metric-properties/{id}/metric:
get:
operationId: get_metric_for_metric_property
summary: Get Metric for Metric Property
description: 'Get the metric for the given metric property ID.
*Rate limits*:
Burst: `1/s`
Steady: `15/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the metric property
required: true
schema:
description: The ID of the metric property
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_metric_property_metric
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
x-klaviyo-scopes:
- metrics:read
/api/metric-properties/{id}/relationships/metric:
get:
operationId: get_metric_id_for_metric_property
summary: Get Metric ID for Metric Property
description: 'Get the ID of the metric for the given metric property.
*Rate limits*:
Burst: `1/s`
Steady: `15/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the metric property
required: true
schema:
description: The ID of the metric property
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricPropertyMetricRelationshipResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_metric_property_relationships_metric
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 1/s
steady: 15/m
x-klaviyo-scopes:
- metrics:read
/api/custom-metrics/{id}/metrics:
get:
operationId: get_metrics_for_custom_metric
summary: Get Metrics for Custom Metric
description: 'Get all metrics for the given custom metric ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the custom metric
required: true
schema:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricResponseCollection'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_custom_metric_metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Custom Metrics
/api/custom-metrics/{id}/relationships/metrics:
get:
operationId: get_metric_ids_for_custom_metric
summary: Get Metric IDs for Custom Metric
description: 'Get all metrics for the given custom metric ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The ID of the custom metric
required: true
schema:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetCustomMetricMetricsRelationshipsResponseCollection'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_custom_metric_relationships_metrics
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Custom Metrics
/api/mapped-metrics/{id}/metric:
get:
operationId: get_metric_for_mapped_metric
summary: Get Metric for Mapped Metric
description: 'Get the metric for the given mapped metric ID (if applicable).
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The type of mapping.
required: true
schema:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
- name: fields[metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- integration
- name
- updated
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMetricResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_mapped_metric_metric
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Mapped Metrics
/api/mapped-metrics/{id}/relationships/metric:
get:
operationId: get_metric_id_for_mapped_metric
summary: Get Metric ID for Mapped Metric
description: 'Get the ID of the metric for the given mapped metric.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The type of mapping.
required: true
schema:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMappedMetricMetricRelationshipResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_mapped_metric_relationships_metric
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Mapped Metrics
/api/mapped-metrics/{id}/custom-metric:
get:
operationId: get_custom_metric_for_mapped_metric
summary: Get Custom Metric for Mapped Metric
description: 'Get the custom metric for the given mapped metric ID (if applicable).
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The type of mapping.
required: true
schema:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
- name: fields[custom-metric]
in: query
description: For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#sparse-fieldsets
required: false
schema:
type: array
items:
type: string
enum:
- created
- definition
- definition.aggregation_method
- definition.metric_groups
- name
- updated
explode: false
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetCustomMetricResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_mapped_metric_custom_metric
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Mapped Metrics
/api/mapped-metrics/{id}/relationships/custom-metric:
get:
operationId: get_custom_metric_id_for_mapped_metric
summary: Get Custom Metric ID for Mapped Metric
description: 'Get the ID of the custom metric for the given mapped metric.
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
**Scopes:**
`metrics:read`'
parameters:
- name: id
in: path
description: The type of mapping.
required: true
schema:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
- name: revision
in: header
description: 'API endpoint revision (format: YYYY-MM-DD[.suffix])'
required: true
schema:
type: string
default: '2026-04-15'
responses:
'200':
description: Success
content:
application/vnd.api+json:
schema:
$ref: '#/components/schemas/GetMappedMetricCustomMetricRelationshipResponse'
4XX:
$ref: '#/components/responses/ClientError'
5XX:
$ref: '#/components/responses/ServerError'
tags:
- Metrics
x-klaviyo-operation-aliases:
- get_mapped_metric_relationships_custom_metric
x-klaviyo-pre-release: None
x-klaviyo-ratelimit:
burst: 3/s
steady: 60/m
x-klaviyo-scopes:
- metrics:read
x-klaviyo-subtag: Mapped Metrics
components:
schemas:
GetCustomMetricResponseCollectionCompoundDocument:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/CustomMetricResponseObjectResource'
links:
$ref: '#/components/schemas/CollectionLinks'
included:
type: array
items:
$ref: '#/components/schemas/MetricResponseObjectResource'
required:
- data
GetMetricResponse:
type: object
properties:
data:
$ref: '#/components/schemas/MetricResponseObjectResource'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
CustomMetricDefinition:
type: object
properties:
aggregation_method:
description: 'Method of aggregation for custom metric measurements. If a metric has a `value` aggregation method, it will be treated as a revenue metric, such as a Placed Order metric. If a metric has a `count` aggregation method, it will only be able to report on conversions like an Active on Site metric.
'
type: string
enum:
- count
- value
metric_groups:
type: array
items:
$ref: '#/components/schemas/CustomMetricGroup'
required:
- aggregation_method
- metric_groups
FlowResponseObjectResource:
type: object
properties:
type:
$ref: '#/components/schemas/FlowEnum'
id:
type: string
attributes:
type: object
properties:
name:
type: string
nullable: true
status:
type: string
nullable: true
archived:
type: boolean
nullable: true
created:
type: string
format: date-time
example: '2022-11-08T00:00:00+00:00'
nullable: true
updated:
type: string
format: date-time
example: '2022-11-08T00:00:00+00:00'
nullable: true
trigger_type:
description: Corresponds to the object which triggered the flow.
type: string
enum:
- Added to List
- Date Based
- Low Inventory
- Metric
- Price Drop
- Unconfigured
nullable: true
relationships:
type: object
properties:
flow-actions:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/FlowActionEnum'
id:
type: string
links:
$ref: '#/components/schemas/RelationshipLinks'
tags:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/TagEnum'
id:
type: string
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
MetricPropertyEnum:
type: string
enum:
- metric-property
GetMappedMetricResponseCompoundDocument:
type: object
properties:
data:
$ref: '#/components/schemas/MappedMetricResponseObjectResource'
included:
type: array
items:
oneOf:
- $ref: '#/components/schemas/MetricResponseObjectResource'
- $ref: '#/components/schemas/CustomMetricResponseObjectResource'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
ExistenceOperatorExistenceFilter:
type: object
properties:
type:
type: string
enum:
- existence
operator:
description: Operators for existence filters.
type: string
enum:
- is-set
- not-set
required:
- type
- operator
MappedMetricEnum:
type: string
enum:
- mapped-metric
ListContainsOperatorListContainsFilter:
type: object
properties:
type:
type: string
enum:
- list
operator:
description: Operators for list contains filters.
type: string
enum:
- contains
- not-contains
value:
nullable: true
oneOf:
- type: integer
- type: string
required:
- type
- operator
- value
GetCustomMetricResponse:
type: object
properties:
data:
$ref: '#/components/schemas/CustomMetricResponseObjectResource'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
GetFlowResponseCollection:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/FlowResponseObjectResource'
links:
$ref: '#/components/schemas/CollectionLinks'
required:
- data
GetMappedMetricResponseCollectionCompoundDocument:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/MappedMetricResponseObjectResource'
links:
$ref: '#/components/schemas/CollectionLinks'
included:
type: array
items:
oneOf:
- $ref: '#/components/schemas/MetricResponseObjectResource'
- $ref: '#/components/schemas/CustomMetricResponseObjectResource'
required:
- data
CustomMetricPartialUpdateQuery:
type: object
properties:
data:
$ref: '#/components/schemas/CustomMetricPartialUpdateQueryResourceObject'
required:
- data
GetMetricPropertyResponseCompoundDocument:
type: object
properties:
data:
allOf:
- properties:
type:
$ref: '#/components/schemas/MetricPropertyEnum'
attributes:
properties:
sample_values:
type: array
items:
oneOf:
- type: integer
- type: number
- type: string
- type: boolean
nullable: true
- $ref: '#/components/schemas/MetricPropertyResponseObjectResource'
included:
type: array
items:
$ref: '#/components/schemas/MetricResponseObjectResource'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
PatchMappedMetricResponse:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MappedMetricEnum'
id:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
attributes:
type: object
properties:
updated:
description: The datetime when this mapping was last updated.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
required:
- updated
relationships:
type: object
properties:
metric:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: The ID of the metric for this mapping.
type: string
required:
- type
- id
links:
$ref: '#/components/schemas/RelationshipLinks'
custom-metric:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric for this mapping.
type: string
required:
- type
- id
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
MetricAggregateQueryResourceObject:
type: object
properties:
type:
$ref: '#/components/schemas/MetricAggregateEnum'
attributes:
type: object
properties:
metric_id:
description: The metric ID used in the aggregation.
type: string
example: 0rG4eQ
page_cursor:
description: Optional pagination cursor to iterate over large result sets
type: string
measurements:
description: Measurement key, e.g. `unique`, `sum_value`, `count`
type: array
items:
type: string
enum:
- count
- sum_value
- unique
description: Supported measurements for aggregation
example:
- count
interval:
description: Aggregation interval, e.g. "hour", "day", "week", "month"
type: string
example: day
default: day
enum:
- day
- hour
- month
- week
nullable: true
page_size:
description: Alter the maximum number of returned rows in a single page of aggregation results
type: integer
example: 500
default: 500
nullable: true
by:
description: Optional attribute(s) used for partitioning by the aggregation function
type: array
items:
type: string
enum:
- $attributed_channel
- $attributed_flow
- $attributed_message
- $attributed_variation
- $campaign_channel
- $flow
- $flow_channel
- $message
- $message_send_cohort
- $usage_amount
- $value_currency
- $variation
- $variation_send_cohort
- Bot Click
- Bounce Type
- Campaign Name
- Client Canonical
- Client Name
- Client Type
- Email Domain
- Failure Source
- Failure Type
- From Number
- From Phone Region
- Inbox Provider
- List
- Message Name
- Message Type
- Method
- Segment Count
- Subject
- To Number
- To Phone Region
- URL
- form_id
description: "Supported dimensions for grouping and filtering.\n\nIf adding a new dimension, the following will also need to be updated:\n - adding the key in keys.py\n - adding an AppMetricDimension to library.py\n - adding a new entry to the dict in the __init__ method of StaticSchema using the key from keys.py and the\n AppMetricDimension from library.py"
example:
- $message
nullable: true
return_fields:
description: Provide fields to limit the returned data
type: array
items:
type: string
nullable: true
filter:
description: "List of filters, must include time range using ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm).\n These filters follow a similar format to those in `GET` requests, the primary difference is that this endpoint asks for a list.\n The time range can be filtered by providing a `greater-or-equal` and a `less-than` filter on the `datetime` field."
type: array
items:
type: string
example:
- greater-or-equal(datetime,2022-12-01T00:00:00)
- less-than(datetime,2022-12-08T00:00:00
timezone:
description: "The timezone used for processing the query, e.g. `'America/New_York'`.\n This field is validated against a list of common timezones from the [IANA Time Zone Database](https://www.iana.org/time-zones).\n While most are supported, a few notable exceptions are `Factory`, `Europe/Kyiv` and `Pacific/Kanton`. This field is case-sensitive."
type: string
example: America/New_York
default: UTC
nullable: true
sort:
description: Provide a sort key (e.g. -$message)
type: string
enum:
- $attributed_channel
- -$attributed_channel
- $attributed_flow
- -$attributed_flow
- $attributed_message
- -$attributed_message
- $attributed_variation
- -$attributed_variation
- $campaign_channel
- -$campaign_channel
- $flow
- -$flow
- $flow_channel
- -$flow_channel
- $message
- -$message
- $message_send_cohort
- -$message_send_cohort
- $usage_amount
- -$usage_amount
- $value_currency
- -$value_currency
- $variation
- -$variation
- $variation_send_cohort
- -$variation_send_cohort
- Bot Click
- -Bot Click
- Bounce Type
- -Bounce Type
- Campaign Name
- -Campaign Name
- Client Canonical
- -Client Canonical
- Client Name
- -Client Name
- Client Type
- -Client Type
- Email Domain
- -Email Domain
- Failure Source
- -Failure Source
- Failure Type
- -Failure Type
- From Number
- -From Number
- From Phone Region
- -From Phone Region
- Inbox Provider
- -Inbox Provider
- List
- -List
- Message Name
- -Message Name
- Message Type
- -Message Type
- Method
- -Method
- Segment Count
- -Segment Count
- Subject
- -Subject
- To Number
- -To Number
- To Phone Region
- -To Phone Region
- URL
- -URL
- count
- -count
- form_id
- -form_id
- sum_value
- -sum_value
- unique
- -unique
required:
- metric_id
- measurements
- filter
required:
- type
- attributes
StringOperatorStringFilter:
type: object
properties:
type:
type: string
enum:
- string
operator:
description: Operators for string filters.
type: string
enum:
- contains
- ends-with
- equals
- not-contains
- not-ends-with
- not-equals
- not-starts-with
- nregex
- regex
- starts-with
value:
type: string
nullable: true
required:
- type
- operator
- value
CustomMetricGroup:
type: object
properties:
metric_id:
description: The ID of the metric that composes the custom metric.
type: string
metric_filters:
description: An optional array of objects for filtering on properties of the metric.
type: array
items:
$ref: '#/components/schemas/CustomMetricCondition'
nullable: true
value_property:
description: '
If the custom metric has a `value` aggregation method, the `value_property` of each `metric_group` of the `definition` should specify the property to calculate the conversion value. If null, the default `$value` property will be used.
'
type: string
nullable: true
required:
- metric_id
PatchCustomMetricResponse:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
attributes:
type: object
properties:
name:
description: The name for this custom metric. Names must be unique across the account. Attempting to create a metric with a duplicate name will return a 400 status code.
type: string
example: My custom metric
created:
description: The datetime when this custom metric was created.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
updated:
description: The datetime when this custom metric was updated.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
definition:
description: The definition of a custom metric. It is composed of a list of `metric_groups`. Each group specifies how to query a particular metric with customized filters and the value property to calculate conversion value measurements (if applicable). The groups are combined with `AND` relationships, i.e., conversion and conversion value measurements for each group will be added together to get the final result.
example:
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:
type: numeric
operator: greater-than-or-equal
value: 999
value_property: $value
- metric_id: BBBBBB
metric_filters:
- property: my_boolean_property
filter:
type: boolean
operator: equals
value: false
- property: my_list_property
filter:
type: list
operator: contains
value: some_value_in_a_list
value_property: my_numeric_property
$ref: '#/components/schemas/CustomMetricDefinition'
required:
- name
- created
- updated
- definition
relationships:
type: object
properties:
metrics:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: Related metrics
type: string
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
GetMetricFlowTriggersRelationshipsResponseCollection:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/FlowEnum'
id:
type: string
links:
$ref: '#/components/schemas/CollectionLinks'
required:
- data
CustomMetricEnum:
type: string
enum:
- custom-metric
ListRegexOperatorListContainsFilter:
type: object
properties:
type:
type: string
enum:
- list
operator:
description: Operators for list regex filters.
type: string
enum:
- contains-ends-with
- contains-starts-with
- not-contains-ends-with
- not-contains-starts-with
value:
nullable: true
oneOf:
- type: integer
- type: string
required:
- type
- operator
- value
GetMetricPropertiesRelationshipsResponseCollection:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/MetricPropertyEnum'
id:
description: The ID of the metric property
type: string
example: 925e385b52fb405715f3616c337cc65c
links:
$ref: '#/components/schemas/CollectionLinks'
required:
- data
GetMetricPropertyMetricRelationshipResponse:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: The Metric ID
type: string
required:
- type
- id
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
MetricAggregateEnum:
type: string
enum:
- metric-aggregate
GetMappedMetricCustomMetricRelationshipResponse:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
required:
- type
- id
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
FlowEnum:
type: string
enum:
- flow
CustomMetricPartialUpdateQueryResourceObject:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
attributes:
type: object
properties:
name:
description: The name for this custom metric. Names must be unique across the account. Attempting to create a metric with a duplicate name will return a 400 status code.
type: string
example: My custom metric
nullable: true
definition:
description: The definition of a custom metric. It is composed of a list of `metric_groups`. Each group specifies how to query a particular metric with customized filters and the value property to calculate conversion value measurements (if applicable). The groups are combined with `AND` relationships, i.e., conversion and conversion value measurements for each group will be added together to get the final result.
example:
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:
type: numeric
operator: greater-than-or-equal
value: 999
value_property: $value
- metric_id: BBBBBB
metric_filters:
- property: my_boolean_property
filter:
type: boolean
operator: equals
value: false
- property: my_list_property
filter:
type: list
operator: contains
value: some_value_in_a_list
value_property: my_numeric_property
$ref: '#/components/schemas/CustomMetricDefinition'
nullable: true
required:
- type
- id
- attributes
MetricResponseObjectResource:
type: object
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: The Metric ID
type: string
attributes:
type: object
properties:
name:
description: The name of the metric
type: string
nullable: true
created:
description: Creation time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)
type: string
nullable: true
updated:
description: Last updated time in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm)
type: string
nullable: true
integration:
description: The integration associated with the event
type: object
nullable: true
relationships:
type: object
properties:
flow-triggers:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/FlowEnum'
id:
type: string
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
MetricAggregateQuery:
type: object
properties:
data:
$ref: '#/components/schemas/MetricAggregateQueryResourceObject'
required:
- data
BooleanFilter:
type: object
properties:
type:
type: string
enum:
- boolean
operator:
description: Operators for boolean filters.
type: string
enum:
- equals
value:
type: boolean
required:
- type
- operator
- value
CustomMetricCreateQuery:
type: object
properties:
data:
$ref: '#/components/schemas/CustomMetricCreateQueryResourceObject'
required:
- data
MetricEnum:
type: string
enum:
- metric
GetCustomMetricMetricsRelationshipsResponseCollection:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: The Metric ID
type: string
links:
$ref: '#/components/schemas/CollectionLinks'
required:
- data
PostCustomMetricResponse:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
attributes:
type: object
properties:
name:
description: The name for this custom metric. Names must be unique across the account. Attempting to create a metric with a duplicate name will return a 400 status code.
type: string
example: My custom metric
created:
description: The datetime when this custom metric was created.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
updated:
description: The datetime when this custom metric was updated.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
definition:
description: The definition of a custom metric. It is composed of a list of `metric_groups`. Each group specifies how to query a particular metric with customized filters and the value property to calculate conversion value measurements (if applicable). The groups are combined with `AND` relationships, i.e., conversion and conversion value measurements for each group will be added together to get the final result.
example:
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:
type: numeric
operator: greater-than-or-equal
value: 999
value_property: $value
- metric_id: BBBBBB
metric_filters:
- property: my_boolean_property
filter:
type: boolean
operator: equals
value: false
- property: my_list_property
filter:
type: list
operator: contains
value: some_value_in_a_list
value_property: my_numeric_property
$ref: '#/components/schemas/CustomMetricDefinition'
required:
- name
- created
- updated
- definition
relationships:
type: object
properties:
metrics:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: Related metrics
type: string
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
GetMetricResponseCompoundDocument:
type: object
properties:
data:
$ref: '#/components/schemas/MetricResponseObjectResource'
included:
type: array
items:
$ref: '#/components/schemas/FlowResponseObjectResource'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
StringInArrayFilter:
type: object
properties:
operator:
type: string
enum:
- in
value:
type: array
items:
type: string
type:
type: string
enum:
- string
required:
- operator
- value
- type
GetCustomMetricResponseCompoundDocument:
type: object
properties:
data:
$ref: '#/components/schemas/CustomMetricResponseObjectResource'
included:
type: array
items:
$ref: '#/components/schemas/MetricResponseObjectResource'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
MappedMetricPartialUpdateQueryResourceObject:
type: object
properties:
type:
$ref: '#/components/schemas/MappedMetricEnum'
id:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
relationships:
type: object
properties:
metric:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: The ID of the metric for this mapping. A null value will unset the mapping.
type: string
required:
- type
- id
custom-metric:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric for this mapping. A null value will unset the mapping.
type: string
required:
- type
- id
required:
- type
- id
ListSubstringFilter:
type: object
properties:
type:
type: string
enum:
- list
operator:
description: Operators for list substring filters.
type: string
enum:
- contains-substring
- not-contains-substring
value:
type: string
nullable: true
required:
- type
- operator
- value
ObjectLinks:
type: object
properties:
self:
type: string
format: uri
required:
- self
MappedMetricPartialUpdateQuery:
type: object
properties:
data:
$ref: '#/components/schemas/MappedMetricPartialUpdateQueryResourceObject'
required:
- data
NumericOperatorNumericFilter:
type: object
properties:
type:
type: string
enum:
- numeric
operator:
description: Operators for numeric filters.
type: string
enum:
- equals
- greater-than
- greater-than-or-equal
- less-than
- less-than-or-equal
- not-equals
value:
oneOf:
- type: integer
- type: number
required:
- type
- operator
- value
CollectionLinks:
type: object
properties:
self:
type: string
format: uri
first:
type: string
format: uri
last:
type: string
format: uri
prev:
type: string
format: uri
next:
type: string
format: uri
required:
- self
FlowActionEnum:
type: string
enum:
- flow-action
CustomMetricCondition:
type: object
properties:
property:
type: string
filter:
oneOf:
- $ref: '#/components/schemas/NumericOperatorNumericFilter'
- $ref: '#/components/schemas/StringInArrayFilter'
- $ref: '#/components/schemas/ExistenceOperatorExistenceFilter'
- $ref: '#/components/schemas/BooleanFilter'
- $ref: '#/components/schemas/StringOperatorStringFilter'
- $ref: '#/components/schemas/ListContainsOperatorListContainsFilter'
- $ref: '#/components/schemas/ListRegexOperatorListContainsFilter'
- $ref: '#/components/schemas/ListSubstringFilter'
required:
- property
- filter
CustomMetricResponseObjectResource:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric
type: string
example: 925e385b52fb405715f3616c337cc65c
attributes:
type: object
properties:
name:
description: The name for this custom metric. Names must be unique across the account. Attempting to create a metric with a duplicate name will return a 400 status code.
type: string
example: My custom metric
created:
description: The datetime when this custom metric was created.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
updated:
description: The datetime when this custom metric was updated.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
definition:
description: The definition of a custom metric. It is composed of a list of `metric_groups`. Each group specifies how to query a particular metric with customized filters and the value property to calculate conversion value measurements (if applicable). The groups are combined with `AND` relationships, i.e., conversion and conversion value measurements for each group will be added together to get the final result.
example:
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:
type: numeric
operator: greater-than-or-equal
value: 999
value_property: $value
- metric_id: BBBBBB
metric_filters:
- property: my_boolean_property
filter:
type: boolean
operator: equals
value: false
- property: my_list_property
filter:
type: list
operator: contains
value: some_value_in_a_list
value_property: my_numeric_property
$ref: '#/components/schemas/CustomMetricDefinition'
required:
- name
- created
- updated
- definition
relationships:
type: object
properties:
metrics:
type: object
properties:
data:
type: array
items:
type: object
required:
- type
- id
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: Related metrics
type: string
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
MetricAggregateRowDTO:
type: object
properties:
dimensions:
description: List of dimensions associated with this set of measurements
type: array
items:
type: string
measurements:
description: Dictionary of measurement_key, values
type: object
required:
- dimensions
- measurements
PostMetricAggregateResponse:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MetricAggregateEnum'
id:
description: Ephemeral ID associated with the aggregation query
type: string
attributes:
type: object
properties:
dates:
description: The dates of the query range
type: array
items:
type: string
format: date-time
data:
description: Aggregation result data
type: array
items:
$ref: '#/components/schemas/MetricAggregateRowDTO'
required:
- dates
- data
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
GetMetricResponseCollectionCompoundDocument:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/MetricResponseObjectResource'
links:
$ref: '#/components/schemas/CollectionLinks'
included:
type: array
items:
$ref: '#/components/schemas/FlowResponseObjectResource'
required:
- data
TagEnum:
type: string
enum:
- tag
MappedMetricResponseObjectResource:
type: object
properties:
type:
$ref: '#/components/schemas/MappedMetricEnum'
id:
description: The type of mapping.
type: string
example: revenue
enum:
- added_to_cart
- cancelled_sales
- ordered_product
- refunded_sales
- revenue
- started_checkout
- viewed_product
attributes:
type: object
properties:
updated:
description: The datetime when this mapping was last updated.
type: string
format: date-time
example: '2025-04-15T00:00:00Z'
required:
- updated
relationships:
type: object
properties:
metric:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: The ID of the metric for this mapping.
type: string
required:
- type
- id
links:
$ref: '#/components/schemas/RelationshipLinks'
custom-metric:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
id:
description: The ID of the custom metric for this mapping.
type: string
required:
- type
- id
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
GetMetricResponseCollection:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/MetricResponseObjectResource'
links:
$ref: '#/components/schemas/CollectionLinks'
required:
- data
CustomMetricCreateQueryResourceObject:
type: object
properties:
type:
$ref: '#/components/schemas/CustomMetricEnum'
attributes:
type: object
properties:
name:
description: The name for this custom metric. Names must be unique across the account. Attempting to create a metric with a duplicate name will return a 400 status code.
type: string
example: My custom metric
definition:
description: The definition of a custom metric. It is composed of a list of `metric_groups`. Each group specifies how to query a particular metric with customized filters and the value property to calculate conversion value measurements (if applicable). The groups are combined with `AND` relationships, i.e., conversion and conversion value measurements for each group will be added together to get the final result.
example:
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:
type: numeric
operator: greater-than-or-equal
value: 999
value_property: $value
- metric_id: BBBBBB
metric_filters:
- property: my_boolean_property
filter:
type: boolean
operator: equals
value: false
- property: my_list_property
filter:
type: list
operator: contains
value: some_value_in_a_list
value_property: my_numeric_property
$ref: '#/components/schemas/CustomMetricDefinition'
required:
- name
- definition
required:
- type
- attributes
MetricPropertyResponseObjectResource:
type: object
properties:
type:
$ref: '#/components/schemas/MetricPropertyEnum'
id:
description: The ID of the metric property
type: string
example: 925e385b52fb405715f3616c337cc65c
attributes:
type: object
properties:
label:
description: The label for this metric property
type: string
example: Categories
property:
description: The property for this metric property
type: string
example: Categories
inferred_type:
description: Inferred type for this metric property
type: string
example: List
required:
- label
- property
- inferred_type
relationships:
type: object
properties:
metric:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: Related Metric
type: string
required:
- type
- id
links:
$ref: '#/components/schemas/RelationshipLinks'
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- type
- id
- attributes
- links
GetMetricPropertyResponseCollection:
type: object
properties:
data:
type: array
items:
allOf:
- properties:
type:
$ref: '#/components/schemas/MetricPropertyEnum'
attributes:
properties:
sample_values:
type: array
items:
oneOf:
- type: integer
- type: number
- type: string
- type: boolean
nullable: true
- $ref: '#/components/schemas/MetricPropertyResponseObjectResource'
links:
$ref: '#/components/schemas/CollectionLinks'
required:
- data
RelationshipLinks:
type: object
properties:
self:
type: string
format: uri
related:
type: string
format: uri
required:
- self
- related
GetMappedMetricMetricRelationshipResponse:
type: object
properties:
data:
type: object
properties:
type:
$ref: '#/components/schemas/MetricEnum'
id:
description: The Metric ID
type: string
required:
- type
- id
links:
$ref: '#/components/schemas/ObjectLinks'
required:
- data
responses:
ClientError:
description: Client Error
content:
application/vnd.api+json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
required:
- id
- code
- title
- detail
properties:
id:
type: string
code:
type: string
title:
type: string
detail:
type: string
source:
type: object
properties:
pointer:
type: string
parameter:
type: string
required:
- errors
ServerError:
description: Server Error
content:
application/vnd.api+json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
required:
- id
- code
- title
- detail
properties:
id:
type: string
code:
type: string
title:
type: string
detail:
type: string
source:
type: object
properties:
pointer:
type: string
parameter:
type: string
required:
- errors
securitySchemes:
Klaviyo-API-Key:
type: apiKey
in: header
name: Authorization
description: Private key authentication for /api/ endpoints is performed by setting the `Authorization` header to `Klaviyo-API-Key your-private-api-key`
For more information please visit https://developers.klaviyo.com/en/v2026-04-15/reference/api-overview#authentication
x-default: Klaviyo-API-Key your-private-api-key
x-readme:
explorer-enabled: false
proxy-enabled: true
samples-enabled: true