/** * WhatsApp Business Cloud Node - Version 1.1 * Discriminator: resource=message, operation=send */ interface Credentials { whatsAppApi: CredentialReference; } export type WhatsAppV11MessageSendParams = { resource: 'message'; operation: 'send'; /** * Messaging Product * @default whatsapp */ messagingProduct?: unknown; /** * The ID of the business account's phone number from which the message will be sent from */ phoneNumberId?: string | Expression; /** * Phone number of the recipient of the message * @hint When entering a phone number, make sure to include the country code */ recipientPhoneNumber?: string | Expression | PlaceholderValue; /** * The type of the message * @default text */ messageType?: 'audio' | 'contacts' | 'document' | 'image' | 'location' | 'text' | 'video'; /** * Name * @displayOptions.show { messageType: ["contacts"] } * @default {} */ name?: { /** Name */ data?: { /** Formatted Name */ formatted_name?: string | Expression | PlaceholderValue; /** First Name */ first_name?: string | Expression | PlaceholderValue; /** Last Name */ last_name?: string | Expression | PlaceholderValue; /** Middle Name */ middle_name?: string | Expression | PlaceholderValue; /** Suffix */ suffix?: string | Expression | PlaceholderValue; /** Prefix */ prefix?: string | Expression | PlaceholderValue; }; }; /** * Additional Fields * @displayOptions.show { messageType: ["contacts", "location", "image", "video", "audio", "sticker", "document", "text"] } * @default {} */ additionalFields?: { /** Addresses * @default {} */ addresses?: { /** Address */ address?: Array<{ /** Type * @default HOME */ type?: 'HOME' | 'WORK' | Expression; /** Street */ street?: string | Expression | PlaceholderValue; /** City */ city?: string | Expression | PlaceholderValue; /** State */ state?: string | Expression | PlaceholderValue; /** Zip */ zip?: string | Expression | PlaceholderValue; /** Country */ country?: string | Expression | PlaceholderValue; /** Country Code */ country_code?: string | Expression | PlaceholderValue; }>; }; /** Birthday */ birthday?: string | Expression | PlaceholderValue; /** Emails * @default {} */ emails?: { /** Email */ data?: Array<{ /** Type * @default HOME */ type?: 'HOME' | 'WORK' | Expression; /** Email */ email?: string | Expression | PlaceholderValue; }>; }; /** Organization * @default {} */ organization?: { /** Organization */ data?: { /** Company */ company?: string | Expression | PlaceholderValue; /** Department */ department?: string | Expression | PlaceholderValue; /** Title */ title?: string | Expression | PlaceholderValue; }; }; /** Phones * @default {} */ phones?: { /** Phone */ data?: Array<{ /** Type * @default CELL */ type?: 'CELL' | 'HOME' | 'IPHONE' | 'MAIN' | 'wa_id' | 'WORK' | Expression; /** Type * @default CELL */ type?: 'CELL' | 'HOME' | 'IPHONE' | 'MAIN' | 'WORK' | Expression; /** Phone */ phone?: string | Expression | PlaceholderValue; /** If omitted, the message will display an Invite to WhatsApp button instead of the standard buttons */ whatsapp_user_id?: string | Expression | PlaceholderValue; }>; }; /** URLs * @default {} */ urls?: { /** URL */ url?: Array<{ /** Type * @default HOME */ type?: 'HOME' | 'WORK' | Expression; /** URL */ url?: string | Expression | PlaceholderValue; }>; }; }; /** * Longitude * @displayOptions.show { messageType: ["location"] } */ longitude?: number | Expression; /** * Latitude * @displayOptions.show { messageType: ["location"] } */ latitude?: number | Expression; /** * The body of the message (max 4096 characters) * @displayOptions.show { messageType: ["text"] } */ textBody?: string | Expression | PlaceholderValue; /** * Use a link, an ID, or n8n to upload an audio file * @displayOptions.show { messageType: ["audio", "document", "image", "video"] } * @default useMediaLink */ mediaPath?: 'useMediaLink' | 'useMediaId' | 'useMedian8n' | Expression; /** * Link of the media to be sent * @displayOptions.show { messageType: ["image", "video", "audio", "sticker", "document"], mediaPath: ["useMediaLink"] } */ mediaLink?: string | Expression | PlaceholderValue; /** * ID of the media to be sent * @displayOptions.show { messageType: ["image", "video", "audio", "sticker", "document"], mediaPath: ["useMediaId"] } */ mediaId?: string | Expression | PlaceholderValue; /** * The name of the input field containing the binary file data to be uploaded * @displayOptions.show { messageType: ["image", "video", "audio", "sticker", "document"], mediaPath: ["useMedian8n"] } * @default data */ mediaPropertyName?: string | Expression | PlaceholderValue; /** * The name of the file (required when using a file ID) * @displayOptions.show { messageType: ["document"], mediaPath: ["useMediaId"] } */ mediaFilename?: string | Expression | PlaceholderValue; }; export type WhatsAppV11MessageSendOutput = { contacts?: Array<{ input?: string; wa_id?: string; }>; messages?: Array<{ id?: string; }>; messaging_product?: string; }; export type WhatsAppV11MessageSendNode = { type: 'n8n-nodes-base.whatsApp'; version: 1.1; credentials?: Credentials; config: NodeConfig; output?: Items; };