Skip to navigation

Create a meter

Draft scaffold — not implemented or available in the API.

Creates a meter, which defines on the server what gets measured from events. eventNames or eventNamePattern and filters pick the events it reads, and measure.type sets the mode: events aggregates matching events over the billing period, singleEvent turns each event into its own measured quantity, and workflows groups related events into one outcome per workflow. Prices reference the meter by its key, which must be unique and cannot change.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Headers

Paid-BetaenumRequired

This endpoint is in the meters=v1 beta. Send this header to use it.

Allowed values:

Request

Body
keystringRequired1-255 characters
Your stable identifier, 1 to 255 characters.
measureobjectRequired
The immutable billing definition.
descriptionstring or nullOptional
What the resource represents.
eventNamePatternstringOptional>=1 character

Event-name regular expression.

eventNameslist of stringsOptional
Exact matching event names.
filterslist of objectsOptional
Conditions every event must match.
metadatamap from strings to stringsOptional

String key-value pairs of your own, up to 500 characters per value. Always updatable.

namestringOptional1-255 characters
The resource name.
validationModeenumOptionalDefaults to lenient
Acceptance behavior for invalid values.
Allowed values:

Response

201
idstring
The Meter ID.
objectenum

The type of object. Always meter.

Allowed values:
createdAtdatetime
When the object was created.
archivedAtdatetime or null
When this resource was archived, or null.
descriptionstring or null
What the resource represents.
eventNamePatternstring or null

Event-name regular expression.

eventNameslist of strings or null
Exact matching event names.
filterslist of objects
Conditions every event must match.
healthobject
MeterHealth.
keystring1-255 characters
Your stable identifier, 1 to 255 characters.
livemodeboolean

true for an object on a live account, false on a test account.

measureobject
The immutable billing definition.
metadatamap from strings to strings

String key-value pairs of your own, up to 500 characters per value. Always updatable.

namestring1-255 characters
The resource name.
updatedAtdatetime
When the object was last changed.
validationModeenumOptionalDefaults to lenient
Acceptance behavior for invalid values.
Allowed values:

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
501
Not Implemented Error