Table of Contents

Class ApiToken

Namespace
Cloudflare.NET.ApiTokens.Models
Assembly
Cloudflare.NET.dll

Represents an account-owned API token.

API tokens provide fine-grained access control for Cloudflare API operations. Each token has policies that define what resources and actions are allowed.

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

Constructors

ApiToken(string, string, TokenStatus, DateTime, DateTime, IReadOnlyList<TokenPolicy>, DateTime?, DateTime?, DateTime?, TokenCondition?)

Represents an account-owned API token.

API tokens provide fine-grained access control for Cloudflare API operations. Each token has policies that define what resources and actions are allowed.

public ApiToken(string Id, string Name, TokenStatus Status, DateTime IssuedOn, DateTime ModifiedOn, IReadOnlyList<TokenPolicy> Policies, DateTime? ExpiresOn = null, DateTime? NotBefore = null, DateTime? LastUsedOn = null, TokenCondition? Condition = null)

Parameters

Id string

Token identifier.

Name string

Human-readable token name.

Status TokenStatus

Current token status.

IssuedOn DateTime

When the token was created.

ModifiedOn DateTime

When the token was last modified.

Policies IReadOnlyList<TokenPolicy>

Token policies defining permissions.

ExpiresOn DateTime?

When the token expires. Null if no expiration.

NotBefore DateTime?

Token is not valid before this time.

LastUsedOn DateTime?

When the token was last used.

Condition TokenCondition

IP-based access restrictions.

Properties

Condition

IP-based access restrictions.

[JsonPropertyName("condition")]
public TokenCondition? Condition { get; init; }

Property Value

TokenCondition

ExpiresOn

When the token expires. Null if no expiration.

[JsonPropertyName("expires_on")]
public DateTime? ExpiresOn { get; init; }

Property Value

DateTime?

Id

Token identifier.

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

Property Value

string

IssuedOn

When the token was created.

[JsonPropertyName("issued_on")]
public DateTime IssuedOn { get; init; }

Property Value

DateTime

LastUsedOn

When the token was last used.

[JsonPropertyName("last_used_on")]
public DateTime? LastUsedOn { get; init; }

Property Value

DateTime?

ModifiedOn

When the token was last modified.

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

Property Value

DateTime

Name

Human-readable token name.

[JsonPropertyName("name")]
public string Name { get; init; }

Property Value

string

NotBefore

Token is not valid before this time.

[JsonPropertyName("not_before")]
public DateTime? NotBefore { get; init; }

Property Value

DateTime?

Policies

Token policies defining permissions.

[JsonPropertyName("policies")]
public IReadOnlyList<TokenPolicy> Policies { get; init; }

Property Value

IReadOnlyList<TokenPolicy>

Status

Current token status.

[JsonPropertyName("status")]
public TokenStatus Status { get; init; }

Property Value

TokenStatus