Metrics
Create a new Usage Metric
Create a new Usage Metric
POST
/
usage-metrics
Header
Body
curl --request POST \
--url https://dev.seqhq.io/api/usage-metrics \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"aggregationProperty": "message_length",
"aggregationType": "COUNT",
"caseSensitive": true,
"deletedAt": "2022-06-28T16:47:00Z",
"description": "Total length of sent messages.",
"eventType": "message_sent",
"groupingProperty": "channel",
"metricType": "GROUPED",
"name": "Total length of sent messages.",
"propertiesToNegate": [
"channels"
],
"propertyFilters": {
"channels": [
"text",
"email"
]
},
"unit": "bytes"
}'
{
"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.",
"propertiesToNegate": [
"channels"
],
"propertyFilters": {
"channels": [
"text",
"email"
]
},
"sequenceAccountId": "ec1479a2-6ba1-421f-a7de-0853a20d17a1",
"unit": "bytes"
}
Headers
Authorization
string
requiredYour API credentials. Eg. Basic {credentials}
.
Body
application/json
aggregationProperty
string
aggregationType
enum<string>
requiredAvailable options:
COUNT
, UNIQUE
, SUM
caseSensitive
boolean
deletedAt
string
description
string
eventType
string
requiredgroupingProperty
string
metricType
enum<string>
requiredAvailable options:
SIMPLE
, GROUPED
name
string
requiredpropertiesToNegate
string[]
propertyFilters
object
unit
string
Response
201 - application/json
aggregationProperty
string
aggregationType
enum<string>
requiredAvailable options:
COUNT
, UNIQUE
, SUM
caseSensitive
boolean
createdAt
string
deletedAt
string
description
string
eventType
string
requiredgroupingProperty
string
id
string
requiredmetricType
enum<string>
requiredAvailable options:
SIMPLE
, GROUPED
name
string
requiredpropertiesToNegate
string[]
propertyFilters
object
requiredsequenceAccountId
string
requiredunit
string
curl --request POST \
--url https://dev.seqhq.io/api/usage-metrics \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '{
"aggregationProperty": "message_length",
"aggregationType": "COUNT",
"caseSensitive": true,
"deletedAt": "2022-06-28T16:47:00Z",
"description": "Total length of sent messages.",
"eventType": "message_sent",
"groupingProperty": "channel",
"metricType": "GROUPED",
"name": "Total length of sent messages.",
"propertiesToNegate": [
"channels"
],
"propertyFilters": {
"channels": [
"text",
"email"
]
},
"unit": "bytes"
}'
{
"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.",
"propertiesToNegate": [
"channels"
],
"propertyFilters": {
"channels": [
"text",
"email"
]
},
"sequenceAccountId": "ec1479a2-6ba1-421f-a7de-0853a20d17a1",
"unit": "bytes"
}