PUT
/
usage-metrics
/
{id}
curl --request PUT \
  --url https://eu.sequencehq.com/api/usage-metrics/{id} \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "aggregationProperty": "message_length",
  "description": "Total length of sent messages.",
  "eventType": "message_sent",
  "name": "Total length of sent messages.",
  "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.",
  "parameters": [
    {
      "defaultValue": "10",
      "description": "My parameter",
      "id": "2963e49a-c8e0-4673-89f5-7a805c0faf14",
      "name": "myParam",
      "type": "INTEGER",
      "usageMetricId": "f092246c-6b90-4106-bcca-304ccf06bf45"
    }
  ],
  "propertiesToNegate": [
    "channels"
  ],
  "propertyFilters": {
    "channels": [
      "text",
      "email"
    ]
  },
  "sequenceAccountId": "ec1479a2-6ba1-421f-a7de-0853a20d17a1",
  "unit": "bytes"
}

Headers

Authorization
string
required

Your API credentials. Eg. Basic {credentials}.

Path Parameters

id
string
required

Unique ID

Body

application/json
aggregationProperty
string

Property within the event to aggregate

description
string

Description for this metric

eventType
string
required

The eventType of the Usage Event to be aggregated

name
string
required

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

unit
string

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

Response

200 - application/json
aggregationProperty
string

Property within the event to aggregate

aggregationType
enum<string>
required
Available options:
COUNT,
UNIQUE,
SUM,
CUSTOM
caseSensitive
boolean

caseSensitive

createdAt
string

Created at

deletedAt
string

Created at

description
string

Description for this metric

eventType
string
required

The eventType of the Usage Event to be aggregated

groupingProperty
string

Property within the event to group results by

id
string
required

Unique ID

metricType
enum<string>
required
Available options:
SIMPLE,
GROUPED
name
string
required

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

parameters
object[]
required

Required parameters

propertiesToNegate
string[]

propertiesToNegate

propertyFilters
object
required

propertyFilters

sequenceAccountId
string
required

Sequence Account ID

unit
string

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