Type Alias ClientMessageRequest

ClientMessageRequest: {
    biz_opaque_callback_data?: string;
    context?: {
        message_id: string;
    };
    messaging_product: "whatsapp";
    recipient_type: "individual";
    to: string;
} & (
    | {
        text?: string;
        type: "text";
    }
    | {
        audio?: string;
        type: "audio";
    }
    | {
        document?: string;
        type: "document";
    }
    | {
        image?: string;
        type: "image";
    }
    | {
        sticker?: string;
        type: "sticker";
    }
    | {
        type: "video";
        video?: string;
    }
    | {
        location?: string;
        type: "location";
    }
    | {
        contacts?: string;
        type: "contacts";
    }
    | {
        interactive?: string;
        type: "interactive";
    }
    | {
        template?: string;
        type: "template";
    }
    | {
        reaction?: string;
        type: "reaction";
    })

Type declaration

  • Optionalbiz_opaque_callback_data?: string

    An arbitrary 512B string, useful for tracking.

    Any app subscribed to the messages webhook field on the WhatsApp Business Account can get this string, as it is included in statuses object within webhook payloads.

    Cloud API does not process this field, it just returns it as part of sent/delivered/read message webhooks.

  • Optionalcontext?: {
        message_id: string;
    }

    The message to reply to

    • message_id: string

      The message id to reply to

  • messaging_product: "whatsapp"

    The messaging product

  • recipient_type: "individual"

    Currently you can only send messages to individuals

  • to: string

    The user's phone number