Table of Contents

Class UserInvitation

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

Represents an invitation for a user to join an account.

Invitations are sent by account administrators and received by users. Users can accept or reject invitations through the User Invitations API.

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

Remarks

User-Scoped: These invitations are the ones sent TO the authenticated user, not invitations sent BY the user. Use the Account Members API (F09) to send invitations.

One-Time Response: Each invitation can only be responded to once. After accepting or rejecting, the status cannot be changed.

Constructors

UserInvitation(string, string, MemberStatus, DateTime, DateTime, string?, IReadOnlyList<string>?)

Represents an invitation for a user to join an account.

Invitations are sent by account administrators and received by users. Users can accept or reject invitations through the User Invitations API.

public UserInvitation(string Id, string InvitedMemberEmail, MemberStatus Status, DateTime InvitedOn, DateTime ExpiresOn, string? OrganizationName = null, IReadOnlyList<string>? Roles = null)

Parameters

Id string

The unique invitation identifier.

InvitedMemberEmail string

The email address the invitation was sent to.

Status MemberStatus

The invitation status (pending, accepted, or rejected).

InvitedOn DateTime

When the invitation was sent.

ExpiresOn DateTime

When the invitation expires.

OrganizationName string

The name of the account the user is invited to join.

Roles IReadOnlyList<string>

The role names that will be assigned upon acceptance (e.g., "Super Administrator - All Privileges").

Remarks

User-Scoped: These invitations are the ones sent TO the authenticated user, not invitations sent BY the user. Use the Account Members API (F09) to send invitations.

One-Time Response: Each invitation can only be responded to once. After accepting or rejecting, the status cannot be changed.

Properties

ExpiresOn

When the invitation expires.

[JsonPropertyName("expires_on")]
[JsonConverter(typeof(CloudflareDateTimeConverter))]
public DateTime ExpiresOn { get; init; }

Property Value

DateTime

Id

The unique invitation identifier.

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

Property Value

string

InvitedMemberEmail

The email address the invitation was sent to.

[JsonPropertyName("invited_member_email")]
public string InvitedMemberEmail { get; init; }

Property Value

string

InvitedOn

When the invitation was sent.

[JsonPropertyName("invited_on")]
[JsonConverter(typeof(CloudflareDateTimeConverter))]
public DateTime InvitedOn { get; init; }

Property Value

DateTime

OrganizationName

The name of the account the user is invited to join.

[JsonPropertyName("organization_name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? OrganizationName { get; init; }

Property Value

string

Roles

The role names that will be assigned upon acceptance (e.g., "Super Administrator - All Privileges").

[JsonPropertyName("roles")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public IReadOnlyList<string>? Roles { get; init; }

Property Value

IReadOnlyList<string>

Status

The invitation status (pending, accepted, or rejected).

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

Property Value

MemberStatus