Meters
Update a meter
Changed onRename a meter and/or revise its definition. A rename is always allowed — the name is a label no aggregate depends on — but it must stay unique within the store (409 meter_name_taken). Definition changes (filter, aggregation, aggregation_property) are only accepted while the meter has processed no usage and has no associated purchase; otherwise the request is rejected with 409, because editing the definition would silently rewrite what already-recorded usage means. Send aggregation_property as null to clear it; omit it to leave it unchanged.
patch/v1/meters/{id}
Request
- Base URLhttps://api.creem.io
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
idstring required
Request body
Example request
{
"name": "Image generations (v2)",
"aggregation": "sum",
"aggregation_property": "tokens",
"filter": {
"conjunction": "and",
"clauses": [
{
"property": "tier",
"operator": "equals"
}
]
}
}Response
Meter updated
Example response
{
"id": "mtr_abc123",
"store_id": "sto_abc123",
"name": "Image generations",
"event_name": "image.generated",
"aggregation": "sum",
"aggregation_property": "tokens",
"filter": {
"conjunction": "and",
"clauses": [
{
"property": "tier",
"operator": "equals"
}
]
},
"unit_label": "images",
"status": "active"
}Changes
- info
endpoint added
- info