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

# Send WhatsApp Message

## Overview

This endpoint sends a WhatsApp message to a specified contact using the Wassly API. It allows you to send text messages through a connected WhatsApp Web instance.

## Authentication

This endpoint requires API key authentication via the request header.

**Required Header:**

* `apikey`: Your Wassly API key (use `{apikey}` variable)
* Autherizaion: Bearer token: The token been generated from the login API (required)

## Request Parameters

### Form-Data Body Parameters

| Parameter               | Type   | Required | Description                                                                                                                          |
| ----------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `message`               | string | **No**   | The text message content to send to the recipient, Required only when you wont send a document or a media                            |
| `instance_id`           | string | **Yes**  | The unique identifier of your WhatsApp instance. This ID is obtained when you create a WhatsApp instance                             |
| `contact_mobile_number` | string | **Yes**  | The recipient's phone number in international format (e.g., +country\_codemobile\_number). Must include country code with `+` prefix |
| `contact_name`          | string | No       | Optional display name for the contact                                                                                                |
| `document`              | file   | No       | Optional when you want to send a document                                                                                            |
| `media`                 | file   | No       | Optional when you want to image, video or audio                                                                                      |

## Example Usage

```
POST {{baseUrl}}/api/whatsapp-web-send-message
Headers:
  apikey: {{apikey}}
Body (form-data):
  message: ""
  instance_id: "Obtained from List Devices API"
  contact_mobile_number: "+"
  contact_name: ""
```

## Response

Upon successful message delivery, the API will return a confirmation response with the message status and details.

## Notes

* Ensure your WhatsApp instance is connected and active before sending messages
* Phone numbers must be in international format with country code
* The instance must have an active WhatsApp Web session


## OpenAPI

````yaml POST /api/whatsapp-web-send-message
openapi: 3.1.0
info:
  title: Wassly API Documentation
  version: 1.0.0
  description: Wassly API Documentation.
servers:
  - url: https://www.wassly.com
security: []
paths:
  /api/whatsapp-web-send-message:
    post:
      tags:
        - Whatsapp Web API
      operationId: >-
        Whatsapp_Web_API_Send_Whatsapp_Web_Message_post_api_whatsapp_web_send_message
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                message:
                  type: string
                instance_id:
                  type: string
                contact_mobile_number:
                  type: string
                contact_name:
                  type: string
                document:
                  type: string
                  format: binary
                  description: Pass this as a file to send a document to the customer
                media:
                  type: string
                  format: binary
                  description: >-
                    Pass this as a file to send an image, video or audo to the
                    customer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      message_type:
                        type: string
                      conversation_id:
                        type: integer
                        format: int32
                      remaining_conversations:
                        type: integer
                        format: int32
                    required:
                      - message_type
                      - conversation_id
                      - remaining_conversations
                required:
                  - success
                  - message
                  - data
              example:
                success: true
                message: Message sent successfully
                data:
                  message_type: media
                  conversation_id: 2
                  remaining_conversations: 40969
      security:
        - bearerAuth: []
          apiKeyAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey

````