whatsapp-api-js - v6.2.2
    Preparing search index...

    Type Alias ServerContacts

    type ServerContacts = {
        identity_key_hash?: string;
        parent_user_id?: string;
        profile?: { name?: string; username?: string };
        user_id: string;
        wa_id?: string;
    }
    Index

    Properties

    identity_key_hash?: string
    parent_user_id?: string

    Will be set to the user’s parent BSUID if you have enabled parent BSUIDs

    profile?: { name?: string; username?: string }

    Type Declaration

    • Optionalname?: string

      Value will be set to the WhatsApp user’s display name

    • Optionalusername?: string

      Will be set to the WhatsApp user’s username if the user has enabled the usernames feature, will be omitted entirely for sent status messages webhooks, or if the user has not enabled the usernames feature

    user_id: string

    Will be set to the WhatsApp user’s BSUID

    I think there's one super edge case scenario where user_id isn't present at all:

    • A) A message is sent using only phone number or parent BSUID, so following statuses won't include recipient_user_id in statuses
    • B) A failed status event is received for that specific message, which will not include a contacts entry due to failed event's nature
    • Given A) and B), there's no way to know the user_id in the failed status

    Other status events should work fine, as they will always include contacts.

    Internally, the library will always populate the recipients with as much data as possible, prioritizing the parent BSUIDs over user_id. This (SHOULD) ensure at least one BSUID will be available on every status event.

    If you need a consistent user key across all events, consider using (parent_user_id ?? user_id).

    This is a guesstimate, can't tell for sure until BSUIDs are operational.

    Such a weird restriction to not include the contacts data on failed events...

    wa_id?: string

    User phone number, will be omitted if the user has enabled the usernames feature, will be set to the user’s phone number if you sent the message to the user’s phone number