Skip to content
Start here

Tokens

List Tokens
client.accounts.tokens.list(TokenListParams { account_id, direction, page, per_page } params, RequestOptionsoptions?): V4PagePaginationArray<Token { id, condition, expires_on, 7 more } >
GET/accounts/{account_id}/tokens
Token Details
client.accounts.tokens.get(stringtokenId, TokenGetParams { account_id } params, RequestOptionsoptions?): Token { id, condition, expires_on, 7 more }
GET/accounts/{account_id}/tokens/{token_id}
Create Token
client.accounts.tokens.create(TokenCreateParams { account_id, name, policies, 3 more } params, RequestOptionsoptions?): TokenCreateResponse { id, condition, expires_on, 8 more }
POST/accounts/{account_id}/tokens
Update Token
client.accounts.tokens.update(stringtokenId, TokenUpdateParams { account_id, name, policies, 4 more } params, RequestOptionsoptions?): Token { id, condition, expires_on, 7 more }
PUT/accounts/{account_id}/tokens/{token_id}
Delete Token
client.accounts.tokens.delete(stringtokenId, TokenDeleteParams { account_id } params, RequestOptionsoptions?): TokenDeleteResponse { id } | null
DELETE/accounts/{account_id}/tokens/{token_id}
Verify Token
client.accounts.tokens.verify(TokenVerifyParams { account_id } params, RequestOptionsoptions?): TokenVerifyResponse { id, status, expires_on, not_before }
GET/accounts/{account_id}/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

TokensPermission Groups

List Permission Groups
client.accounts.tokens.permissionGroups.list(PermissionGroupListParams { account_id, name, scope } params, RequestOptionsoptions?): SinglePage<PermissionGroupListResponse { id, name, scopes } >
GET/accounts/{account_id}/tokens/permission_groups
List Permission Groups
client.accounts.tokens.permissionGroups.get(PermissionGroupGetParams { account_id, name, scope } params, RequestOptionsoptions?): PermissionGroupGetResponse { id, name, scopes }
GET/accounts/{account_id}/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"
PermissionGroupGetResponse = Array<PermissionGroupGetResponseItem>
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"

TokensValue

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