Skip to main content
PATCH
/
v1
/
meters
/
{id}
TypeScript SDK
import { Solifyn } from 'solifyn';

const solifyn = new Solifyn({ apiKey: 'your_private_api_key_here' });

// Update usage meter
const updatedMeter = await solifyn.meters.update('meter_019e56a1...', {
  name: 'Production API Requests'
});
console.log('Meter Updated:', updatedMeter);
{
  "id": "mtr_8Z1aB2cD3eF4gH5iJ6kL7m",
  "businessId": "biz_4r5t6y7u8i9o",
  "name": "API Request Count",
  "eventName": "api.request",
  "aggregationType": "COUNT",
  "archived": false,
  "createdAt": "2026-05-23T10:00:00.000Z",
  "updatedAt": "2026-05-23T10:00:00.000Z",
  "description": "Counts successful API requests for usage-based billing.",
  "aggregationKey": "tokens",
  "unit": "requests",
  "filters": {
    "event_type": "premium",
    "region": "asia"
  }
}

Authorizations

Authorization
string
header
required

Authenticate requests using your standard bearer API key (e.g. YOUR_API_KEY).

Path Parameters

id
string
required

The unique meter ID.

Example:

"mtr_8Z1aB2cD3eF4gH5iJ6kL7m"

Body

application/json
name
string

Meter display name.

Example:

"API Request Count"

description
string

Meter description.

Example:

"Counts successful API requests for usage-based billing."

eventName
string

The event name tracked by this meter.

Example:

"api.request"

aggregationType
enum<string>

Aggregation strategy for usage events.

Available options:
COUNT,
SUM,
MAX,
LAST
Example:

"COUNT"

aggregationKey
string

Metadata key used by SUM, MAX, or LAST aggregation modes.

Example:

"tokens"

unit
string

Measurement unit label.

Example:

"requests"

filters
object

Optional filter definition for advanced matching.

Example:
{ "event_type": "premium", "region": "asia" }
enableFiltering
boolean

Enable filtering on usage event ingestion.

Example:

false

Response

200 - application/json

Meter updated successfully.

Represents a usage meter configured for event-based billing, including the tracked event name, aggregation strategy, optional filters, and archive status.

id
string
required

The unique meter ID.

Example:

"mtr_8Z1aB2cD3eF4gH5iJ6kL7m"

businessId
string
required

The business ID that owns this meter.

Example:

"biz_4r5t6y7u8i9o"

name
string
required

Meter display name.

Example:

"API Request Count"

eventName
string
required

The event name tracked by this meter.

Example:

"api.request"

aggregationType
enum<string>
required

Aggregation strategy for usage events.

Available options:
COUNT,
SUM,
MAX,
LAST
Example:

"COUNT"

archived
boolean
required

Whether the meter is archived.

Example:

false

createdAt
string<date-time>
required

Creation timestamp.

Example:

"2026-05-23T10:00:00.000Z"

updatedAt
string<date-time>
required

Last update timestamp.

Example:

"2026-05-23T10:00:00.000Z"

description
object

Meter description.

Example:

"Counts successful API requests for usage-based billing."

aggregationKey
object

Metadata key used for aggregation.

Example:

"tokens"

unit
object

Measurement unit label.

Example:

"requests"

filters
object

Optional filter definition for advanced matching.

Example:
{ "event_type": "premium", "region": "asia" }