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
IdstringThe unique invitation identifier.
InvitedMemberEmailstringThe email address the invitation was sent to.
StatusMemberStatusThe invitation status (pending, accepted, or rejected).
InvitedOnDateTimeWhen the invitation was sent.
ExpiresOnDateTimeWhen the invitation expires.
OrganizationNamestringThe name of the account the user is invited to join.
RolesIReadOnlyList<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
Id
The unique invitation identifier.
[JsonPropertyName("id")]
public string Id { get; init; }
Property Value
InvitedMemberEmail
The email address the invitation was sent to.
[JsonPropertyName("invited_member_email")]
public string InvitedMemberEmail { get; init; }
Property Value
InvitedOn
When the invitation was sent.
[JsonPropertyName("invited_on")]
[JsonConverter(typeof(CloudflareDateTimeConverter))]
public DateTime InvitedOn { get; init; }
Property Value
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
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
Status
The invitation status (pending, accepted, or rejected).
[JsonPropertyName("status")]
public MemberStatus Status { get; init; }