Skip to main content
PUT
/
limits
/
{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 limit = await client.limits.update('id');

console.log(limit.id);
{
  "id": "<string>",
  "projectId": "<string>",
  "name": "<string>",
  "meterId": "<string>",
  "limitValue": 123,
  "period": "<string>",
  "dimensionFilters": {},
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "customerId": "<string>",
  "alertThresholds": [
    50
  ]
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

Unique identifier for the limit

Body

application/json
name
string

Human-readable name for the limit

Minimum string length: 1
meterId
string

ID of the meter this limit references

Minimum string length: 1
limitValue
integer

Limit value

Required range: x > 0
period
enum<string>

Time period for the limit

Available options:
hour,
day,
week,
month,
annual,
all_time
customerId
string | null

Customer ID to scope the limit to

dimensionFilters
object

Dimension filters

alertThresholds
integer[] | null

Alert thresholds

Required range: 1 <= x <= 100

Response

Limit updated

id
string
required

Unique identifier for the limit

projectId
string
required

ID of the project that owns this limit

name
string
required

Human-readable name for the limit

meterId
string
required

ID of the meter this limit references

limitValue
number
required

Limit value

period
string
required

Time period for the limit (hour, day, week, month, annual, all_time). Period boundaries are calculated from the customer billingCycleStart.

dimensionFilters
object
required

Additional dimension filters for scoping

createdAt
string<date-time>
required

ISO 8601 timestamp when the limit was created

updatedAt
string<date-time>
required

ISO 8601 timestamp when the limit was last updated

customerId
string | null

Optional customer ID to scope the limit to

alertThresholds
integer[] | null

Alert thresholds as percentages (e.g., [80, 100])

Required range: 1 <= x <= 100