Get Account Entitlements
accounts.entitlements.list(EntitlementListParams**kwargs) -> SyncSinglePage[EntitlementListResponse]
GET/accounts/{account_id}/entitlements
Returns the list of entitlements (features and their allocations) for a given account. Each entitlement describes a product feature the account is permitted to use and the allocation value (boolean, count, range, enum, or string) that governs its behaviour.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Accepted Permissions (at least one required)
Get Account Entitlements
import os
from cloudflare import Cloudflare
client = Cloudflare(
api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted
)
page = client.accounts.entitlements.list(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
page = page.result[0]
print(page.id){
"errors": [],
"messages": [],
"result": [
{
"allocation": {
"type": "string",
"value": "default"
},
"created_date": "2024-01-01T00:00:00.000000",
"deleted_date": "",
"edited_date": "2024-01-01T00:00:01.000000",
"feature": {
"feature_set": "deployment",
"id": 99,
"key": "deployment.cohort",
"name": "Deployment Cohort"
},
"id": "deployment.cohort"
},
{
"allocation": {
"type": "range",
"value": {
"max": 86400,
"min": 10
}
},
"created_date": "2021-09-17T21:02:02.000000",
"deleted_date": "",
"edited_date": "2021-09-17T21:02:10.000000",
"feature": {
"feature_set": "rate_limiting",
"id": 33,
"key": "rate_limiting.timeout_bounds",
"name": "rate_limiting.timeout_bounds"
},
"id": "rate_limiting.timeout_bounds"
}
],
"success": true
}Returns Examples
{
"errors": [],
"messages": [],
"result": [
{
"allocation": {
"type": "string",
"value": "default"
},
"created_date": "2024-01-01T00:00:00.000000",
"deleted_date": "",
"edited_date": "2024-01-01T00:00:01.000000",
"feature": {
"feature_set": "deployment",
"id": 99,
"key": "deployment.cohort",
"name": "Deployment Cohort"
},
"id": "deployment.cohort"
},
{
"allocation": {
"type": "range",
"value": {
"max": 86400,
"min": 10
}
},
"created_date": "2021-09-17T21:02:02.000000",
"deleted_date": "",
"edited_date": "2021-09-17T21:02:10.000000",
"feature": {
"feature_set": "rate_limiting",
"id": 33,
"key": "rate_limiting.timeout_bounds",
"name": "rate_limiting.timeout_bounds"
},
"id": "rate_limiting.timeout_bounds"
}
],
"success": true
}