Subjects
Set up
Section titled “Set up”npm install @limitry/sdkimport { createClient } from "@limitry/sdk";
const limitry = createClient(); // reads LIMITRY_API_KEYpip install limitryfrom limitry import Limitry
limitry = Limitry() # reads LIMITRY_API_KEYnpm install -g @limitry/clilimitry loginexport LIMITRY_API_KEY="lim_test_…"Get a subject
Section titled “Get a subject”GET /v1/subjects/{subjectKind}/{subjectId}
A subject’s anchor: when its anchor limits’ periods start from.
await limitry.subjects.get("team", "team_42");limitry.subjects.get("team", "team_42")limitry subjects get team team_42curl -X GET "https://api.limitry.com/v1/subjects/team/team_42" \ -H "Authorization: Bearer $LIMITRY_API_KEY"| Field | Description |
|---|---|
subjectKind | |
subjectId |
More about this endpoint
A subject is yours (a user, a team, an agent) and exists once a check names it.
Set a subject’s anchor
Section titled “Set a subject’s anchor”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",});limitry.subjects.update( "team", "team_42", anchor="2026-03-17T14:30:00Z",)limitry subjects update team team_42 --anchor 2026-03-17T14:30:00Zcurl -X PATCH "https://api.limitry.com/v1/subjects/team/team_42" \ -H "Authorization: Bearer $LIMITRY_API_KEY" \ -H "Content-Type: application/json" \ -d '{"anchor":"2026-03-17T14:30:00Z"}'| Field | Description |
|---|---|
subjectKind | |
subjectId | |
anchor | The 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.
Reset a subject’s limits
Section titled “Reset a subject’s limits”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");limitry.subjects.reset("team", "team_42")limitry subjects reset team team_42curl -X POST "https://api.limitry.com/v1/subjects/team/team_42/reset" \ -H "Authorization: Bearer $LIMITRY_API_KEY" \ -H "Content-Type: application/json" \ -d '{}'| Field | Description |
|---|---|
subjectKind | |
subjectId | |
limitId | Just 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.