Skip to content

Subjects

Terminal window
npm install @limitry/sdk
import { createClient } from "@limitry/sdk";
const limitry = createClient(); // reads LIMITRY_API_KEY

GET /v1/subjects/{subjectKind}/{subjectId}

A subject’s anchor: when its anchor limits’ periods start from.

await limitry.subjects.get("team", "team_42");
FieldDescription
subjectKindstring, path, required
subjectIdstring, path, required
More about this endpoint

A subject is yours (a user, a team, an agent) and exists once a check names it.

PATCH /v1/subjects/{subjectKind}/{subjectId}

Sets when a subject’s anchor limits’ periods start from: typically its subscription’s start date, from your billing system’s webhook, so its allowance refills on its own billing day (monthly for an annual plan, too).

await limitry.subjects.update("team", "team_42", {
anchor: "2026-03-17T14:30:00Z",
});
FieldDescription
subjectKindstring, path, required
subjectIdstring, path, required
anchorstring, requiredThe date and time its periods start from (ISO 8601), such as a subscription's start.
More about this endpoint

Owners and admins only, for a person’s token.

POST /v1/subjects/{subjectKind}/{subjectId}/reset

Refills one limit on a subject (limitId), or every limit on it ({}), at once: for goodwill, a promotion or support.

await limitry.subjects.reset("team", "team_42");
FieldDescription
subjectKindstring, path, required
subjectIdstring, path, required
limitIdstringJust this limit. Default: every limit on the subject.
More about this endpoint

The schedule doesn’t move: the next refill is still the usual one. A balance goes back to its amount; a concurrent limit is skipped. Send an Idempotency-Key and a repeat resets once. Owners and admins only, for a person’s token.