For clean Markdown of any page, append .md to the page URL. For a complete documentation index, see https://docs.prolifi.io/endpoints/entitlements/llms.txt. For full documentation content, see https://docs.prolifi.io/endpoints/entitlements/llms-full.txt.

# Check entitlement

POST https://api.prolifi.co/api/v1/public/entitlements/check
Content-Type: application/json

Checks whether a customer is entitled to use a specific feature. Returns the entitlement status, current usage, limits, and remaining balance.

Use this endpoint for real-time feature gating in your application.


Reference: https://docs.prolifi.io/endpoints/entitlements/check-entitlement

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Prolifi Public API
  version: 1.0.0
paths:
  /entitlements/check:
    post:
      operationId: check-entitlement
      summary: Check entitlement
      description: >
        Checks whether a customer is entitled to use a specific feature. Returns
        the entitlement status, current usage, limits, and remaining balance.


        Use this endpoint for real-time feature gating in your application.
      tags:
        - subpackage_entitlements
      parameters:
        - name: Authorization
          in: header
          description: >
            Use a secret key (`sk_test_*` or `sk_live_*`) for full read/write
            access, or a public key (`pk_test_*` or `pk_live_*`) for read-only
            access.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Entitlement check result
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Entitlements_checkEntitlement_Response_200
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Permission denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckEntitlementRequest'
servers:
  - url: https://api.prolifi.co/api/v1/public
  - url: https://sandbox.prolifi.co/api/v1/public
components:
  schemas:
    CheckEntitlementRequest:
      type: object
      properties:
        customer_id:
          type: string
          format: uuid
          description: The customer to check entitlements for.
        feature_id:
          type: string
          description: The feature identifier to check.
        requested_quantity:
          type:
            - integer
            - 'null'
          description: >-
            Check if the customer has at least this much remaining. Defaults to
            1.
      required:
        - customer_id
        - feature_id
      title: CheckEntitlementRequest
    EntitlementCheckResult:
      type: object
      properties:
        entitled:
          type: boolean
          description: Whether the customer is entitled to the feature.
        feature_id:
          type: string
        feature_name:
          type:
            - string
            - 'null'
        entitlement_type:
          type:
            - string
            - 'null'
        is_unlimited:
          type: boolean
        limit:
          type:
            - integer
            - 'null'
          description: Maximum allowed quantity (null if unlimited).
        current_usage:
          type: integer
          description: Current usage in the billing period.
        remaining:
          type:
            - integer
            - 'null'
          description: Remaining quota (null if unlimited).
        reset_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the entitlement resets (next billing period start).
      title: EntitlementCheckResult
    Entitlements_checkEntitlement_Response_200:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/EntitlementCheckResult'
      title: Entitlements_checkEntitlement_Response_200
    ErrorResponseErrorType:
      type: string
      enum:
        - authentication_error
        - permission_error
        - validation_error
        - not_found
        - invalid_request
        - rate_limit_error
        - ip_restricted
        - conflict
        - api_error
      description: Machine-readable error type.
      title: ErrorResponseErrorType
    ErrorResponseErrorErrorsItems:
      type: object
      properties:
        field:
          type: string
          description: The field that failed validation.
        message:
          type: string
          description: The validation error message.
      title: ErrorResponseErrorErrorsItems
    ErrorResponseError:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/ErrorResponseErrorType'
          description: Machine-readable error type.
        message:
          type: string
          description: Human-readable error description.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorResponseErrorErrorsItems'
          description: >-
            Field-level validation errors (only present for `validation_error`
            type).
      required:
        - type
        - message
      title: ErrorResponseError
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorResponseError'
      title: ErrorResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Use a secret key (`sk_test_*` or `sk_live_*`) for full read/write
        access, or a public key (`pk_test_*` or `pk_live_*`) for read-only
        access.

```

## SDK Code Examples

```python Customer is entitled
import requests

url = "https://api.prolifi.co/api/v1/public/entitlements/check"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Customer is entitled
const url = 'https://api.prolifi.co/api/v1/public/entitlements/check';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Customer is entitled
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolifi.co/api/v1/public/entitlements/check"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Customer is entitled
require 'uri'
require 'net/http'

