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

# Audio Message

> Send an audio message to a WhatsApp recipient using a media ID returned by the Media Upload API.

## Endpoint

```http theme={null}
POST /api/whatsapp/{Sender Hash}/messages
```

**Sandbox base URL:** `https://testqa.cpaas.globeteleservices.com`

Replace `{Sender Hash}` with the registered sender hash from the WhatsApp channel's **Numbers** section in the CPaaS+ Portal.

## Headers

Include the following headers in the request:

```http theme={null}
Accept: application/json
Content-Type: application/json
Authorization: Bearer <token>
```

Generate the Bearer token from the **API** tab in the CPaaS+ Portal.

## Request parameters

| Parameter | Required | Description |
| - | - | - |
| `messaging_product` | Yes | Set to `"whatsapp"`. |
| `recipient_type` | No | Set to `"individual"`. The source guide states this as the default. |
| `to` | Yes | Recipient's WhatsApp number in international format, without a leading `+`. |
| `type` | Yes | Set to `"audio"`. |
| `audio.id` | Yes | Media ID returned by the Media Upload API. |

## Request example

```json theme={null}
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "919373084880",
  "type": "audio",
  "audio": {
    "id": "766235952871902"
  }
}
```

Replace the example recipient number and media ID with values for your integration. Send the JSON as the request body and include the required headers.

## Before sending an audio message

1. Upload the audio file through the Media Upload API.
2. Capture the returned media ID.
3. Set `audio.id` to that media ID in the message request.
4. Send the request to the endpoint using your registered sender hash and Bearer token.

## Responses and errors

See [Common HTTP Status Codes](/docs/status-codes.md) for the documented status meanings and possible causes.

A successful HTTP response indicates that the request was accepted for processing; it does not, by itself, confirm that the recipient received the audio message.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.