---
title: Get a list of meters
slug: reference/get-a-list-of-meters
docTags: 
createdAt: 2024-09-30T17:03:00.667Z
---

{
  "id": "_kb9whxfIRPai3BVyv5uo",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://app.amberflo.io/customer-portal/meter",
    "servers": [
      {
        "url": "https://app.amberflo.io/customer-portal/meter"
      }
    ],
    "name": "Get a list of meters",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "label",
          "type": "string",
          "description": "<p>Filter by <code>label</code></p>"
        },
        {
          "kind": "optional",
          "name": "meterApiName",
          "type": "string",
          "description": "<p>Filter by <code>meterApiName</code></p>"
        },
        {
          "kind": "optional",
          "name": "aggregation",
          "type": "string",
          "description": "<p>Filter by <code>aggregation</code></p>"
        },
        {
          "kind": "optional",
          "name": "meterType",
          "type": "string",
          "description": "<p>Filter by <code>meterType</code></p>"
        },
        {
          "kind": "optional",
          "name": "eventType",
          "type": "string",
          "description": "<p>Filter by <code>eventType</code></p>"
        },
        {
          "kind": "optional",
          "name": "measurementType",
          "type": "string",
          "description": "<p>Filter by <code>measurementType</code></p>"
        },
        {
          "kind": "required",
          "name": "sessionToken",
          "type": "string",
          "description": "<p>A required session token used to authenticate API calls made on behalf of a customer. This token is obtained from the <code>Create a session</code> endpoint and must be included with every request to authorize access.</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "api_key",
          "name": "x-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "example": "[{\"id\":\"meter1\",\"label\":\"ApiCalls1\",\"meterApiName\":\"ApiCalls1\",\"meterType\":\"sum_of_all_usage\",\"description\":\"ApiCalls1 metric\",\"dimensions\":[\"region1\",\"customerA\"],\"lockingStatus\":\"open\",\"createTime\":1620363790970,\"updateTime\":1626885651245},{\"id\":\"meter2\",\"label\":\"ApiCalls2\",\"meterApiName\":\"ApiCalls2\",\"meterType\":\"sum_of_all_usage\",\"description\":\"ApiCalls2 metric\",\"dimensions\":[\"region2\",\"customerB\"],\"lockingStatus\":\"open\",\"createTime\":1623255947408,\"updateTime\":1623255947408}]",
            "description": "",
            "customType": "meter-list-response",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "string",
                "description": "Meter ID created in the POST call.",
                "example": ""
              },
              {
                "name": "label",
                "kind": "optional",
                "type": "string",
                "description": "Display name on the UI dashboard. This must be unique.\n\nNote that charaters `/=\"` are not allowed.\n",
                "example": "",
                "default": "Api Calls"
              },
              {
                "name": "meterApiName",
                "kind": "optional",
                "type": "string",
                "description": "A unique identifier for the meter. When ingesting and querying usage, this is the value used to identify the meter.\n\nIt must be at most 50 chars long. Only `-!_.*'()&$ @;+,?` and alphanumeric chars are allowed.\n",
                "example": "",
                "default": "ApiCalls"
              },
              {
                "name": "meterType",
                "kind": "optional",
                "type": "string<sum_of_all_usage | max_usage | running_total | event_duration | unique_count>",
                "description": "The [meter type](doc:meter-types)",
                "example": "",
                "default": "sum_of_all_usage"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Description displayed on the UI.",
                "example": "",
                "default": "ApiCalls metric"
              },
              {
                "name": "dimensions",
                "kind": "optional",
                "type": "array",
                "description": "Keywords used for filtering and grouping usage data.\n\nEach dimension name must be at most 30 chars long. Only `-!_.*'()&$ @;+,?` and alphanumeric chars are allowed.\n",
                "example": "",
                "default": [
                  "region",
                  "customer_type"
                ],
                "itemType": "object",
                "customType": "object[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "uniqueDimension",
                "kind": "optional",
                "type": "string",
                "description": "Required if `meterType` is `unique_count`, then provide the unique dimension. This dimension should exist in the dimensions list.\n",
                "example": ""
              },
              {
                "name": "eventIdDimension",
                "kind": "optional",
                "type": "string",
                "description": "Required if `meterType` is `running_total` or `event_duration`, then provide the event ID dimension. This dimension should exist in the dimensions list.\n",
                "example": ""
              },
              {
                "name": "lockingStatus",
                "kind": "optional",
                "type": "string<open | close_to_changes | close_to_deletion | deprecated>",
                "description": "Indicates if the meter can be modified or not.\n- `open` allows all modifications;\n- `close_to_deletion` forbids deleting the meter and changing its `meterApiName`;\n- `close_to_changes` and `deprecated` forbid any modification.\n",
                "example": "",
                "default": "open"
              },
              {
                "name": "useInBilling",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether the meter should be kept in sync with a [product item](ref:post_payments-pricing-amberflo-account-pricing-product-items).\n\nWhen set to `true`, a product item will be created for this meter, if needed, and its name and description will be set to the meter's label and description.\n\nNote that you cannot *delete* a meter if the associated product item cannot be deleted too.\n",
                "example": "",
                "default": false
              },
              {
                "name": "squashSumMeter",
                "kind": "optional",
                "type": "boolean",
                "description": "When ingesting meters with high number of events, squash the events by grouping by meter dimensions and then summing them during the current hour.\nThis way all meter events with same dimensions will be reduced to one cummulative record in that hour. This applies to sum meters only.\n",
                "example": "",
                "default": false
              },
              {
                "name": "createTime",
                "kind": "optional",
                "type": "integer",
                "description": "Creation time in milliseconds since [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time).",
                "example": 0
              },
              {
                "name": "updateTime",
                "kind": "optional",
                "type": "integer",
                "description": "Last update time in milliseconds since [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time).",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/meter-list-response",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "0Y-vnny0YxbzfyspSwK4i",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url 'https://app.amberflo.io/customer-portal/meter?sessionToken=string' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "WhCAecr_GQr3G-rP4tk9B",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/customer-portal/meter?sessionToken=string\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "F9_JNLw0s2GbWHLbKQiEA",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/customer-portal/meter?sessionToken=string\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "hXPlyYoY8dczCmfjkVNz_",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/customer-portal/meter?sessionToken=string\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "0Y-vnny0YxbzfyspSwK4i"
    },
    "results": {
      "languages": [
        {
          "id": "IZg_X2tV4kSd8svacqhlW",
          "language": "200",
          "code": "// Successful response\n[\n  {\n    \"id\": \"\",\n    \"label\": \"\",\n    \"meterApiName\": \"\",\n    \"meterType\": \"\",\n    \"description\": \"\",\n    \"dimensions\": [\n      {}\n    ],\n    \"uniqueDimension\": \"\",\n    \"eventIdDimension\": \"\",\n    \"lockingStatus\": \"\",\n    \"useInBilling\": false,\n    \"squashSumMeter\": false,\n    \"createTime\": 0,\n    \"updateTime\": 0\n  }\n]"
        }
      ],
      "selectedLanguageId": "IZg_X2tV4kSd8svacqhlW"
    }
  },
  "children": [
    {
      "text": "",
      "id": "ECecu5_d2b4K-vwdFmmMt"
    }
  ]
}