API Documentation

Integrate VanuConnect messaging into your applications with our powerful and easy-to-use API.

Get API Keys

Authentication

All API requests require authentication using your API key. You must include your key in the standard Authorization header.

Security Warning: Keep your API key secret! Do not expose it in client-side code (HTML/JS) that is visible to browsers.
Header Format
Authorization: Bearer vanu_live_your_api_key_here

Send Message

Send SMS or WhatsApp messages to any phone number globally.

POST https://zqxcrvjsnunjuelmrydm.supabase.co/functions/v1/send-sms-api

Parameters

ParameterTypeDescription
phone_number
*Required
stringRecipient number with country code (e.g., "+6781234567")
message
*Required
stringMessage content (max 918 chars for SMS)
channelstring"sms" (default) or "whatsapp"
curl -X POST https://zqxcrvjsnunjuelmrydm.supabase.co/functions/v1/send-sms-api \
  -H "Authorization: Bearer vanu_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_number": "+6781234567",
    "message": "Hello from VanuConnect!",
    "channel": "sms"
  }'
const fetch = require('node-fetch');

const response = await fetch('https://zqxcrvjsnunjuelmrydm.supabase.co/functions/v1/send-sms-api', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer vanu_live_your_api_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    phone_number: '+6781234567',
    message: 'Hello from VanuConnect!',
    channel: 'sms'
  })
});

const data = await response.json();
console.log(data);
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => "https://zqxcrvjsnunjuelmrydm.supabase.co/functions/v1/send-sms-api",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => json_encode([
    'phone_number' => '+6781234567',
    'message' => 'Hello from VanuConnect!',
    'channel' => 'sms'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer vanu_live_your_api_key",
    "Content-Type: application/json"
  ],
]);
$response = curl_exec($curl);

Success Response:

{
  "success": true,
  "message_id": "uuid-1234-5678",
  "credits_used": 1,
  "credits_remaining": 99
}

Check Balance

Retrieve your current credit balance and account details programmatically.

GET https://zqxcrvjsnunjuelmrydm.supabase.co/functions/v1/check-balance-api
curl -X GET https://zqxcrvjsnunjuelmrydm.supabase.co/functions/v1/check-balance-api \
  -H "Authorization: Bearer vanu_live_your_api_key"

Response:

{
  "credits": 1500,
  "subscription_plan": "business",
  "status": "active"
}

Error Codes

Common error responses and their meanings.

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid Authorization header
401INVALID_API_KEYAPI key not found or invalid format
402INSUFFICIENT_CREDITSNot enough credits to send message
403API_KEY_DISABLEDAPI key has been deactivated
403CHANNEL_NOT_ALLOWEDAPI key doesn't have permission for this channel
403OPTED_OUTRecipient has opted out of messages
429RATE_LIMIT_EXCEEDEDToo many requests, wait and retry
500DELIVERY_FAILEDMessage could not be delivered

Rate Limits

Each API key has a configurable rate limit (default: 60 requests per minute). When you exceed this limit, you'll receive a 429 error with a retry_after field indicating how many seconds to wait.

You can adjust your rate limit in the API Keys settings.
Scroll to Top