Skip to main content
POST
Create a new Usage Metric

Headers

Authorization
string
required

Your API credentials. Eg. Basic {credentials}.

Sequence-Version
enum<string>

Use this header to select an API version

Available options:
2024-07-30

Body

application/json
name
string
required

Human-readable name for this metric, which should be unique

Example:

"Total length of sent messages."

metricType
enum<string>
required

Type of metric (simple or grouped)

Available options:
SIMPLE,
GROUPED
Example:

"GROUPED"

eventType
string
required

The eventType of the Usage Event to be aggregated

Example:

"message_sent"

aggregationType
enum<string>
required

Type of aggregation to perform

Available options:
COUNT,
UNIQUE,
SUM,
CUSTOM
Example:

"COUNT"

description
string | null

Description for this metric

Example:

"Total length of sent messages."

aggregationProperty
string | null

Property within the event to aggregate

Example:

"message_length"

groupingProperty
string | null

Property within the event to group results by

Example:

"channel"

unit
string | null

Human-readable unit of the aggregated metric, eg. API calls)

Example:

"bytes"

deletedAt
string | null

Created at

Example:

"2022-06-28T16:47:00Z"

propertyFilters
object

propertyFilters

caseSensitive
boolean | null

caseSensitive

Example:

true

propertiesToNegate
string[] | null

propertiesToNegate

Example:

Response

Created

id
string
required

Unique ID

Example:

"f092246c-6b90-4106-bcca-304ccf06bf45"

sequenceAccountId
string
required

Sequence Account ID

Example:

"ec1479a2-6ba1-421f-a7de-0853a20d17a1"

name
string
required

Human-readable name for this metric, which should be unique

Example:

"Total length of sent messages."

metricType
enum<string>
required

Type of metric (simple or grouped)

Available options:
SIMPLE,
GROUPED
Example:

"GROUPED"

eventType
string
required

The eventType of the Usage Event to be aggregated

Example:

"message_sent"

aggregationType
enum<string>
required

Type of aggregation to perform

Available options:
COUNT,
UNIQUE,
SUM,
CUSTOM
Example:

"COUNT"

propertyFilters
object
required

propertyFilters

parameters
object[]
required

Required parameters

Example:
description
string | null

Description for this metric

Example:

"Total length of sent messages."

aggregationProperty
string | null

Property within the event to aggregate

Example:

"message_length"

groupingProperty
string | null

Property within the event to group results by

Example:

"channel"

unit
string | null

Human-readable unit of the aggregated metric, eg. API calls)

Example:

"bytes"

createdAt
string | null

Created at

Example:

"2022-06-28T16:47:00Z"

deletedAt
string | null

Created at

Example:

"2022-06-28T16:47:00Z"

caseSensitive
boolean | null

caseSensitive

Example:

true

propertiesToNegate
string[] | null

propertiesToNegate

Example: