---
title: Edit User
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/python)

[User](https://developers.cloudflare.com/api/python/resources/user)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Edit User

user.edit(UserEditParams\*\*kwargs) -> [UserEditResponse](<https://developers.cloudflare.com/api/python/resources/user#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)>)

PATCH/user

Edit part of your user details.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`User Details Write`

##### ParametersExpand Collapse

country: Optional\[str]

The country in which the user lives.

maxLength30

[Link to this property](<#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20country%20%3E%20(schema)>)

first\_name: Optional\[str]

User’s first name

maxLength60

[Link to this property](<#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20first_name%20%3E%20(schema)>)

last\_name: Optional\[str]

User’s last name

maxLength60

[Link to this property](<#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20last_name%20%3E%20(schema)>)

telephone: Optional\[str]

User’s telephone number

maxLength20

[Link to this property](<#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20telephone%20%3E%20(schema)>)

zipcode: Optional\[str]

The zipcode or postal code where the user lives.

maxLength20

[Link to this property](<#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20zipcode%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class UserEditResponse: …

</summary>

id: str

Identifier of the user.

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

email: str

Current email address of the user.

formatemail

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20email">Link to this property</a>

betas: Optional\[List\[str]]

Lists the betas that the user is participating in.

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20betas">Link to this property</a>

country: Optional\[str]

The country in which the user lives.

maxLength30

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20country">Link to this property</a>

first\_name: Optional\[str]

User’s first name

maxLength60

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20first_name">Link to this property</a>

has\_business\_zones: Optional\[bool]

Indicates whether user has any business zones

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20has_business_zones">Link to this property</a>

has\_enterprise\_zones: Optional\[bool]

Indicates whether user has any enterprise zones

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20has_enterprise_zones">Link to this property</a>

has\_pro\_zones: Optional\[bool]

Indicates whether user has any pro zones

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20has_pro_zones">Link to this property</a>

last\_name: Optional\[str]

User’s last name

maxLength60

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20last_name">Link to this property</a>

<details>

<summary>

organizations: Optional\[List\[<a href="https://developers.cloudflare.com/api/python/resources/user#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)">Organization</a>]]

</summary>

id: Optional\[str]

Identifier

maxLength32

minLength32

<a href="#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

name: Optional\[str]

Organization name.

maxLength100

<a href="#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

permissions: Optional\[List\[<a href="https://developers.cloudflare.com/api/python/resources/$shared#(resource)%20%24shared%20%3E%20(model)%20permission%20%3E%20(schema)">Permission</a>]]

Access permissions for this User.

<a href="#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)%20%3E%20(property)%20permissions">Link to this property</a>

roles: Optional\[List\[str]]

List of roles that a user has within an organization.

<a href="#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)%20%3E%20(property)%20roles">Link to this property</a>

<details>

<summary>

status: Optional\[Status]

Whether the user is a member of the organization or has an invitation pending.

</summary>

One of the following:

"member"

<a href="#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)%20%3E%20(property)%20status%20%2B%20(resource)%20accounts.members%20%3E%20(model)%20status%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

"invited"

<a href="#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)%20%3E%20(property)%20status%20%2B%20(resource)%20accounts.members%20%3E%20(model)%20status%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20user.organizations%20%3E%20(model)%20organization%20%3E%20(schema)%20%3E%20(property)%20status">Link to this property</a>

</details>

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20organizations">Link to this property</a>

suspended: Optional\[bool]

Indicates whether user has been suspended

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20suspended">Link to this property</a>

telephone: Optional\[str]

User’s telephone number

maxLength20

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20telephone">Link to this property</a>

two\_factor\_authentication\_enabled: Optional\[bool]

Indicates whether two-factor authentication is enabled for the user account. Does not apply to API authentication.

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20two_factor_authentication_enabled">Link to this property</a>

two\_factor\_authentication\_locked: Optional\[bool]

Indicates whether two-factor authentication is required by one of the accounts that the user is a member of.

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20two_factor_authentication_locked">Link to this property</a>

zipcode: Optional\[str]

The zipcode or postal code where the user lives.

maxLength20

<a href="#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)%20%3E%20(property)%20zipcode">Link to this property</a>

</details>

[Link to this property](<#(resource)%20user%20%3E%20(model)%20user_edit_response%20%3E%20(schema)>)

### Edit User

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
response = client.user.edit()
print(response.id)
```

200 example

```
{
  "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": "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
    "email": "alice@example.com",
    "betas": [
      "zone_level_access_beta"
    ],
    "country": "US",
    "first_name": "John",
    "has_business_zones": true,
    "has_enterprise_zones": true,
    "has_pro_zones": true,
    "last_name": "Appleseed",
    "organizations": [
      {
        "id": "023e105f4ecef8ad9ca31a8372d0c353",
        "name": "Cloudflare, Inc.",
        "permissions": [
          "#zones:read"
        ],
        "roles": [
          "All Privileges - Super Administrator"
        ],
        "status": "member"
      }
    ],
    "suspended": true,
    "telephone": "+1 123-123-1234",
    "two_factor_authentication_enabled": true,
    "two_factor_authentication_locked": true,
    "zipcode": "12345"
  }
}
```

##### Returns Examples

200 example

```
{
  "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": "6d7f2f5f5b1d4a0e9081fdc98d432fd1",
    "email": "alice@example.com",
    "betas": [
      "zone_level_access_beta"
    ],
    "country": "US",
    "first_name": "John",
    "has_business_zones": true,
    "has_enterprise_zones": true,
    "has_pro_zones": true,
    "last_name": "Appleseed",
    "organizations": [
      {
        "id": "023e105f4ecef8ad9ca31a8372d0c353",
        "name": "Cloudflare, Inc.",
        "permissions": [
          "#zones:read"
        ],
        "roles": [
          "All Privileges - Super Administrator"
        ],
        "status": "member"
      }
    ],
    "suspended": true,
    "telephone": "+1 123-123-1234",
    "two_factor_authentication_enabled": true,
    "two_factor_authentication_locked": true,
    "zipcode": "12345"
  }
}
```