Skip to content
Start here

User

User Details
client.user.get(RequestOptionsoptions?): UserGetResponse { id, betas, country, 11 more }
GET/user
Edit User
client.user.edit(UserEditParams { country, first_name, last_name, 2 more } body, RequestOptionsoptions?): UserEditResponse { id, betas, country, 11 more }
PATCH/user
ModelsExpand Collapse
UserGetResponse { id, betas, country, 11 more }
id?: string

Identifier of the user.

betas?: Array<string>

Lists the betas that the user is participating in.

country?: string | null

The country in which the user lives.

maxLength30
first_name?: string | null

User's first name

maxLength60
has_business_zones?: boolean

Indicates whether user has any business zones

has_enterprise_zones?: boolean

Indicates whether user has any enterprise zones

has_pro_zones?: boolean

Indicates whether user has any pro zones

last_name?: string | null

User's last name

maxLength60
organizations?: Array<Organization { id, name, permissions, 2 more } >
id?: string

Identifier

maxLength32
minLength32
name?: string

Organization name.

maxLength100
permissions?: Array<Permission>

Access permissions for this User.

roles?: Array<string>

List of roles that a user has within an organization.

status?: Status

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

suspended?: boolean

Indicates whether user has been suspended

telephone?: string | null

User's telephone number

maxLength20
two_factor_authentication_enabled?: boolean

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

two_factor_authentication_locked?: boolean

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

zipcode?: string | null

The zipcode or postal code where the user lives.

maxLength20
UserEditResponse { id, betas, country, 11 more }
id?: string

Identifier of the user.

betas?: Array<string>

Lists the betas that the user is participating in.

country?: string | null

The country in which the user lives.

maxLength30
first_name?: string | null

User's first name

maxLength60
has_business_zones?: boolean

Indicates whether user has any business zones

has_enterprise_zones?: boolean

Indicates whether user has any enterprise zones

has_pro_zones?: boolean

Indicates whether user has any pro zones

last_name?: string | null

User's last name

maxLength60
organizations?: Array<Organization { id, name, permissions, 2 more } >
id?: string

Identifier

maxLength32
minLength32
name?: string

Organization name.

maxLength100
permissions?: Array<Permission>

Access permissions for this User.

roles?: Array<string>

List of roles that a user has within an organization.

status?: Status

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

suspended?: boolean

Indicates whether user has been suspended

telephone?: string | null

User's telephone number

maxLength20
two_factor_authentication_enabled?: boolean

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

two_factor_authentication_locked?: boolean

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

zipcode?: string | null

The zipcode or postal code where the user lives.

maxLength20

UserAudit Logs

Get user audit logs
client.user.auditLogs.list(AuditLogListParams { id, action, actor, 8 more } query?, RequestOptionsoptions?): V4PagePaginationArray<AuditLog { id, action, actor, 7 more } >
GET/user/audit_logs

UserBilling

UserBillingHistory

Billing History Details
Deprecated
client.user.billing.history.list(HistoryListParams { action, occurred_at, order, 3 more } query?, RequestOptionsoptions?): V4PagePaginationArray<BillingHistory { id, action, amount, 5 more } >
GET/user/billing/history
ModelsExpand Collapse
BillingHistory { id, action, amount, 5 more }
id: string

Billing item identifier tag.

maxLength32
action: string

The billing item action.

maxLength30
amount: number

The amount associated with this billing item.

currency: string

The monetary unit in which pricing information is displayed.

description: string

The billing item description.

maxLength255
occurred_at: string

When the billing item was created.

formatdate-time
type: string

The billing item type.

maxLength30
zone: Zone { name }
name?: string

UserBillingProfile

Billing Profile Details
Deprecated
client.user.billing.profile.get(RequestOptionsoptions?): ProfileGetResponse { id, account_type, address, 36 more }
GET/user/billing/profile
ModelsExpand Collapse
ProfileGetResponse { id, account_type, address, 36 more }
id?: string

Billing item identifier tag.

