Table of Contents

Class User

Namespace
Cloudflare.NET.User.Models
Assembly
Cloudflare.NET.dll

Represents the authenticated user's profile.

Contains all user information including email, name, contact details, security settings, subscription tier flags, and organization memberships.

public record User : IEquatable<User>
Inheritance
User
Implements
Inherited Members

Remarks

Only a subset of fields can be edited via the API: FirstName, LastName, Country, Telephone, and Zipcode. Email, suspension status, and 2FA settings are managed through separate flows.

Constructors

User(string, string, string?, string?, string?, string?, string?, bool, bool, bool, bool, bool, bool, IReadOnlyList<string>?, IReadOnlyList<UserOrganization>?, DateTime?, DateTime?)

Represents the authenticated user's profile.

Contains all user information including email, name, contact details, security settings, subscription tier flags, and organization memberships.

public User(string Id, string Email, string? FirstName, string? LastName, string? Telephone, string? Country, string? Zipcode, bool Suspended, bool TwoFactorAuthenticationEnabled, bool TwoFactorAuthenticationLocked = false, bool HasProZones = false, bool HasBusinessZones = false, bool HasEnterpriseZones = false, IReadOnlyList<string>? Betas = null, IReadOnlyList<UserOrganization>? Organizations = null, DateTime? CreatedOn = null, DateTime? ModifiedOn = null)

Parameters

Id string

User identifier (32 hexadecimal characters).

Email string

User's email address.

FirstName string

User's first name.

LastName string

User's last name.

Telephone string

User's telephone number (international format, e.g., "+1-555-555-5555").

Country string

User's country (ISO 3166-1 alpha-2 code, e.g., "US", "GB", "DE").

Zipcode string

User's postal/zip code.

Suspended bool

Whether the user account is suspended.

TwoFactorAuthenticationEnabled bool

Whether two-factor authentication is enabled for this user.

TwoFactorAuthenticationLocked bool

Whether two-factor authentication is locked (cannot be disabled). This is typically set by enterprise security policies.

HasProZones bool

Whether the user has any zones on the Pro plan.

HasBusinessZones bool

Whether the user has any zones on the Business plan.

HasEnterpriseZones bool

Whether the user has any zones on the Enterprise plan.

Betas IReadOnlyList<string>

Beta features the user has access to.

Organizations IReadOnlyList<UserOrganization>

Organizations the user belongs to (deprecated, use Accounts instead).

CreatedOn DateTime?

When the user account was created.

ModifiedOn DateTime?

When the user profile was last modified.

Remarks

Only a subset of fields can be edited via the API: FirstName, LastName, Country, Telephone, and Zipcode. Email, suspension status, and 2FA settings are managed through separate flows.

See Also

Properties

Betas

Beta features the user has access to.

[JsonPropertyName("betas")]
public IReadOnlyList<string>? Betas { get; init; }

Property Value

IReadOnlyList<string>

Country

User's country (ISO 3166-1 alpha-2 code, e.g., "US", "GB", "DE").

[JsonPropertyName("country")]
public string? Country { get; init; }

Property Value

string

CreatedOn

When the user account was created.

[JsonPropertyName("created_on")]
public DateTime? CreatedOn { get; init; }

Property Value

DateTime?

Email

User's email address.

[JsonPropertyName("email")]
public string Email { get; init; }

Property Value

string

FirstName

User's first name.

[JsonPropertyName("first_name")]
public string? FirstName { get; init; }

Property Value

string

HasBusinessZones

Whether the user has any zones on the Business plan.

[JsonPropertyName("has_business_zones")]
public bool HasBusinessZones { get; init; }

Property Value

bool

HasEnterpriseZones

Whether the user has any zones on the Enterprise plan.

[JsonPropertyName("has_enterprise_zones")]
public bool HasEnterpriseZones { get; init; }

Property Value

bool

HasProZones

Whether the user has any zones on the Pro plan.

[JsonPropertyName("has_pro_zones")]
public bool HasProZones { get; init; }

Property Value

bool

Id

User identifier (32 hexadecimal characters).

[JsonPropertyName("id")]
public string Id { get; init; }

Property Value

string

LastName

User's last name.

[JsonPropertyName("last_name")]
public string? LastName { get; init; }

Property Value

string

ModifiedOn

When the user profile was last modified.

[JsonPropertyName("modified_on")]
public DateTime? ModifiedOn { get; init; }

Property Value

DateTime?

Organizations

Organizations the user belongs to (deprecated, use Accounts instead).

[JsonPropertyName("organizations")]
public IReadOnlyList<UserOrganization>? Organizations { get; init; }

Property Value

IReadOnlyList<UserOrganization>

Suspended

Whether the user account is suspended.

[JsonPropertyName("suspended")]
public bool Suspended { get; init; }

Property Value

bool

Telephone

User's telephone number (international format, e.g., "+1-555-555-5555").

[JsonPropertyName("telephone")]
public string? Telephone { get; init; }

Property Value

string

TwoFactorAuthenticationEnabled

Whether two-factor authentication is enabled for this user.

[JsonPropertyName("two_factor_authentication_enabled")]
public bool TwoFactorAuthenticationEnabled { get; init; }

Property Value

bool

TwoFactorAuthenticationLocked

Whether two-factor authentication is locked (cannot be disabled). This is typically set by enterprise security policies.

[JsonPropertyName("two_factor_authentication_locked")]
public bool TwoFactorAuthenticationLocked { get; init; }

Property Value

bool

Zipcode

User's postal/zip code.

[JsonPropertyName("zipcode")]
public string? Zipcode { get; init; }

Property Value

string

See Also