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

    Class DialClient

    Index
    • dial billing — wallet balance, subscription, per-number mode, recent credits, and payment methods.

      Returns Promise<Billing>

    • dial call get <id> — fetch a single call by id.

      Parameters

      • callId: string

      Returns Promise<Call>

    • Every contact, following the cursor until the API reports no more.

      "Who have I talked to" is not answered by a first page, so this is usually the method you want. The page walk is bounded (25 pages of 1000) so a hasMore that never goes false cannot loop forever.

      Parameters

      Returns Promise<Contact[]>

    • dial call list — list calls, optionally filtered.

      Parameters

      Returns Promise<Call[]>

    • dial contacts — one page of the numbers your lines have talked to, newest activity first.

      A contact is derived from message and call history, not stored: a number appears the moment it first exchanges anything with one of your lines, and there is no address book to add anyone to. Counts span every line on the account, so one person who reached two of your numbers is one contact — pass numberId for one line's contacts and counts instead. Groups are not contacts — see listGroups.

      Most accounts come back in one page. listAllContacts follows the cursor when they don't.

      Parameters

      Returns Promise<ContactsPage>

    • dial group list — the group conversations your lines are in.

      A group is a conversation that isn't a phone number, so it carries an id of its own: pass it as groupId to sendMessage or listMessages. Groups exist on WhatsApp lines and iMessage numbers.

      A group's name may be null — it's read live from the line holding the conversation, so an unreachable line yields a null name rather than hiding the group. There's no join event: list again to see a group your line was just added to.

      Returns Promise<Group[]>

    • dial message list — list messages, optionally filtered.

      Unfiltered this is the newest 100 messages ACROSS every conversation. Pass contact to read one person's conversation as itself, groupId for one group's, or search to find a message by its text anywhere in your history.

      Parameters

      Returns Promise<Message[]>

    • dial number list — list the account's phone numbers.

      Returns Promise<PhoneNumber[]>

    • dial lookup — what channels a phone number can receive on.

      Works on ANY number in the world: it needn't be one of yours, and you needn't have messaged it before. Use it to pick a channel before spending a send.

      A lookup Dial couldn't complete REJECTS (502) rather than resolving with a negative verdict, so a false always means the number genuinely isn't reachable on that channel — never that we couldn't find out. The two are worth treating differently: only one is worth retrying.

      Parameters

      • number: string

      Returns Promise<NumberLookup>

    • Open a long-lived connection to the account's event stream.

      This is the SDK equivalent of dial wait-for: rather than returning a single event, it yields every message.received / message.status_changed / call.status_changed / call.ended / call.transcribed / number.status_changed event on the account channel. Iterate it and filter in your own loop:

      const conn = await client.newEventsConnection();
      try {
      for await (const event of conn) {
      if (event.type === "message.received") handle(event);
      }
      } finally {
      await conn.close();
      }

      The PubNub token is re-minted automatically before it expires.

      Returns Promise<EventsConnection>

    • dial typing start — show a typing indicator to the recipient, as if composing a message from your number. iMessage numbers display it; standard (SMS) numbers have no typing concept and silently ignore it, so calling this unconditionally is safe. Fire-and-forget and free. Delivering a message or reaction clears the indicator natively on the recipient's device — start again after a send to keep composing, and pair with stopTyping when you stop without sending (or use typing, whose session renews it after each send and stops it on dispose).

      Parameters

      Returns Promise<void>

    • dial typing stop — clear a typing indicator previously shown with startTyping.

      Parameters

      Returns Promise<void>

    • Scope a typing indicator to a block: starts immediately, stops on disposal.

      await using session = client.typing({ toNumber, fromNumber });
      await session.sendMessage({ body: "…" }); // to/from prefilled

      Returns synchronously with the start request in flight; a start failure surfaces at the next interaction with the session. Without await using (TypeScript 5.2+ / Node 24+), call session.stop() yourself.

      Parameters

      Returns TypingSession