maxLength32
account_type?: string
address?: string
address2?: string
balance?: string
card_expiry_month?: number
card_expiry_year?: number
card_number?: string
city?: string
company?: string
country?: string
created_on?: string
formatdate-time
device_data?: string
edited_on?: string
formatdate-time
enterprise_billing_email?: string
enterprise_primary_email?: string
first_name?: string
is_partner?: boolean
last_name?: string
next_bill_date?: string
formatdate-time
payment_address?: string
payment_address2?: string
payment_city?: string
payment_country?: string
payment_email?: string
payment_first_name?: string
payment_gateway?: string
payment_last_name?: string
payment_nonce?: string
payment_state?: string
payment_zipcode?: string
primary_email?: string
state?: string
tax_id_type?: string
telephone?: string
use_legacy?: boolean
validation_code?: string
vat?: string
zipcode?: string

UserInvites

List Invitations
client.user.invites.list(RequestOptionsoptions?): SinglePage<Invite { invited_member_id, organization_id, id, 8 more } >
GET/user/invites
Invitation Details
client.user.invites.get(stringinviteId, RequestOptionsoptions?): Invite { invited_member_id, organization_id, id, 8 more }
GET/user/invites/{invite_id}
Respond to Invitation
client.user.invites.edit(stringinviteId, InviteEditParams { status } body, RequestOptionsoptions?): Invite { invited_member_id, organization_id, id, 8 more }
PATCH/user/invites/{invite_id}
ModelsExpand Collapse
Invite { invited_member_id, organization_id, id, 8 more }
invited_member_id: string | null

ID of the user to add to the organization.

maxLength32
organization_id: string

ID of the organization the user will be added to.

maxLength32
id?: string

Invite identifier tag.

maxLength32
expires_on?: string

When the invite is no longer active.

formatdate-time
invited_by?: string

The email address of the user who created the invite.

maxLength90
invited_member_email?: string

Email address of the user to add to the organization.

maxLength90
invited_on?: string

When the invite was sent.

formatdate-time
organization_is_enforcing_twofactor?: boolean
organization_name?: string

Organization name.

maxLength100
roles?: Array<string>

List of role names the membership has for this account.

status?: "pending" | "accepted" | "rejected" | "expired"

Current status of the invitation.

One of the following:
"pending"
"accepted"
"rejected"
"expired"

UserOrganizations

List Organizations
Deprecated
client.user.organizations.list(OrganizationListParams { direction, match, name, 4 more } query?, RequestOptionsoptions?): V4PagePaginationArray<Organization { id, name, permissions, 2 more } >
GET/user/organizations
Organization Details
Deprecated
client.user.organizations.get(stringorganizationId, RequestOptionsoptions?): OrganizationGetResponse
GET/user/organizations/{organization_id}
Leave Organization
Deprecated
client.user.organizations.delete(stringorganizationId, RequestOptionsoptions?): OrganizationDeleteResponse { id }
DELETE/user/organizations/{organization_id}
ModelsExpand Collapse
Organization { id, name, permissions, 2 more }
id?: string

Identifier

maxLength32
minLength32
name?: string

Organization name.

maxLength100
permissions?: Array<Permission>

Access permissions for this User.

roles?: Array<string>

List of roles that a user has within an organization.

status?: Status

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

OrganizationGetResponse = unknown
OrganizationDeleteResponse { id }
id?: string

Identifier

maxLength32
minLength32

UserSubscriptions

Get User Subscriptions
client.user.subscriptions.get(RequestOptionsoptions?): SinglePage<Subscription { id, currency, current_period_end, 5 more } >
GET/user/subscriptions
Update User Subscription
client.user.subscriptions.update(stringidentifier, SubscriptionUpdateParams { frequency, rate_plan } body, RequestOptionsoptions?): SubscriptionUpdateResponse
PUT/user/subscriptions/{identifier}
Delete User Subscription
client.user.subscriptions.delete(stringidentifier, RequestOptionsoptions?): SubscriptionDeleteResponse { subscription_id }
DELETE/user/subscriptions/{identifier}
ModelsExpand Collapse
SubscriptionUpdateResponse = unknown | string | null
One of the following:
unknown
string | null
SubscriptionDeleteResponse { subscription_id }
subscription_id?: string

Subscription identifier tag.

maxLength32

UserTokens

