Skip to content
Start here

Update User Group Members

iam.user_groups.members.update(struser_group_id, MemberUpdateParams**kwargs) -> SyncSinglePage[MemberUpdateResponse]
PUT/accounts/{account_id}/iam/user_groups/{user_group_id}/members

Replace the set of 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 Write
ParametersExpand Collapse
account_id: str

Account identifier tag.

maxLength32
minLength32
user_group_id: str

User Group identifier tag.

maxLength32
minLength32
body: Iterable[Body]

Set/Replace members to a user group.

id: str

The identifier of an existing account Member.

maxLength32
minLength32
ReturnsExpand Collapse
class MemberUpdateResponse:

Member attached to a User Group.

id: str

Account member identifier.

email: Optional[str]

The contact email address of the user.

maxLength90
status: Optional[Literal["accepted", "pending"]]

The member’s status in the account.

One of the following:
"accepted"
"pending"

Update User Group Members

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_email=os.environ.get("CLOUDFLARE_EMAIL"),  # This is the default and can be omitted
    api_key=os.environ.get("CLOUDFLARE_API_KEY"),  # This is the default and can be omitted
)
page = client.iam.user_groups.members.update(
    user_group_id="023e105f4ecef8ad9ca31a8372d0c353",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    body=[{
        "id": "023e105f4ecef8ad9ca31a8372d0c353"
    }],
)
page = page.result[0]
print(page.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"
    }
  ]
}
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"
    }
  ]
}