v1

latestOpenAPI 3.0.02026-07-261733191.1 MB
Usage Metrics

Update a Usage Metric

Update a Usage Metric

put/usage-metrics/{id}

Path parameters

idstring required

Unique ID

Headers

Authorizationstring required

Your API credentials. Eg. Basic {credentials}.

Sequence-Version'2024-07-30'

Use this header to select an API version

Request body

namestring required

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

descriptionstring nullable

Description for this metric

metricType'SIMPLE' | 'GROUPED' required
eventTypestring required

The eventType of the Usage Event to be aggregated

aggregationType'COUNT' | 'UNIQUE' | 'SUM' | 'CUSTOM' required
aggregationPropertystring nullable

Property within the event to aggregate

groupingPropertystring nullable

Property within the event to group results by

unitstring nullable

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

propertyFiltersobject

propertyFilters

caseSensitiveboolean nullable

caseSensitive

propertiesToNegatestring[] nullable

propertiesToNegate

Example request

{
  "name": "Total length of sent messages.",
  "description": "Total length of sent messages.",
  "metricType": "GROUPED",
  "eventType": "message_sent",
  "aggregationType": "COUNT",
  "aggregationProperty": "message_length",
  "groupingProperty": "channel",
  "unit": "bytes",
  "propertyFilters": {
    "channels": [
      "text",
      "email"
    ]
  },
  "caseSensitive": true,
  "propertiesToNegate": [
    "channels"
  ]
}

Response

OK

idstring required

Unique ID

sequenceAccountIdstring required

Sequence Account ID

namestring required

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

descriptionstring nullable

Description for this metric

metricType'SIMPLE' | 'GROUPED' required
eventTypestring required

The eventType of the Usage Event to be aggregated

aggregationType'COUNT' | 'UNIQUE' | 'SUM' | 'CUSTOM' required
aggregationPropertystring nullable

Property within the event to aggregate

groupingPropertystring nullable

Property within the event to group results by

unitstring nullable

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

createdAtstring nullable

Created at

deletedAtstring nullable

Created at

propertyFiltersobject required

propertyFilters

caseSensitiveboolean nullable

caseSensitive

propertiesToNegatestring[] nullable

propertiesToNegate

Example response

{
  "id": "f092246c-6b90-4106-bcca-304ccf06bf45",
  "sequenceAccountId": "ec1479a2-6ba1-421f-a7de-0853a20d17a1",
  "name": "Total length of sent messages.",
  "description": "Total length of sent messages.",
  "metricType": "GROUPED",
  "eventType": "message_sent",
  "aggregationType": "COUNT",
  "aggregationProperty": "message_length",
  "groupingProperty": "channel",
  "unit": "bytes",
  "createdAt": "2022-06-28T16:47:00Z",
  "deletedAt": "2022-06-28T16:47:00Z",
  "propertyFilters": {
    "channels": [
      "text",
      "email"
    ]
  },
  "caseSensitive": true,
  "propertiesToNegate": [
    "channels"
  ],
  "parameters": [
    {
      "id": "2963e49a-c8e0-4673-89f5-7a805c0faf14",
      "usageMetricId": "f092246c-6b90-4106-bcca-304ccf06bf45",
      "name": "myParam",
      "type": "INTEGER",
      "description": "My parameter",
      "defaultValue": "10"
    }
  ]
}