> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypersender.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Messages

> Full methods guide to sending various types of messages and managing message interactions via WhatsApp

## Overview

The Send Message module provides comprehensive methods for sending various message types, managing interactions, and controlling chat on WhatsApp. Build engaging, feature-rich messaging experiences with safe sending options, link previews, and more.

## Text Methods

Send various types of content to engage your audience with multimedia and interactive elements.

### Safe Send Text Message

Safely send a WhatsApp text message with human-like pacing. [(learn more)](/api-reference/whatsapp/send-messages/send-text-safe)

<Tabs>
  <Tab title="Basic usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->safeSendTextMessage(
          chat_id: '20123456789@c.us',
          text: 'Hello from Laravel package!',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter                    | Type   | Required | Description                                 |
    | ---------------------------- | ------ | -------- | ------------------------------------------- |
    | chat\_id                     | string | yes      | The WhatsApp number to send the message to  |
    | text                         | string | yes      | The message content to send                 |
    | reply\_to                    | bool   | no       | Whether to reply to the message             |
    | link\_preview                | bool   | no       | Whether to show a link preview              |
    | link\_preview\_high\_quality | bool   | no       | Whether to show a high-quality link preview |
  </Tab>
</Tabs>

### Send Text Message

Send plain text messages with link preview (optional) [(learn more)](/api-reference/whatsapp/send-messages/send-text)

<Warning>
  We highly recommend using the [`send-text-safe`](/api-reference/whatsapp/send-messages/send-text-safe) endpoint for regular messaging operations to maintain a more natural communication pattern, and keep your whatsapp number safe from being blocked.
</Warning>

<Tabs>
  <Tab title="Basic usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->sendText(
          chat_id: '20123456789@c.us',
          text: 'Hello from Laravel package!',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter                    | Type   | Required | Description                                 |
    | ---------------------------- | ------ | -------- | ------------------------------------------- |
    | chat\_id                     | string | yes      | The WhatsApp number to send the message to  |
    | text                         | string | yes      | The message content to send                 |
    | reply\_to                    | bool   | no       | Whether to reply to the message             |
    | link\_preview                | bool   | no       | Whether to show a link preview              |
    | link\_preview\_high\_quality | bool   | no       | Whether to show a high-quality link preview |
  </Tab>
</Tabs>

### Send Image Message

Send images to WhatsApp users via URL or file upload. [(learn more)](/api-reference/whatsapp/send-messages/send-image)

