Skip to content
Start here

List User Group Members

client.iam.userGroups.members.list(stringuserGroupID, MemberListParams { account_id, direction, fuzzyEmail, 2 more } params, RequestOptionsoptions?): V4PagePaginationArray<MemberListResponse { id, email, status } >
GET/accounts/{account_id}/iam/user_groups/{user_group_id}/members

List all the members attached to a user group.

Security

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)
SCIM ProvisioningAccount Settings WriteAccount Settings Read
ParametersExpand Collapse
userGroupID: string

User Group identifier tag.

maxLength32
minLength32
params: MemberListParams { account_id, direction, fuzzyEmail, 2 more }
account_id: string

Path param: Account identifier tag.

maxLength32
minLength32
direction?: "asc" | "desc"

Query param: The sort order of returned user group members by email.

One of the following:
"asc"
"desc"
fuzzyEmail?: string

Query param: A string used for filtering members by partial email match.

page?: number

Query param: Page number of paginated results.

minimum1
per_page?: number

Query param: Maximum number of results per page.

maximum500
minimum1
ReturnsExpand Collapse
MemberListResponse { id, email, status }

Member attached to a User Group.

id: string

Account member identifier.

email?: string

The contact email address of the user.

maxLength90
status?: "accepted" | "pending"

The member’s status in the account.

One of the following:
"accepted"
"pending"

List User Group Members

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted
  apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const memberListResponse of client.iam.userGroups.members.list(
  '023e105f4ecef8ad9ca31a8372d0c353',
  { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
)) {
  console.log(memberListResponse.id);
}
{
  "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": "4f5f0c14a2a41d5063dd301b2f829f04",
      "email": "user@example.com",
      "status": "accepted"
    }
  ],
  "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": "4f5f0c14a2a41d5063dd301b2f829f04",
      "email": "user@example.com",
      "status": "accepted"
    }
  ],
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}