Maytapi icon

Maytapi

Integrate with Maytapi WhatsApp Unofficial API

Message → Send Message

AI-generated

Overview

This node integrates with the Maytapi WhatsApp Unofficial API to send various types of WhatsApp messages. It supports sending text, media (images, videos, audio, documents), polls, contacts, locations, links, products, buttons, lists, stickers, short videos, and more. Additionally, it can perform message-related actions such as forwarding, deleting, reacting, editing, pinning/unpinning, starring/unstarring messages, creating events, replying to stories, and group invitations.

Common scenarios include automating customer support messages, broadcasting updates with rich media, conducting polls, managing group interactions, and reacting or editing messages programmatically.

Practical examples:

  • Sending a promotional image with caption to customers.
  • Creating a poll in a group chat.
  • Pinning an important announcement message for 24 hours.
  • Replying to a story with a media message.
  • Forwarding a received message to another contact.

Properties

Name Meaning
Phone ID Source Select how to provide the WhatsApp instance Phone ID: either from credentials or custom input.
Phone ID The WhatsApp instance Phone ID (required if "Custom" is selected as Phone ID Source).
Message Type Type of message to send. Options include: text, media, poll, vcard, contact, location, link, product, buttons, list, sticker, shortVideo, forward, delete, reaction, edit, groupInvite, pinMessage, star, unreact, createEvent, story_text, story_media, reply.
To Phone Number Phone number or group ID to send the message to.
Skip Duplicate Filter Optionally skip filtering duplicate messages.

Additional properties depending on Message Type:

  • Text

    • Message Text: Content of the text message.
    • Duration: Typing duration in seconds (1-30).
    • Typing Indicator: Show typing or recording indicator.
    • Reply To Message ID (optional): Message ID to reply to.
  • Media (Image/Video/Audio/Document)

    • Message Text: URL or content of the media.
    • Media Caption: Optional caption text.
    • Media Filename: Custom filename.
    • High Definition: Send media in HD.
    • Is GIF: Mark media as GIF animation.
    • Reply To Message ID (optional).
  • Poll

    • Poll Question: The question text.
    • Poll Options: List of options (2 to 13).
    • Single Choice Poll: Allow only one choice (default true).
    • Reply To Message ID (optional).
  • Location

    • Latitude: Latitude coordinate.
    • Longitude: Longitude coordinate.
    • Location Name: Optional name of the location.
  • vCard (Contact)

    • Display Name: Contact display name.
    • vCard Data: Complete vCard string.
  • Contact

    • Contact IDs: One or multiple WhatsApp contact IDs (comma-separated).
  • Link

    • Link URL: URL to send.
    • Link Text: Optional description text.
  • Product

    • Product ID: ID from WhatsApp Business catalog.
  • Buttons

    • Button Message Body: Main message text.
    • Buttons JSON: JSON array defining buttons (reply, URL, phone).
    • Button Footer: Optional footer text.
    • Button Title: Optional title text.
  • List

    • List Message Body: Main message text.
    • List Sections JSON: JSON array defining sections and rows.
    • List Button Text: Text for selection button.
    • List Title: Optional title.
    • List Footer: Optional footer.
  • Sticker, Short Video

    • Message Text: Content or URL.
  • Forward, Delete, Reaction, Edit

    • Target Message ID: ID of the message to act upon.
    • For Reaction: Reaction Emoji.
    • For Edit: New Message Text.
  • Group Invite

    • Group ID: Group identifier.
    • Message Text: Invitation message.
  • Pin Message

    • Pin Action: Pin or unpin.
    • Reply To Message ID: Message to pin/unpin.
    • Pin Duration: Duration for pinning (if pinning).
  • Star Message

    • Star Action: Star or unstar.
    • Reply To Message ID: Message to star/unstar.
  • Unreaction

    • Message ID to Unreact: Message to remove reaction from.
  • Create Event

    • Message Text: Event message.
    • Event Description: Description.
    • Event Start Time: Unix timestamp.
    • Event End Time: Optional Unix timestamp.
    • Event Location: Optional location.
  • Story Text Reply

    • Message Text: Reply text.
    • Story ID: Story to reply to.
  • Story Media Reply

    • Message Text: Media content.
    • Story ID: Story to reply to.
    • Story Text: Optional caption.
  • Reply Message

    • Message Text: Reply text.
    • Reply To Message ID: Message to reply to.

Output

The node outputs the JSON response returned by the Maytapi API for the performed action. This typically includes success status, message IDs, or detailed data about the sent or retrieved message.

If the operation involves retrieving images like session screen or QR code, the node outputs binary data containing the image file.

Dependencies

  • Requires an API key credential for Maytapi WhatsApp API access.
  • Needs the WhatsApp instance Phone ID, either from credentials or custom input.
  • Network access to https://api.maytapi.com/api endpoint.
  • Proper configuration of credentials in n8n with valid API token and phone ID.

Troubleshooting

  • Missing Phone ID: Error if Phone ID is not provided either via credentials or custom input.
  • Invalid JSON: Errors when parsing JSON inputs for buttons or list sections if malformed.
  • Poll Options Count: Must have between 2 and 13 options; otherwise, error is thrown.
  • Timestamp Validation: For call creation, timestamp must be in the future.
  • Unsupported Message Type: If an unsupported message type is selected, an error listing supported types is thrown.
  • API Errors: Any API request failure will throw an error; ensure valid credentials and network connectivity.
  • Binary Data Handling: For session screen or QR code retrieval, ensure downstream nodes can handle binary data.

Links and References

Discussion