<Tabs>
  <Tab title="Using URL" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->sendImageUrl(
            chat_id: '20123456789@c.us',
            url: 'https://hypersender.com',
            fileName: 'image.jpeg',
            mimetype: 'image/jpeg',
            caption: 'Check out this image!',
            reply_to: 'string',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                |
    | --------- | ------ | -------- | ------------------------------------------ |
    | chat\_id  | string | yes      | The WhatsApp number to send the message to |
    | url       | string | yes      | The URL of the image to send               |
    | fileName  | string | yes      | The name of the file to send               |
    | mimetype  | string | yes      | The MIME type of the file to send          |
    | caption   | string | no       | The caption for the image                  |
    | reply\_to | bool   | no       | Whether to reply to the message            |
  </Tab>

  <Tab title="Using File Upload" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;
    use Illuminate\Http\File;

    Hypersender::whatsapp()
      ->sendImageFile(
            chat_id: '20123456789@c.us',
            file: new File('/path/to/image.jpeg'),
            fileName: 'image.jpeg',
            mimetype: 'image/jpeg',
            caption: 'Check out this image!',
            reply_to: 'string',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type                  | Required | Description                                |
    | --------- | --------------------- | -------- | ------------------------------------------ |
    | chat\_id  | string                | yes      | The WhatsApp number to send the message to |
    | file      | \Illuminate\Http\File | yes      | The image file to send                     |
    | fileName  | string                | yes      | The name of the file to send               |
    | mimetype  | string                | yes      | The MIME type of the file to send          |
    | caption   | string                | no       | The caption for the image                  |
    | reply\_to | bool                  | no       | Whether to reply to the message            |
  </Tab>
</Tabs>

### Send Video Message

Send videos to WhatsApp users via URL or file upload. [(learn more)](/api-reference/whatsapp/send-messages/send-video)

<Tabs>
  <Tab title="Using URL" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->sendVideoUrl(
            chat_id: '20123456789@c.us',
            url: 'https://example.com/video.mp4',
            asNote: false,
            caption: 'Check out this video!',
            reply_to: 'string',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                |
    | --------- | ------ | -------- | ------------------------------------------ |
    | chat\_id  | string | yes      | The WhatsApp number to send the message to |
    | url       | string | yes      | The URL of the video to send               |
    | asNote    | bool   | yes      | Whether to send the video as a note        |
    | caption   | string | no       | The caption for the video                  |
    | reply\_to | bool   | no       | Whether to reply to the message            |
  </Tab>

  <Tab title="Using File Upload" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;
    use Illuminate\Http\File;

    Hypersender::whatsapp()
      ->sendVideoFile(
            chat_id: '20123456789@c.us',
            file: new File('/path/to/video.mp4'),
            asNote: false,
            caption: 'Check out this video!',
            reply_to: 'string',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type                  | Required | Description                                |
    | --------- | --------------------- | -------- | ------------------------------------------ |
    | chat\_id  | string                | yes      | The WhatsApp number to send the message to |
    | file      | \Illuminate\Http\File | yes      | The video file to send                     |
    | asNote    | bool                  | yes      | Whether to send the video as a note        |
    | caption   | string                | no       | The caption for the video                  |
    | reply\_to | bool                  | no       | Whether to reply to the message            |
  </Tab>
</Tabs>

<Warning>
  You can send videos only in mp4 formats - so make sure the url contains the correct extension

  Max allowed file size is `20MB`.
</Warning>

### Send Voice Message

Send voice messages to WhatsApp users via URL or file upload. [(learn more)](/api-reference/whatsapp/send-messages/send-voice)

<Tabs>
  <Tab title="Using URL" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
        ->sendVoiceUrl(
            chat_id: '20123456789@c.us',
            url: 'https://example.com/audio.opus',
            caption: 'Check out this audio!',
            reply_to: 'string',
        );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                |
    | --------- | ------ | -------- | ------------------------------------------ |
    | chat\_id  | string | yes      | The WhatsApp number to send the message to |
    | url       | string | yes      | The URL of the audio to send               |
    | caption   | string | no       | The caption for the audio                  |
    | reply\_to | bool   | no       | Whether to reply to the message            |
  </Tab>

  <Tab title="Using File Upload" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;
    use Illuminate\Http\File;

    Hypersender::whatsapp()
        ->sendVoiceFile(
            chat_id: '20123456789@c.us',
            file: new File('/path/to/audio.opus'),
            caption: 'Check out this audio!',
            reply_to: 'string',
        );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type                  | Required | Description                                |
    | --------- | --------------------- | -------- | ------------------------------------------ |
    | chat\_id  | string                | yes      | The WhatsApp number to send the message to |
    | file      | \Illuminate\Http\File | yes      | The audio file to send                     |
    | caption   | string                | no       | The caption for the audio                  |
    | reply\_to | bool                  | no       | Whether to reply to the message            |
  </Tab>
</Tabs>

### Send Location Message

Send location messages to WhatsApp users. [(learn more)](/api-reference/whatsapp/send-messages/send-location)

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
        ->sendLocation(
            chat_id: '20123456789@c.us',
            latitude: '37.7749',
            longitude: '-122.4194',
            title: 'San Francisco',
            reply_to: 'string',
        );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                |
    | --------- | ------ | -------- | ------------------------------------------ |
    | chat\_id  | string | yes      | The WhatsApp number to send the message to |
    | latitude  | string | yes      | The latitude of the location to send       |
    | longitude | string | yes      | The longitude of the location to send      |
    | title     | string | no       | The title of the location                  |
    | reply\_to | bool   | no       | Whether to reply to the message            |
  </Tab>
</Tabs>

### Send Poll Message

Send poll messages to WhatsApp users. [(learn more)](/api-reference/whatsapp/send-messages/send-poll)

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
        ->sendPoll(
            chat_id: '20123456789@c.us',
            reply_to: 'string',
            poll: [
                'name' => 'Sample Poll',
                'options' => [
                    'Option 1',
                    'Option 2',
                    'Option 3'
                ],
                'multipleAnswers' => true
            ]
        );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                                   |
    | --------- | ------ | -------- | ------------------------------------------------------------- |
    | chat\_id  | string | yes      | The WhatsApp number to send the message to                    |
    | reply\_to | bool   | no       | Whether to reply to the message                               |
    | poll      | array  | yes      | The poll object containing name, options, and multipleAnswers |
  </Tab>
</Tabs>

### Send Link Custom Preview

Send a text message with a custom link preview. [(learn more)](/api-reference/whatsapp/send-messages/send-link-custom-preview)

<Tabs>
  <Tab title="Using URL" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->sendLinkCustomPreviewUrl(
          chatId: '20123456789@c.us',
          text: 'Check this out: https://example.com',
          replyTo: null,
          highQuality: true,
          previewTitle: 'Example Title',
          previewDescription: 'A short description for the preview card',
          previewUrl: 'https://example.com',
          previewImageUrl: 'https://example.com/image.jpg',
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter          | Type   | Required | Description                                 |
    | ------------------ | ------ | -------- | ------------------------------------------- |
    | chatId             | string | yes      | The WhatsApp chat ID to send the message to |
    | text               | string | yes      | The message text (can include a link)       |
    | replyTo            | string | no       | Message ID to reply to                      |
    | highQuality        | bool   | no       | Whether to use high-quality preview images  |
    | previewTitle       | string | yes      | Title to display in the link preview        |
    | previewDescription | string | yes      | Description to display in the link preview  |
    | previewUrl         | string | yes      | Link URL for the preview card               |
    | previewImageUrl    | string | yes      | Direct URL to the preview image             |
  </Tab>

  <Tab title="Using File Upload" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;
    use Illuminate\Http\UploadedFile;

    Hypersender::whatsapp()
      ->sendLinkCustomPreviewFile(
          chatId: '20123456789@c.us',
          text: 'Check this out: https://example.com',
          replyTo: null,
          highQuality: true,
          previewTitle: 'Example Title',
          previewDescription: 'A short description for the preview card',
          previewUrl: 'https://example.com',
          previewImageFile: new UploadedFile('/path/to/image.jpg', 'image.jpg', 'image/jpeg'),
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter          | Type                          | Required | Description                                 |
    | ------------------ | ----------------------------- | -------- | ------------------------------------------- |
    | chatId             | string                        | yes      | The WhatsApp chat ID to send the message to |
    | text               | string                        | yes      | The message text (can include a link)       |
    | replyTo            | string                        | no       | Message ID to reply to                      |
    | highQuality        | bool                          | no       | Whether to use high-quality preview images  |
    | previewTitle       | string                        | yes      | Title to display in the link preview        |
    | previewDescription | string                        | yes      | Description to display in the link preview  |
    | previewUrl         | string                        | yes      | Link URL for the preview card               |
    | previewImageFile   | \Illuminate\Http\UploadedFile | yes      | The preview image file to upload            |
  </Tab>
</Tabs>

### Send File Message

Send any file type via URL or file upload. [(learn more)](/api-reference/whatsapp/send-messages/send-file)

<Tabs>
  <Tab title="Using URL" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->sendFileUrl(
          chatId: '20123456789@c.us',
          url: 'https://example.com/files/report.pdf',
          fileName: 'report.pdf',
          mimeType: 'application/pdf',
          caption: 'Monthly report',
          replyTo: null,
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                              |
    | --------- | ------ | -------- | ---------------------------------------- |
    | chatId    | string | yes      | The WhatsApp chat ID to send the file to |
    | url       | string | yes      | Direct URL of the file to send           |
    | fileName  | string | no       | File name to display to the recipient    |
    | mimeType  | string | no       | MIME type of the file                    |
    | caption   | string | no       | Optional caption for the file            |
    | replyTo   | string | no       | Message ID to reply to                   |
  </Tab>

  <Tab title="Using File Upload" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;
    use Illuminate\Http\UploadedFile;

    Hypersender::whatsapp()
      ->sendFile(
          chatId: '20123456789@c.us',
          file: new UploadedFile('/path/to/file.pdf', 'file.pdf', 'application/pdf'),
          fileName: 'file.pdf',
          mimeType: 'application/pdf',
          caption: 'See attached file',
          replyTo: null,
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type                          | Required | Description                              |
    | --------- | ----------------------------- | -------- | ---------------------------------------- |
    | chatId    | string                        | yes      | The WhatsApp chat ID to send the file to |
    | file      | \Illuminate\Http\UploadedFile | yes      | The file to upload and send              |
    | fileName  | string                        | no       | File name to display to the recipient    |
    | mimeType  | string                        | no       | MIME type of the file                    |
    | caption   | string                        | no       | Optional caption for the file            |
    | replyTo   | string                        | no       | Message ID to reply to                   |
  </Tab>
</Tabs>

### Send Contact Card

Send contact cards (vCard) to WhatsApp users. [(learn more)](/api-reference/whatsapp/send-messages/send-contact-card)

<Tabs>
  <Tab title="Basic Usage" icon="code">
    ```php theme={null}
    use Hypersender\Hypersender;

    Hypersender::whatsapp()
      ->sendContactCard(
          chatId: '20123456789@c.us',
          contacts: [
              [
                  'vcard' => "BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nORG:Acme Inc\nTEL;type=CELL:+12025550123\nEND:VCARD",
                  'fullName' => 'John Doe',
                  'organization' => 'Acme Inc',
                  'phoneNumber' => '12025550123',
                  'whatsappId' => '12025550123@c.us',
              ],
          ],
      );
    ```
  </Tab>

  <Tab title="Parameters" icon="sliders">
    | Parameter | Type   | Required | Description                                      |
    | --------- | ------ | -------- | ------------------------------------------------ |
    | chatId    | string | yes      | The WhatsApp chat ID to send the contact card to |
    | contacts  | array  | yes      | Array of contact objects (see note below)        |
  </Tab>
</Tabs>

<Note>
  Each contact supports: `vcard`, `fullName`, `organization`, `phoneNumber`, `whatsappId`.

  You can send one or multiple contacts in a single message by including multiple items in the `contacts` array.
</Note>
