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

# Audio

> Send an audio file

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.jelou.ai/v1/bots/BOT_ID/messages \
    --header 'Authorization: Basic <Base64Encoded clientId:clientSecret>' \
    --header 'Content-Type: application/json' \
    --data '{
      "type": "audio",
      "mediaUrl": "https://example.com/audio.mp3",
      "userId": "USER_ID"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "messageId": "msg_123456789"
  }
  ```
</ResponseExample>

## Path parameters

<ParamField path="botId" type="string" required>
  Unique identifier of the bot sending the message.
</ParamField>

## Body parameters

<ParamField body="type" type="string" required>
  Message type. Must be `"audio"`.
</ParamField>

<ParamField body="userId" type="string" required>
  Message recipient. Accepts a phone number in E.164 format without the leading `+` (e.g. `593999999999`) or a BSUID (e.g. `US.13491208655302741918`) for users who have enabled phone number privacy in WhatsApp. See [Identifying the recipient](/en/api/envia-mensajes/Envio-de-mensajes#identifying-the-recipient).
</ParamField>

<ParamField body="mediaUrl" type="string" required>
  Public (HTTPS) URL of the audio file. Supported formats and maximum size depend on the channel (see the formats and limits by channel table).
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  `true` if the message was sent successfully.
</ResponseField>

<ResponseField name="messageId" type="string">
  Identifier of the sent message.
</ResponseField>

## Formats and size limits by channel

| Channel | Supported formats | Size limit |
| - | - | - |
| **WhatsApp** | `audio/aac`, `audio/mp4`, `audio/mpeg`, `audio/amr`, `audio/ogg` (opus codec only) | 16MB |
| **Instagram** | `audio/aac`, `audio/mp4` (.m4a, .mp4), `audio/wav` | 25MB |
| **Messenger** | `audio/aac`, `audio/mp4` (.m4a, .mp4), `audio/wav` | 25MB |

## URL Requirements

<Warning>
  The URL must be publicly accessible via HTTPS, must not require authentication, and must point directly to the file (not to an HTML page).
</Warning>

## Common Errors

* `INVALID_MEDIA_URL` - The audio URL is invalid or inaccessible
* `MEDIA_TOO_LARGE` - The audio file exceeds the channel's size limit
* `UNSUPPORTED_MEDIA_TYPE` - The audio format is not supported

## Use Cases

* Sending voice messages
* Sharing music or podcasts
* Sending audio notifications
* Sharing recordings


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