Skip to content
Start here

Get Zone Entitlements

GET/zones/{zone_id}/entitlements

Returns the list of entitlements (features and their allocations) for a given zone. Each entitlement describes a product feature the zone 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:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Zone Read
Path ParametersExpand Collapse
zone_id: string

Identifier tag.

maxLength32
minLength32
ReturnsExpand Collapse
errors: array of object { code, message }

List of errors, empty on success.

code: number

Numeric error code.

message: string

Human-readable error message.

messages: array of object { code, message }

List of informational messages.

code: number

Numeric message code.

message: string

Human-readable message.

result: array of object { id, allocation, created_date, 3 more }

List of entitlements for the requested object.

id: string

Entitlement identifier — equal to the feature key.

allocation: object { type, value }

Represents the allocation value for an entitlement. The shape of value depends on type: bool uses a boolean, max_count uses an integer, enum_number uses an array of numbers, range uses an object with min and max integer fields, and string uses a string.

type: "bool" or "max_count" or "enum_number" or 2 more

Allocation type discriminator.

One of the following:
"bool"
"max_count"
"enum_number"
"range"
"string"
value: boolean or number or string or 2 more

Contains the allocation value whose concrete type the type field determines: bool yields a boolean, max_count yields an integer, enum_number yields an array of numbers, range yields an object with min and max, and string yields a string.

One of the following:
boolean
number
string
array of number
object { max, min }
max: number
min: number
created_date: string

ISO 8601 timestamp (microsecond precision, no timezone offset) when the entitlement was created. Format: YYYY-MM-DDTHH:MM:SS.ffffff.

deleted_date: string

ISO 8601 timestamp when the entitlement was deleted, or empty string if not deleted.

edited_date: string

ISO 8601 timestamp (microsecond precision, no timezone offset) when the entitlement was last edited.

feature: object { id, feature_set, key, name }

Describes a product feature associated with an entitlement.

id: number

Numeric identifier of the feature.

formatint64
feature_set: string

The logical grouping (set) this feature belongs to.

key: string

Unique string key for the feature.

name: string

Human-readable name of the feature.

success: boolean

Whether the API call was successful.

Get Zone Entitlements

curl https://api.cloudflare.com/client/v4/zones/$ZONE_ID/entitlements \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "errors": [],
  "messages": [],
  "result": [
    {
      "allocation": {
        "type": "max_count",
        "value": 3
      },
      "created_date": "2021-09-17T20:33:36.000000",
      "deleted_date": "",
      "edited_date": "2021-09-17T20:34:01.000000",
      "feature": {
        "feature_set": "page_rules",
        "id": 1,
        "key": "page_rules",
        "name": "Page Rules"
      },
      "id": "page_rules"
    },
    {
      "allocation": {
        "type": "bool",
        "value": true
      },
      "created_date": "2021-09-17T20:39:02.000000",
      "deleted_date": "",
      "edited_date": "2021-09-17T20:39:11.000000",
      "feature": {
        "feature_set": "argo",
        "id": 38,
        "key": "argo.allow_tiered_caching",
        "name": "Argo Tiered Cache"
      },
      "id": "argo.allow_tiered_caching"
    },
    {
      "allocation": {
        "type": "enum_number",
        "value": [
          10,
          60,
          600,
          3600
        ]
      },
      "created_date": "2021-09-17T20:47:36.000000",
      "deleted_date": "",
      "edited_date": "2021-09-17T20:47:43.000000",
      "feature": {
        "feature_set": "rate_limiting",
        "id": 32,
        "key": "rate_limiting.sampling_period_secs",
        "name": "rate_limiting.sampling_period_secs"
      },
      "id": "rate_limiting.sampling_period_secs"
    }
  ],
  "success": true
}
{
  "errors": [
    {
      "code": 2005,
      "message": "failed to fetch entitlements: invalid object type"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2004,
      "message": "failed to fetch entitlements: unknown route"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2001,
      "message": "failed to fetch entitlements: method not allowed"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2000,
      "message": "failed to fetch entitlements: internal server error"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2003,
      "message": "failed to fetch entitlements: timeout occurred"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
Returns Examples
{
  "errors": [],
  "messages": [],
  "result": [
    {
      "allocation": {
        "type": "max_count",
        "value": 3
      },
      "created_date": "2021-09-17T20:33:36.000000",
      "deleted_date": "",
      "edited_date": "2021-09-17T20:34:01.000000",
      "feature": {
        "feature_set": "page_rules",
        "id": 1,
        "key": "page_rules",
        "name": "Page Rules"
      },
      "id": "page_rules"
    },
    {
      "allocation": {
        "type": "bool",
        "value": true
      },
      "created_date": "2021-09-17T20:39:02.000000",
      "deleted_date": "",
      "edited_date": "2021-09-17T20:39:11.000000",
      "feature": {
        "feature_set": "argo",
        "id": 38,
        "key": "argo.allow_tiered_caching",
        "name": "Argo Tiered Cache"
      },
      "id": "argo.allow_tiered_caching"
    },
    {
      "allocation": {
        "type": "enum_number",
        "value": [
          10,
          60,
          600,
          3600
        ]
      },
      "created_date": "2021-09-17T20:47:36.000000",
      "deleted_date": "",
      "edited_date": "2021-09-17T20:47:43.000000",
      "feature": {
        "feature_set": "rate_limiting",
        "id": 32,
        "key": "rate_limiting.sampling_period_secs",
        "name": "rate_limiting.sampling_period_secs"
      },
      "id": "rate_limiting.sampling_period_secs"
    }
  ],
  "success": true
}
{
  "errors": [
    {
      "code": 2005,
      "message": "failed to fetch entitlements: invalid object type"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2004,
      "message": "failed to fetch entitlements: unknown route"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2001,
      "message": "failed to fetch entitlements: method not allowed"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2000,
      "message": "failed to fetch entitlements: internal server error"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}
{
  "errors": [
    {
      "code": 2003,
      "message": "failed to fetch entitlements: timeout occurred"
    }
  ],
  "messages": [],
  "result": null,
  "success": false
}