@getdial/sdk - v0.38.0
    Preparing search index...

    Interface Contact

    One phone number the account's lines have talked to.

    Derived from message and call history rather than stored: there is no address book to add anyone to, so a contact has no id and the number is its identity.

    interface Contact {
        callCount: number;
        lastAt: string;
        lastBody: string;
        lastCallDuration: number | null;
        lastDirection: "inbound" | "outbound";
        lastKind: "call" | "message";
        lastMediaCount: number;
        lastRedacted: boolean;
        messageCount: number;
        number: string;
    }
    Index
    callCount: number

    Calls with this contact across every line on the account, both directions.

    lastAt: string

    ISO-8601: when the most recent message or call happened. The list is ordered by this, newest first, and it is the startingAfter cursor for the next page.

    lastBody: string

    The most recent message's text, for a preview line. Empty for a call, for a media-only message, and for one data retention has cleared — lastKind, lastMediaCount and lastRedacted tell those three apart.

    lastCallDuration: number | null

    The most recent call's duration in seconds, or null when the most recent interaction was a message. 0 is a real duration — a call that never connected.

    lastDirection: "inbound" | "outbound"
    lastKind: "call" | "message"

    Which of lastBody / lastCallDuration carries anything.

    lastMediaCount: number

    Attachments on the most recent message; 0 for a call or a text-only message.

    lastRedacted: boolean

    True when data retention cleared the most recent message's content.

    messageCount: number

    One-to-one messages with this contact across EVERY line on the account, both directions. Group messages are excluded.

    number: string

    The contact's number, E.164. Pass it as contact to DialClient.listMessages.