Skip to main content
PUT
/
meters
/
{id}
JavaScript
import Limitry from '@limitry/sdk';

const client = new Limitry({
  apiKey: process.env['LIMITRY_API_KEY'], // This is the default and can be omitted
});

const meter = await client.meters.update('id');

console.log(meter.id);
{
  "id": "<string>",
  "projectId": "<string>",
  "name": "<string>",
  "description": "<string>",
  "aggregation": "<string>",
  "field": "<string>",
  "eventFilter": {
    "eventType": "<string>",
    "dimensions": {}
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API Key or Personal Access Token (PAT). When using PAT, include X-Project header.

Path Parameters

id
string
required

Meter ID

Body

application/json
name
string

Human-readable name

Minimum string length: 1
description
string

Description

aggregation
enum<string>

Aggregation type

Available options:
sum,
count,
max,
latest
field
string

Field to aggregate

Minimum string length: 1
eventFilter
object

Filter for matching events

Response

Meter updated

id
string
required

Unique identifier for the meter

projectId
string | null
required

Project ID (null for global defaults)

name
string
required

Human-readable name

description
string | null
required

Description of what this meter measures

aggregation
string
required

Aggregation type (sum, count, max, latest)

field
string
required

Field to aggregate (e.g., "values.total_tokens", "*" for count)

eventFilter
object
required

Filter for matching events

createdAt
string<date-time>
required

Created timestamp

updatedAt
string<date-time>
required

Updated timestamp