---
title: Edit User
---

[Skip to content](#_top)

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

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

Copy Markdown

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

---

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

# Edit User

client.User.Edit(ctx, body) (\*[UserEditResponse](<https://developers.cloudflare.com/api/go/resources/user#(resource)%20user%20%3E%20(model)%20UserEditResponse%20%3E%20(schema)>), error)

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

<details>

<summary>

body UserEditParams

</summary>

Country param.Field\[string]Optional

The country in which the user lives.

maxLength30

<a href="#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20country">Link to this property</a>

FirstName param.Field\[string]Optional

User’s first name

maxLength60

<a href="#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20first_name">Link to this property</a>

LastName param.Field\[string]Optional

User’s last name

maxLength60

<a href="#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20last_name">Link to this property</a>

Telephone param.Field\[string]Optional

User’s telephone number

maxLength20

<a href="#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20telephone">Link to this property</a>

Zipcode param.Field\[string]Optional

The zipcode or postal code where the user lives.

maxLength20

<a href="#(resource)%20user%20%3E%20(method)%20edit%20%3E%20(params)%20default%20%3E%20(param)%20zipcode">Link to this property</a>

</details>

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

##### ReturnsExpand Collapse

<details>

<summary>

type UserEditResponse struct{…}

</summary>

ID string

Identifier of the user.

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

Email string

Current email address of the user.

formatemail

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

Betas \[]stringOptional

Lists the betas that the user is participating in.

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

Country stringOptional

The country in which the user lives.

maxLength30

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

FirstName stringOptional

User’s first name

maxLength60

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

HasBusinessZones boolOptional

Indicates whether user has any business zones

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

HasEnterpriseZones boolOptional

Indicates whether user has any enterprise zones

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

HasProZones boolOptional

Indicates whether user has any pro zones

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

LastName stringOptional

User’s last name

maxLength60

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

<details>

<summary>

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

</summary>

ID stringOptional

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 stringOptional

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 \[]<a href="https://developers.cloudflare.com/api/go/resources/$shared#(resource)%20%24shared%20%3E%20(model)%20permission%20%3E%20(schema)">Permission</a>Optional

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 \[]stringOptional

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 <a href="https://developers.cloudflare.com/api/go/resources/accounts#(resource)%20accounts.members%20%3E%20(model)%20status%20%3E%20(schema)">Status</a>Optional

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

</summary>

One of the following:

const StatusMember <a href="https://developers.cloudflare.com/api/go/resources/accounts#(resource)%20accounts.members%20%3E%20(model)%20status%20%3E%20(schema)">Status</a> = "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>

const StatusInvited <a href="https://developers.cloudflare.com/api/go/resources/accounts#(resource)%20accounts.members%20%3E%20(model)%20status%20%3E%20(schema)">Status</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)%20UserEditResponse%20%3E%20(schema)%20%3E%20(property)%20organizations">Link to this property</a>

Suspended boolOptional

Indicates whether user has been suspended

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

Telephone stringOptional

User’s telephone number

maxLength20

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

TwoFactorAuthenticationEnabled boolOptional

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)%20UserEditResponse%20%3E%20(schema)%20%3E%20(property)%20two_factor_authentication_enabled">Link to this property</a>

TwoFactorAuthenticationLocked boolOptional

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)%20UserEditResponse%20%3E%20(schema)%20%3E%20(property)%20two_factor_authentication_locked">Link to this property</a>

Zipcode stringOptional

The zipcode or postal code where the user lives.

maxLength20

<a href="#(resource)%20user%20%3E%20(model)%20UserEditResponse%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)%20UserEditResponse%20%3E%20(schema)>)

### Edit User

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  response, err := client.User.Edit(context.TODO(), user.UserEditParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
  }
}
```