# Members ## List User Group Members `client.iam.userGroups.members.list(stringuserGroupID, MemberListParamsparams, RequestOptionsoptions?): V4PagePaginationArray` **get** `/accounts/{account_id}/iam/user_groups/{user_group_id}/members` List all the members attached to a user group. ### Parameters - `userGroupID: string` User Group identifier tag. - `params: MemberListParams` - `account_id: string` Path param: Account identifier tag. - `direction?: "asc" | "desc"` Query param: The sort order of returned user group members by email. - `"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. - `per_page?: number` Query param: Maximum number of results per page. ### Returns - `MemberListResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` ### Example ```typescript 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); } ``` #### Response ```json { "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 } } ``` ## Get User Group Member `client.iam.userGroups.members.get(stringmemberID, MemberGetParamsparams, RequestOptionsoptions?): MemberGetResponse` **get** `/accounts/{account_id}/iam/user_groups/{user_group_id}/members/{member_id}` Get details of a specific member in a user group. ### Parameters - `memberID: string` The identifier of an existing account Member. - `params: MemberGetParams` - `account_id: string` Account identifier tag. - `user_group_id: string` User Group identifier tag. ### Returns - `MemberGetResponse` Detailed member information for a User Group member. - `id: string` Account member identifier. - `created_at?: string` When the member was added to the user group. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` - `user?: User` Details of the user associated with this membership. - `id?: string` User identifier tag. - `email?: string` The contact email address of the user. - `first_name?: string` User's first name. - `last_name?: string` User's last name. ### Example ```typescript 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 }); const member = await client.iam.userGroups.members.get('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', user_group_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(member.id); ``` #### Response ```json { "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", "created_at": "2026-01-15T10:30:00Z", "email": "user@example.com", "status": "accepted", "user": { "id": "7c5dae5552338874e5053f2534d2767a", "email": "user@example.com", "first_name": "Alice", "last_name": "Smith" } } } ``` ## Add User Group Members `client.iam.userGroups.members.create(stringuserGroupID, MemberCreateParamsparams, RequestOptionsoptions?): SinglePage` **post** `/accounts/{account_id}/iam/user_groups/{user_group_id}/members` Add members to a User Group. ### Parameters - `userGroupID: string` User Group identifier tag. - `params: MemberCreateParams` - `account_id: string` Path param: Account identifier tag. - `members: Array` Body param - `id: string` The identifier of an existing account Member. ### Returns - `MemberCreateResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` ### Example ```typescript 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 memberCreateResponse of client.iam.userGroups.members.create( '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', members: [{ id: '023e105f4ecef8ad9ca31a8372d0c353' }], }, )) { console.log(memberCreateResponse.id); } ``` #### Response ```json { "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" } ] } ``` ## Update User Group Members `client.iam.userGroups.members.update(stringuserGroupID, MemberUpdateParamsparams, RequestOptionsoptions?): SinglePage` **put** `/accounts/{account_id}/iam/user_groups/{user_group_id}/members` Replace the set of members attached to a User Group. ### Parameters - `userGroupID: string` User Group identifier tag. - `params: MemberUpdateParams` - `account_id: string` Path param: Account identifier tag. - `members: Array` Body param: Set/Replace members to a user group. - `id: string` The identifier of an existing account Member. ### Returns - `MemberUpdateResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` ### Example ```typescript 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 memberUpdateResponse of client.iam.userGroups.members.update( '023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', members: [{ id: '023e105f4ecef8ad9ca31a8372d0c353' }], }, )) { console.log(memberUpdateResponse.id); } ``` #### Response ```json { "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" } ] } ``` ## Remove User Group Member `client.iam.userGroups.members.delete(stringmemberID, MemberDeleteParamsparams, RequestOptionsoptions?): MemberDeleteResponse` **delete** `/accounts/{account_id}/iam/user_groups/{user_group_id}/members/{member_id}` Remove a member from User Group ### Parameters - `memberID: string` The identifier of an existing account Member. - `params: MemberDeleteParams` - `account_id: string` Account identifier tag. - `user_group_id: string` User Group identifier tag. ### Returns - `MemberDeleteResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` ### Example ```typescript 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 }); const member = await client.iam.userGroups.members.delete('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', user_group_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(member.id); ``` #### Response ```json { "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" } } ``` ## Domain Types ### Member List Response - `MemberListResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` ### Member Get Response - `MemberGetResponse` Detailed member information for a User Group member. - `id: string` Account member identifier. - `created_at?: string` When the member was added to the user group. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` - `user?: User` Details of the user associated with this membership. - `id?: string` User identifier tag. - `email?: string` The contact email address of the user. - `first_name?: string` User's first name. - `last_name?: string` User's last name. ### Member Create Response - `MemberCreateResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` ### Member Update Response - `MemberUpdateResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"` ### Member Delete Response - `MemberDeleteResponse` Member attached to a User Group. - `id: string` Account member identifier. - `email?: string` The contact email address of the user. - `status?: "accepted" | "pending"` The member's status in the account. - `"accepted"` - `"pending"`