Skip to content
Start here

List Account Permission Groups

client.IAM.PermissionGroups.List(ctx, params) (*V4PagePaginationArray[PermissionGroupListResponse], error)
GET/accounts/{account_id}/iam/permission_groups

List all the permissions groups for an account.

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)
Trust and Safety WriteTrust and Safety ReadDNS View WriteDNS View ReadSCIM ProvisioningLoad Balancers Account WriteLoad Balancers Account ReadZero Trust: PII ReadDDoS Botnet Feed WriteDDoS Botnet Feed ReadWorkers R2 Storage WriteWorkers R2 Storage ReadDDoS Protection WriteDDoS Protection ReadWorkers Tail ReadWorkers KV Storage WriteWorkers KV Storage ReadWorkers Scripts WriteWorkers Scripts ReadLoad Balancing: Monitors and Pools WriteLoad Balancing: Monitors and Pools ReadAccount Firewall Access Rules WriteAccount Firewall Access Rules ReadDNS Firewall WriteDNS Firewall ReadBilling WriteBilling ReadAccount Settings WriteAccount Settings Read
ParametersExpand Collapse
params PermissionGroupListParams
AccountID param.Field[string]

Path param: Account identifier tag.

maxLength32
minLength32
ID param.Field[string]optional

Query param: ID of the permission group to be fetched.

maxLength32
minLength32
Label param.Field[string]optional

Query param: Label of the permission group to be fetched.

Name param.Field[string]optional

Query param: Name of the permission group to be fetched.

Page param.Field[float64]optional

Query param: Page number of paginated results.

minimum1
PerPage param.Field[float64]optional

Query param: Maximum number of results per page.

maximum50
minimum5
ReturnsExpand Collapse
type PermissionGroupListResponse struct{…}

A named group of permissions that map to a group of operations against resources.

ID string

Identifier of the permission group.

Meta PermissionGroupListResponseMetaoptional

Attributes associated to the permission group.

Key stringoptional
Value stringoptional
Name stringoptional

Name of the permission group.

List Account Permission Groups

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/iam"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.IAM.PermissionGroups.List(context.TODO(), iam.PermissionGroupListParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "c8fed203ed3043cba015a93ad1616f1f",
      "meta": {
        "key": "key",
        "value": "value"
      },
      "name": "Zone Read"
    },
    {
      "id": "82e64a83756745bbbb1c9c2701bf816b",
      "meta": {
        "key": "key",
        "value": "value"
      },
      "name": "Magic Network Monitoring"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": [
    {
      "id": "c8fed203ed3043cba015a93ad1616f1f",
      "meta": {
        "key": "key",
        "value": "value"
      },
      "name": "Zone Read"
    },
    {
      "id": "82e64a83756745bbbb1c9c2701bf816b",
      "meta": {
        "key": "key",
        "value": "value"
      },
      "name": "Magic Network Monitoring"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}