Usage Meters
Update an usage meter
Changed onThis API lets you update an existing usage meter.
patch/usage_meters/{usage_meter_id}
Request
- Base URLhttps://api.togai.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
usage_meter_idstring required
Example:um.1zYnCiM9Bpg.1zYn
Request body
Example request
{
"type": "COUNTER",
"computations": [
{
"matcher": "{\n \"and\": [\n {\"in\": [{\"var\": \"dimension.city\"}, \"chennai\", \"mumbai\"]},\n \"or\": [\n {\">\": [{\"var\": \"attribute.distance\"}, 100]},\n {\"<\": [{\"var\": \"attribute.distance\"}, 20]}\n ]\n ]\n}\n"
}
]
}Response
Response for Create and Get usage event requests
Example response
{
"name": "rides-usage",
"billableName": "Rides Usage",
"description": "Meter to track cab rides",
"type": "COUNTER",
"status": "DRAFT",
"computations": [
{
"matcher": "{\n \"and\": [\n {\"in\": [{\"var\": \"dimension.city\"}, \"chennai\", \"mumbai\"]},\n \"or\": [\n {\">\": [{\"var\": \"attribute.distance\"}, 100]},\n {\"<\": [{\"var\": \"attribute.distance\"}, 20]}\n ]\n ]\n}\n"
}
]
}Changes
- info
added the new optional request property
- info
added the optional property
to the response with the status
- info
- info
added the new optional request property
- info