Metrics
Create a new UsageMetric
Create a new UsageMetric
POST
/
usage-metrics
Header
Body
curl --request POST \
--url https://eu.sequencehq.com/api/usage-metrics \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"aggregationType": "SUM",
"eventType": "message_sent",
"metricType": "GROUPED",
"name": "Total length of sent messages."
}'
{
"aggregationProperty": "message_length",
"aggregationType": "COUNT",
"caseSensitive": true,
"createdAt": "2022-06-28T16:47:00Z",
"deletedAt": "2022-06-28T16:47:00Z",
"description": "Total length of sent messages.",
"eventType": "message_sent",
"groupingProperty": "channel",
"id": "f092246c-6b90-4106-bcca-304ccf06bf45",
"metricType": "GROUPED",
"name": "Total length of sent messages.",
"propertyFilters": {
"channels": [
"text",
"email"
]
},
"sequenceAccountId": "ec1479a2-6ba1-421f-a7de-0853a20d17a1",
"unit": "bytes"
}
Headers
Authorizationrequired
string
Your API credentials. Eg. Basic {credentials}
.
Idempotency-Key
string
Specifying a unique ID for this request here lets you retry it without risk of performing the same operation twice.
Body
application/json
aggregationProperty
string
aggregationTyperequired
enum<string>
Available options:
COUNT
, UNIQUE
, SUM
caseSensitive
boolean
deletedAt
string
description
string
eventTyperequired
string
groupingProperty
string
metricTyperequired
enum<string>
Available options:
SIMPLE
, GROUPED
namerequired
string
propertyFilters
object
unit
string
Response
201 - application/json
aggregationProperty
string
aggregationTyperequired
enum<string>
Available options:
COUNT
, UNIQUE
, SUM
caseSensitive
boolean
createdAt
string
deletedAt
string
description
string
eventTyperequired
string
groupingProperty
string
idrequired
string
metricTyperequired
enum<string>
Available options:
SIMPLE
, GROUPED
namerequired
string
propertyFiltersrequired
object
sequenceAccountIdrequired
string
unit
string
curl --request POST \
--url https://eu.sequencehq.com/api/usage-metrics \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"aggregationType": "SUM",
"eventType": "message_sent",
"metricType": "GROUPED",
"name": "Total length of sent messages."
}'
{
"aggregationProperty": "message_length",
"aggregationType": "COUNT",
"caseSensitive": true,
"createdAt": "2022-06-28T16:47:00Z",
"deletedAt": "2022-06-28T16:47:00Z",
"description": "Total length of sent messages.",
"eventType": "message_sent",
"groupingProperty": "channel",
"id": "f092246c-6b90-4106-bcca-304ccf06bf45",
"metricType": "GROUPED",
"name": "Total length of sent messages.",
"propertyFilters": {
"channels": [
"text",
"email"
]
},
"sequenceAccountId": "ec1479a2-6ba1-421f-a7de-0853a20d17a1",
"unit": "bytes"
}