List Tokens
client.user.tokens.list(TokenListParams { direction, page, per_page } query?, RequestOptionsoptions?): V4PagePaginationArray<Token { id, condition, expires_on, 7 more } >
GET/user/tokens
Token Details
client.user.tokens.get(stringtokenId, RequestOptionsoptions?): Token { id, condition, expires_on, 7 more }
GET/user/tokens/{token_id}
Create Token
client.user.tokens.create(TokenCreateParams { name, policies, condition, 2 more } body, RequestOptionsoptions?): TokenCreateResponse { id, condition, expires_on, 8 more }
POST/user/tokens
Update Token
client.user.tokens.update(stringtokenId, TokenUpdateParams { name, policies, condition, 3 more } body, RequestOptionsoptions?): Token { id, condition, expires_on, 7 more }
PUT/user/tokens/{token_id}
Delete Token
client.user.tokens.delete(stringtokenId, RequestOptionsoptions?): TokenDeleteResponse { id } | null
DELETE/user/tokens/{token_id}
Verify Token
client.user.tokens.verify(RequestOptionsoptions?): TokenVerifyResponse { id, status, expires_on, not_before }
GET/user/tokens/verify
ModelsExpand Collapse
TokenCreateResponse { id, condition, expires_on, 8 more }
id?: string

Token identifier tag.

maxLength32
condition?: Condition { request_ip }
request_ip?: RequestIP { in, not_in }

Client IP restrictions.

List of IPv4/IPv6 CIDR addresses.

not_in?: Array<TokenConditionCIDRList>

List of IPv4/IPv6 CIDR addresses.

expires_on?: string

The expiration time on or after which the JWT MUST NOT be accepted for processing.

formatdate-time
issued_on?: string

The time on which the token was created.

formatdate-time
last_used_on?: string

Last time the token was used.

formatdate-time
modified_on?: string

Last time the token was modified.

formatdate-time
name?: string

Token name.

maxLength120
not_before?: string

The time before which the token MUST NOT be accepted for processing.

formatdate-time
policies?: Array<TokenPolicy { id, effect, permission_groups, resources } >

List of access policies assigned to the token.

id: string

Policy identifier.

effect: "allow" | "deny"

Allow or deny operations against the resources.

One of the following:
"allow"
"deny"
permission_groups: Array<PermissionGroup>

A set of permission groups that are specified to the policy.

id: string

Identifier of the permission group.

meta?: Meta { key, value }

Attributes associated to the permission group.

key?: string
value?: string
name?: string

Name of the permission group.

resources: Record<string, string> | Record<string, Record<string, string>>

A list of resource names that the policy applies to.

One of the following:
Record<string, string>
Record<string, Record<string, string>>
status?: "active" | "disabled" | "expired"

Status of the token.

One of the following:
"active"
"disabled"
"expired"
value?: TokenValue

The token value.

maxLength80
minLength40
TokenDeleteResponse { id }
id: string

Identifier

maxLength32
minLength32
TokenVerifyResponse { id, status, expires_on, not_before }
id: string

Token identifier tag.

maxLength32
status: "active" | "disabled" | "expired"

Status of the token.

One of the following:
"active"
"disabled"
"expired"
expires_on?: string

The expiration time on or after which the JWT MUST NOT be accepted for processing.

formatdate-time
not_before?: string

The time before which the token MUST NOT be accepted for processing.

formatdate-time

UserTokensPermission Groups

List Token Permission Groups
client.user.tokens.permissionGroups.list(PermissionGroupListParams { name, scope } query?, RequestOptionsoptions?): SinglePage<PermissionGroupListResponse { id, name, scopes } >
GET/user/tokens/permission_groups
ModelsExpand Collapse
PermissionGroupListResponse { id, name, scopes }
id?: string

Public ID.

name?: string

Permission Group Name

scopes?: Array<"com.cloudflare.api.account" | "com.cloudflare.api.account.zone" | "com.cloudflare.api.user" | "com.cloudflare.edge.r2.bucket">

Resources to which the Permission Group is scoped

One of the following:
"com.cloudflare.api.account"
"com.cloudflare.api.account.zone"
"com.cloudflare.api.user"
"com.cloudflare.edge.r2.bucket"

UserTokensValue

Roll Token
client.user.tokens.value.update(stringtokenId, ValueUpdateParams { body } body, RequestOptionsoptions?): TokenValue
PUT/user/tokens/{token_id}/value