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
IdstringToken identifier.
NamestringHuman-readable token name.
StatusTokenStatusCurrent token status.
IssuedOnDateTimeWhen the token was created.
ModifiedOnDateTimeWhen the token was last modified.
PoliciesIReadOnlyList<TokenPolicy>Token policies defining permissions.
ExpiresOnDateTime?When the token expires. Null if no expiration.
NotBeforeDateTime?Token is not valid before this time.
LastUsedOnDateTime?When the token was last used.
ConditionTokenConditionIP-based access restrictions.
Properties
Condition
IP-based access restrictions.
[JsonPropertyName("condition")]
public TokenCondition? Condition { get; init; }
Property Value
ExpiresOn
When the token expires. Null if no expiration.
[JsonPropertyName("expires_on")]
public DateTime? ExpiresOn { get; init; }
Property Value
Id
Token identifier.
[JsonPropertyName("id")]
public string Id { get; init; }
Property Value
IssuedOn
When the token was created.
[JsonPropertyName("issued_on")]
public DateTime IssuedOn { get; init; }
Property Value
LastUsedOn
When the token was last used.
[JsonPropertyName("last_used_on")]
public DateTime? LastUsedOn { get; init; }
Property Value
ModifiedOn
When the token was last modified.
[JsonPropertyName("modified_on")]
public DateTime ModifiedOn { get; init; }
Property Value
Name
Human-readable token name.
[JsonPropertyName("name")]
public string Name { get; init; }
Property Value
NotBefore
Token is not valid before this time.
[JsonPropertyName("not_before")]
public DateTime? NotBefore { get; init; }
Property Value
Policies
Token policies defining permissions.
[JsonPropertyName("policies")]
public IReadOnlyList<TokenPolicy> Policies { get; init; }
Property Value
Status
Current token status.
[JsonPropertyName("status")]
public TokenStatus Status { get; init; }