Skip to content
NuxieNuxie
Esc
↑↓navigate↵open⌘Jpreview
Open Nuxie

Check Feature access

Check a customer’s access or available balance without spending units.

POSThttps://i.nuxie.ai/entitled

Check whether a customer can use a published Feature. This request reads access without spending units. To charge for an action, consume usage.

Request body

apiKeybodystringrequired

Publishable key for the app platform. A pk_test_ key selects test data; a pk_live_ key selects live data. Copy it from Connect your app.

customerIdbodystringrequired

The identified or anonymous customer ID your app supplies to the SDK, rather than Nuxie’s internal customer record ID. See Customer identifiers.

featureIdbodystringrequired

Published Feature key, such as premium-export. Several Products can grant the same Feature.

requiredBalancebodyinteger

Units needed for the action. Accepts 1 to 9,007,199,254,740,991; defaults to 1.

requiredQuantitybodyinteger

Alias for requiredBalance. If you send both, their values must match.

entityIdbodystring

Identifier for entity-scoped access. Must be non-empty, trimmed, and at most 256 bytes.

Unknown request fields return 400.

Response

customerIdstringrequired

Customer identity supplied in the request.

featureIdstringrequired

Published Feature key that was checked.

requiredBalanceintegerrequired

Number of units checked.

codestringrequired

Reason for the result. See the decision codes below.

allowedbooleanrequired

Whether the customer has the requested access. A 200 response can have allowed: false.

unlimitedbooleanrequired

Whether usage is unlimited.

balancenumberrequired

Remaining units, or null for unlimited access.

typestringrequired

Feature type: boolean, metered, or creditSystem.

For a Boolean Feature, allowed reports active access independently of the balance. For a metered Feature or credit system, access must be active and either unlimited or have enough units for requiredBalance. Unlimited access has a null balance.

allowed: false means the customer does not have the requested access, even when the HTTP status is 200.

code Meaning
feature_found The Feature was checked; read allowed for the decision
customer_missing No customer record exists for the supplied ID
feature_inapplicable The Feature does not apply to the platform making the request
feature_not_found No published Feature matches; HTTP 404
billing_unavailable Access could not be checked; HTTP 503
curl https://i.nuxie.ai/entitled \
  --header 'Content-Type: application/json' \
  --data '{
  "apiKey": "pk_test_example",
  "customerId": "user-456",
  "featureId": "premium-export",
  "requiredBalance": 1
}'
{
  "customerId": "user-456",
  "featureId": "premium-export",
  "requiredBalance": 1,
  "code": "feature_found",
  "allowed": true,
  "unlimited": false,
  "balance": 0,
  "type": "boolean"
}

Last updated on

Was this page helpful?