send_message.js
// 1. Fetch your approved templates
const templates = await fetch('https://ztlgdpyzixocvdqgdxby.supabase.co/functions/v1/api/v1/templates', {
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
}).then(r => r.json());
// 2. First message must be a template (24h window rule)
const response = await fetch('https://ztlgdpyzixocvdqgdxby.supabase.co/functions/v1/api/v1/templates/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: '+14155551234',
template: 'order_confirmation',
language: 'en_US',
variables: ['John', '#12345']
})
});
// Free-form text only works within 24h of the customer's last message:
// POST https://ztlgdpyzixocvdqgdxby.supabase.co/functions/v1/api/v1/messages/sendDeveloper-Friendly Features
Everything you need to build robust WhatsApp integrations
RESTful API
Clean, well-documented REST API with JSON responses and standard HTTP methods.
Webhooks
Real-time event notifications for messages, status updates, and customer actions.
API Keys
Secure API key authentication with scoped permissions and rate limiting.
SDKs
Official SDKs for Node.js, Python, and PHP — coming soon.
CLI Tool
Command-line interface for testing and automation — coming soon.
Enterprise Security
TLS encryption, IP whitelisting, and comprehensive audit logs.
API Endpoints
GET
/v1/pingGET
/v1/templatesGET
/v1/templates/{name}POST
/v1/templates/sendPOST
/v1/messages/sendGET
/v1/contactsPOST
/v1/contactsPOST
/v1/orders