url = URI("https://api.prolifi.co/api/v1/public/entitlements/check")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Customer is entitled
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolifi.co/api/v1/public/entitlements/check")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Customer is entitled
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolifi.co/api/v1/public/entitlements/check', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Customer is entitled
using RestSharp;

var client = new RestClient("https://api.prolifi.co/api/v1/public/entitlements/check");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Customer is entitled
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolifi.co/api/v1/public/entitlements/check")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Customer is not entitled
import requests

url = "https://api.prolifi.co/api/v1/public/entitlements/check"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Customer is not entitled
const url = 'https://api.prolifi.co/api/v1/public/entitlements/check';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Customer is not entitled
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolifi.co/api/v1/public/entitlements/check"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Customer is not entitled
require 'uri'
require 'net/http'

url = URI("https://api.prolifi.co/api/v1/public/entitlements/check")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Customer is not entitled
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolifi.co/api/v1/public/entitlements/check")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Customer is not entitled
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolifi.co/api/v1/public/entitlements/check', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Customer is not entitled
using RestSharp;

var client = new RestClient("https://api.prolifi.co/api/v1/public/entitlements/check");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Customer is not entitled
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolifi.co/api/v1/public/entitlements/check")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Check if customer can make API calls
import requests

url = "https://api.prolifi.co/api/v1/public/entitlements/check"

payload = {
    "customer_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "feature_id": "feat_api_calls"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Check if customer can make API calls
const url = 'https://api.prolifi.co/api/v1/public/entitlements/check';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"customer_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","feature_id":"feat_api_calls"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Check if customer can make API calls
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolifi.co/api/v1/public/entitlements/check"

	payload := strings.NewReader("{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Check if customer can make API calls
require 'uri'
require 'net/http'

url = URI("https://api.prolifi.co/api/v1/public/entitlements/check")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\"\n}"

response = http.request(request)
puts response.read_body
```

```java Check if customer can make API calls
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolifi.co/api/v1/public/entitlements/check")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\"\n}")
  .asString();
```

```php Check if customer can make API calls
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolifi.co/api/v1/public/entitlements/check', [
  'body' => '{
  "customer_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "feature_id": "feat_api_calls"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Check if customer can make API calls
using RestSharp;

var client = new RestClient("https://api.prolifi.co/api/v1/public/entitlements/check");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Check if customer can make API calls
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "feature_id": "feat_api_calls"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolifi.co/api/v1/public/entitlements/check")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Check if customer can make 100 API calls
import requests

url = "https://api.prolifi.co/api/v1/public/entitlements/check"

payload = {
    "customer_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
    "feature_id": "feat_api_calls",
    "requested_quantity": 100
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Check if customer can make 100 API calls
const url = 'https://api.prolifi.co/api/v1/public/entitlements/check';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"customer_id":"d290f1ee-6c54-4b01-90e6-d701748f0851","feature_id":"feat_api_calls","requested_quantity":100}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Check if customer can make 100 API calls
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolifi.co/api/v1/public/entitlements/check"

	payload := strings.NewReader("{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\",\n  \"requested_quantity\": 100\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Check if customer can make 100 API calls
require 'uri'
require 'net/http'

url = URI("https://api.prolifi.co/api/v1/public/entitlements/check")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\",\n  \"requested_quantity\": 100\n}"

response = http.request(request)
puts response.read_body
```

```java Check if customer can make 100 API calls
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolifi.co/api/v1/public/entitlements/check")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\",\n  \"requested_quantity\": 100\n}")
  .asString();
```

```php Check if customer can make 100 API calls
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolifi.co/api/v1/public/entitlements/check', [
  'body' => '{
  "customer_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "feature_id": "feat_api_calls",
  "requested_quantity": 100
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Check if customer can make 100 API calls
using RestSharp;

var client = new RestClient("https://api.prolifi.co/api/v1/public/entitlements/check");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": \"d290f1ee-6c54-4b01-90e6-d701748f0851\",\n  \"feature_id\": \"feat_api_calls\",\n  \"requested_quantity\": 100\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Check if customer can make 100 API calls
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
  "feature_id": "feat_api_calls",
  "requested_quantity": 100
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolifi.co/api/v1/public/entitlements/check")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```