Skip to main content
POST
/
send-whatsapp
Send Audio
curl --request POST \
  --url https://api.flowiq.live/send-whatsapp \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone_number": "+27123456789",
  "message_type": "audio",
  "media_url": "https://example.com/message.mp3",
  "context_message_id": "wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI..."
}
'
{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "message_id": "wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...",
    "recipient": "27123456789",
    "message_type": "<string>"
  }
}

Basic Usage

curl -X POST "https://api.flowiq.live/send-whatsapp" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+27123456789",
    "message_type": "text",
    "text": "Hello! This is a test message from FlowIQ API."
  }'

Reply to a Message

curl -X POST "https://api.flowiq.live/send-whatsapp" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+27123456789",
    "message_type": "text",
    "text": "This is a reply to your message!",
    "context_message_id": "wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI..."
  }'

Request Body

FieldTypeRequiredDescription
phone_numberstringYesRecipient phone number with country code
message_typestringYesMust be "text"
textstringYesThe text content of the message
context_message_idstringNoWhatsApp message ID to reply to
{
  "phone_number": "+27123456789",
  "message_type": "text",
  "text": "Hello, World!"
}

Response

Success (200)

{
  "success": true,
  "message": "Message sent successfully",
  "data": {
    "message_id": "wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI...",
    "recipient": "27123456789",
    "message_type": "text"
  }
}

Error: Missing Required Field (400)

{
  "error": "Missing required field",
  "message": "text is required for text messages"
}

Integration Example

async function sendTextMessage(apiKey, phoneNumber, text) {
  const response = await fetch(
    `https://api.flowiq.live/send-whatsapp`,
    {
      method: "POST",
      headers: {
        Authorization: `Bearer ${apiKey}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({ phone_number: phoneNumber, message_type: "text", text }),
    }
  );
  const data = await response.json();
  if (!response.ok) throw new Error(data.message);
  return data;
}

Message Context

Use context_message_id when replying to specific messages. This creates a visual thread in the WhatsApp conversation.

Authorizations

Authorization
string
header
required

Bearer token for authentication. Format: Bearer YOUR_BEARER_TOKEN

Query Parameters

tenantId
string
required

Organization tenant identifier (slug)

Body

application/json
phone_number
string
required

Recipient phone number with country code

Example:

"+27123456789"

message_type
enum<string>
required

Must be "audio"

Available options:
audio
Example:

"audio"

media_url
string
required

Publicly accessible URL to the audio file

Example:

"https://example.com/message.mp3"

context_message_id
string

WhatsApp message ID to reply to

Example:

"wamid.HBgLMjc4MTIzNDU2NzgVAgASGBQzRUI..."

Response

Message sent successfully

success
boolean
Example:

true

message
string
Example:

"Message sent successfully"

data
object