Skip to content

Contacts data types ​

Fields below are declared serialized members. Base types contribute their own fields; related types link the payload graph. ? means nullable, and required marks a required C# initializer. These are schematic C# contract shapes, not compilable declarations or a separate JSON schema. Constructor members are repeated in the field list for easy scanning. Serialization attributes and implementation helpers are omitted; use the linked source for exact wire aliases and formatters.

ChatIdRange ​

A chat and the range of its entry local IDs, as IContacts.ListChatIdRanges returns it. The chat's last entry ID is IdRange.End - 1. Source

csharp
public sealed partial record ChatIdRange(
    ChatId ChatId,
    Range<long> IdRange
)
{
    ChatId ChatId;
    Range<long> IdRange;
}

Related types: ChatId, Range.

Contact ​

Represents a user's contact entry (chat, user, or place). ArchivedAt is set for a contact that is in the archive rather than in the contact list. Source

csharp
public sealed partial record Contact(
    ContactId Id,
    long Version = 0
) : IHasId<ContactId>, IHasVersion<long>, IRequirementTarget
{
    ContactId Id;
    long Version;
    UserId? UserId;
    Moment TouchedAt;
    bool IsPinned;
    string PeerContactName;
    Symbol SystemTag;
    string ExternalContactName;
    ContactState State;
    bool IsBlockedByPeer;
    Moment? ArchivedAt;
    Account? Account;
    Chat.Chat Chat;
}

Related types: Account, Chat, ContactId, ContactState, UserId.

ContactState ​

Describes how a contact should participate in contact-list and peer-chat rules. Source

csharp
public enum ContactState
{
    Temporary = 0,
    Regular = 0x10,
    Blocked = 0x1000,
}

ContactSubset ​

Selects the contacts a list method covers: everything (the chats outside places plus every place of the caller), the chats outside places, or one place. The constructor is private; create a value with ContactSubset.All(), ContactSubset.Chats() or ContactSubset.Place(placeId). It is serialized as a map with Kind and PlaceId keys. Source

csharp
public partial class ContactSubset : IEquatable<ContactSubset>
{
    ContactSubsetKind Kind;
    PlaceId? PlaceId;
}

Related types: ContactSubsetKind, PlaceId.

ContactSubsetKind ​

Defines the category of contacts to query. Source

csharp
public enum ContactSubsetKind
{
    All,
    Chats,
    Place,
}

ContactSummary ​

What a chat list row needs about a chat beyond its news and read position, in one call: the contact, the caller's last mention in the chat, and the caller's settings for the chat. ChatUserSettings is a stored settings record; stored settings are not described in this reference. Source

csharp
public sealed partial record ContactSummary(
    Contact Contact,
    Mention? LastOwnMention,
    ChatUserSettings ChatUserSettings
)
{
    Contact Contact;
    Mention? LastOwnMention;
    ChatUserSettings ChatUserSettings;
}

Related types: Contact, Mention.

Contacts_Archive ​

Command payload for contacts archive: moves a contact from the contact list to the archive. Source

csharp
public sealed partial record Contacts_Archive : ApiCommand<Unit>
{
    required ContactId Id;
}

Related types: ApiCommand, ContactId.

Contacts_Change ​

Command payload for contacts change. Source

csharp
public sealed partial record Contacts_Change : ApiCommand<Contact?>
{
    required ContactId Id;
    required long? ExpectedVersion;
    required Change<Contact> Change;
}

Related types: ApiCommand, Change, Contact, ContactId.

Contacts_SetIsBlocked ​

Command payload for contacts set is blocked. Source

csharp
public sealed partial record Contacts_SetIsBlocked : ApiCommand<Unit>
{
    required ContactId Id;
    required bool IsBlocked;
}

Related types: ApiCommand, ContactId.

Contacts_Touch ​

Command payload for contacts touch. Source

csharp
public sealed partial record Contacts_Touch : ApiCommand<Unit>
{
    required ContactId Id;
}

Related types: ApiCommand, ContactId.

Contacts_Unarchive ​

Command payload for contacts unarchive: returns an archived contact to the contact list. Source

csharp
public sealed partial record Contacts_Unarchive : ApiCommand<Unit>
{
    required ContactId Id;
}

Related types: ApiCommand, ContactId.

ExternalContact ​

Represents a contact imported from the device's address book. Source

csharp
public partial record ExternalContact(
    ExternalContactId Id,
    long Version = 0
) : IHasId<ExternalContactId>, IHasVersion<long>, IRequirementTarget
{
    ExternalContactId Id;
    long Version;
    HashString Hash;
}

Related types: ExternalContactId, HashString.

ExternalContactChange ​

External Contact Change contract used by the API operations and related records below. Source

csharp
public sealed partial record ExternalContactChange(
    ExternalContactId Id,
    long? ExpectedVersion,
    Change<ExternalContactFull> Change
)
{
    ExternalContactId Id;
    long? ExpectedVersion;
    Change<ExternalContactFull> Change;
}

Related types: Change, ExternalContactFull, ExternalContactId.

ExternalContactFull ​

Extended external contact with full name components and contact info hashes. Source

csharp
public partial record ExternalContactFull(
    ExternalContactId Id,
    long Version = 0
) : ExternalContact(Id, Version)
{
    string DisplayName;
    string GivenName;
    string FamilyName;
    string MiddleName;
    string NamePrefix;
    string NameSuffix;
    ApiSet<string> PhoneHashes;
    ApiSet<string> EmailHashes;
    Moment CreatedAt;
    Moment ModifiedAt;
}

Related types: ExternalContact.

ExternalContactHashes_Change ​

Command payload for external contact hashes change. Source

csharp
public sealed partial record ExternalContactHashes_Change
    : ApiCommand<ExternalContactsHash?>
{
    required Symbol DeviceId;
    required long? ExpectedVersion;
    required Change<ExternalContactsHash> Change;
}

Related types: ApiCommand, Change, ExternalContactsHash.

ExternalContactsHash ​

Stores the combined hash of all external contacts for a user device. Source

csharp
public sealed partial record ExternalContactsHash(
    UserDeviceId Id,
    long Version = 0
) : IHasId<UserDeviceId>, IHasVersion<long>, IRequirementTarget
{
    UserDeviceId Id;
    long Version;
    HashString Hash;
    Moment CreatedAt;
    Moment ModifiedAt;
}

Related types: HashString, UserDeviceId.

ExternalContacts_BulkChange ​

Command payload for external contacts bulk change. Source

csharp
public sealed partial record ExternalContacts_BulkChange
    : ApiCommand<Result<ExternalContactFull?>[]>
{
    required ExternalContactChange[] Changes;
}

Related types: ApiCommand, ExternalContactChange, ExternalContactFull.

UnreadChat ​

A chat with unread entries, as IContacts.ListUnreadChats returns it: the caller's read position (never before the chat's first entry) and the chat's last entry ID. The unread count is LastEntryLid - ReadEntryLid. Source

csharp
public sealed partial record UnreadChat(
    ChatId ChatId,
    long ReadEntryLid,
    long LastEntryLid
)
{
    ChatId ChatId;
    long ReadEntryLid;
    long LastEntryLid;
}

Related types: ChatId.