Skip to main content
GET
/
api
/
v1
/
usage
/
access
Javascript SDK
import { init } from "metrifox-js";

const metrifoxClient = init({
  apiKey: process.env.METRIFOX_API_KEY
});

const access = await metrifoxClient.usages.checkAccess({
  featureKey: "feature_interview_booking",
  customerKey: "cust-6d11ca90",
});
{
"message": "Access checked",
"can_access": true,
"customer_key": "cust-6d11ca90",
"feature_key": "feature_interview_booking",
"required_quantity": 1,
"used_quantity": 6,
"included_usage": 1,
"next_reset_at": 1758412800000,
"quota": 10,
"unlimited": false,
"carryover_quantity": 0,
"balance": 4,
"entitlement_active": true
}

Authorizations

x-api-key
string
header
required

Query Parameters

feature_key
string
required

The feature key to check access for

customer_key
string
required

The unique customer identifier in your application to check access for

Response

Access check completed

message
string
Example:

"Access checked"

can_access
boolean

Whether the user has access to the feature

customer_key
string

The customer key that was checked

feature_key
string

The feature key that was checked

required_quantity
integer

The quantity required to access this feature

used_quantity
integer

The quantity already used by the customer

included_usage
integer

The quantity included in the customer's plan

next_reset_at
integer

Timestamp when the usage will reset (Unix timestamp in milliseconds)

quota
integer

The total quota available

unlimited
boolean

Whether the customer has unlimited access

carryover_quantity
integer

Quantity carried over from previous period

balance
integer

Current balance available

entitlement_active
boolean

Whether the entitlement is currently active