API Documentation
Integrate VanuConnect messaging into your applications with our powerful and easy-to-use API.
Get API KeysAuthentication
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.
Authorization: Bearer vanu_live_your_api_key_hereSend Message
Send SMS or WhatsApp messages to any phone number globally.
POST
https://zqxcrvjsnunjuelmrydm.supabase.co/functions/v1/send-sms-api
Parameters
| Parameter | Type | Description |
|---|---|---|
| phone_number *Required | string | Recipient number with country code (e.g., "+6781234567") |
| message *Required | string | Message content (max 918 chars for SMS) |
| channel | string | "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.
| Status | Code | Description |
|---|---|---|
| 401 | UNAUTHORIZED | Missing or invalid Authorization header |
| 401 | INVALID_API_KEY | API key not found or invalid format |
| 402 | INSUFFICIENT_CREDITS | Not enough credits to send message |
| 403 | API_KEY_DISABLED | API key has been deactivated |
| 403 | CHANNEL_NOT_ALLOWED | API key doesn't have permission for this channel |
| 403 | OPTED_OUT | Recipient has opted out of messages |
| 429 | RATE_LIMIT_EXCEEDED | Too many requests, wait and retry |
| 500 | DELIVERY_FAILED | Message 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.