Entitlements
Check Entitlement
Fast single-feature entitlement check — the hot path for feature gating.
GET
/
v1
/
entitlements
/
check
Fast single-feature entitlement check
curl --request GET \
--url https://billing.example.com/v1/entitlements/check \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/entitlements/check"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/entitlements/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/entitlements/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/entitlements/check"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/entitlements/check")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/entitlements/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"feature_key": "<string>",
"granted": true,
"limit_value": 123
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}The feature-gating hot path: answers one
A feature the customer does not have answers
customer_id + feature pair
with a single indexed query. Union semantics are the same as
customer entitlements (any-true
booleans, max limits, across active and trialing subscriptions).
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string (UUID) | Yes | The customer to check |
feature | string | Yes | The feature key to check |
Example Request
curl "https://api.recurso.dev/v1/entitlements/check?customer_id=1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed&feature=seats" \
-H "Authorization: Bearer $API_KEY"
Response
{
"feature_key": "seats",
"granted": true,
"limit_value": 25
}
| Field | Type | Description |
|---|---|---|
feature_key | string | Echo of the requested feature |
granted | boolean | Whether the customer is entitled to the feature |
limit_value | integer | null | The effective limit for limit entitlements; null for booleans |
granted: false with a
null limit — the endpoint never returns 404 for missing grants:
{
"feature_key": "sso",
"granted": false,
"limit_value": null
}
Node SDK
const check = await recurso.entitlements.check(customerId, 'seats');
if (check.granted && usedSeats < (check.limit_value ?? 0)) {
// allow adding a seat
}
Cache results in your application for 30–60 seconds per
customer_id:feature pair to keep this off your request-latency path.
See the Entitlements guide for the full gating
pattern.⌘I
Fast single-feature entitlement check
curl --request GET \
--url https://billing.example.com/v1/entitlements/check \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/entitlements/check"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/entitlements/check', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://billing.example.com/v1/entitlements/check",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://billing.example.com/v1/entitlements/check"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/entitlements/check")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/entitlements/check")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"feature_key": "<string>",
"granted": true,
"limit_value": 123
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}