Get Account Entitlements
client.Accounts.Entitlements.List(ctx, query) (*SinglePage[EntitlementListResponse], error)
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
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/accounts"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
page, err := client.Accounts.Entitlements.List(context.TODO(), accounts.EntitlementListParams{
AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
{
"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
}