Skip to main content
Governance exposes two runtime operations: Check and Ingest.
  • Check reads the current usage and returns a gate decision. It never modifies state.
  • Ingest records a consumption event and increments the usage counter. It never gates.
The typical pattern is: check → allow or deny based on isGranted → ingest (only if allowed).
Governance is opt-in. If an entity has no assignment for the requested capability, Check returns isGranted: true with an empty chains array. There is no default deny.
Both Check and Ingest are fail-closed. If the governance cache is unavailable, they return 503 Service Unavailable rather than silently allowing or skipping. Plan for this in your error handling — a 503 from governance should be treated the same as any upstream dependency outage.
If you haven’t initialized the client yet, see Setting up governance.

Check

GET /api/v1-beta/customers/:id/entitlements/check Returns whether the requested amount of a feature or credit is permitted, along with current usage and the applicable limit. Call this before allowing consumption.

By feature

Pass the feature ID and dimensions that identify the governed entities. The governance engine resolves the entity hierarchy from the dimensions automatically.

By credit

Use currencyId instead of featureId to check against a credit balance limit.
Pass either featureId or currencyId, not both.

Check request fields

Check response

200 OK:

Finding the binding constraint


Ingest

Records consumption and increments the usage counter. Ingest never gates — call Check first if you need a permit decision before consuming. Use reportUsage for synchronous, real-time enforcement — credit-backed features return an updated balance in the response immediately. Use reportEvent for high-volume, eventually-consistent metering (≈10 s latency) where a real-time balance is not required.

reportUsage

reportEvent

Batching usage reports

Both reportUsage and reportEvent accept up to 100 records per request.

Ingest fields


Full check-then-ingest pattern