Skip to main content
GET
/
usage_meters
List usage meters for event schema
curl --request GET \
  --url https://api.togai.com/usage_meters \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "id": "<string>",
      "name": "rides-usage",
      "displayName": "<string>",
      "type": "COUNTER",
      "aggregation": "COUNT",
      "billableName": "Rides Usage",
      "description": "Meter to track cab rides",
      "filters": [
        {
          "field": "<string>",
          "value": "<string>"
        }
      ],
      "status": "DRAFT",
      "computations": [
        {
          "computation": {
            "*": [
              {
                "var": "attributes.distance"
              },
              0.4
            ]
          },
          "order": 123,
          "id": "<string>",
          "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"
        }
      ],
      "eventSchema": {
        "name": "<string>",
        "version": 1,
        "description": "<string>",
        "status": "DRAFT",
        "attributes": [
          {
            "name": "distance",
            "defaultUnit": "kms"
          }
        ],
        "dimensions": [
          {
            "name": "city"
          }
        ],
        "filterFields": [
          "<string>"
        ],
        "featureDetails": {
          "featureId": "<string>",
          "attributeName": "<string>"
        },
        "enrichments": {
          "fields": [
            {
              "name": "<string>",
              "type": "ATTRIBUTE",
              "enrichmentType": "VALUE",
              "value": "<string>",
              "order": 123
            }
          ],
          "dependencies": [
            {
              "type": "SETTING",
              "key": "<string>",
              "name": "<string>"
            }
          ]
        },
        "eventIdTemplate": "<string>",
        "eventLevelRevenue": true,
        "createdAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z"
      },
      "createdAt": "2023-11-07T05:31:56Z",
      "lastActivatedAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "nextToken": "<string>",
  "context": {
    "pageSize": 123,
    "sortOrder": "ASC"
  }
}
aggregation
string
Aggregation type for usage meters
status
enum
Status of the usage meter (`ACTIVE`, `ARCHIVED`)
id
string
Unique identifier of the usage meter
aggregation
string
status
string
id
string

Allowed filter combinations

  • aggregation, status
  • status
  • id
Fields that can be searched on using _search query param
id
string
name
string
billable_name
string
Fields with which the list response can be sorted using _sort query param
updated_at
string
Default sort order:updated_at DESC

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

status
enum<string>

Filter by status

Available options:
ACTIVE,
INACTIVE
aggregations
enum<string>

Filter by aggregations

Available options:
COUNT,
SUM
nextToken
string
Example:

"eyJsYXN0SXRlbUlkIjogInN0cmluZyIsICJwYWdlU2l6ZSI6IDEwMCwgInNvcnRPcmRlciI6ICJhc2MifQ=="

pageSize
number
Example:

10

Response

Response for list usage_meters request

data
object[]
nextToken
string
context
object