Everything you need to integrate OgenSync Connect into your app. Send WhatsApp messages via simple REST API calls.
OgenSync Connect provides a simple REST API to send WhatsApp messages. Here's the workflow:
http://localhost:3000 (or your deployed domain)All API endpoints (except /api/register) require a JWT Bearer token in the
Authorization header.
Authorization: Bearer YOUR_API_TOKEN Content-Type: application/json
Your token is generated automatically when you register. You can find it in your dashboard or regenerate it anytime.
Create a new user account. Returns an API token and initial SyncCoin credits.
{
"name": "John Doe",
"email": "john@example.com",
"phone": "919876543210"
}
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | ✅ | Full name of the user |
email |
string | ✅ | Valid email address (unique) |
phone |
string | ✅ | Phone with country code, no + or spaces (e.g. 919876543210) |
{
"success": true,
"message": "Registration successful",
"data": {
"userId": "abc123-def456-...",
"token": "eyJhbGciOiJIUzI1NiIs...",
"credits": 100
}
}
After registering, you need to link your WhatsApp account by scanning a QR code.
Returns a QR code data URL that can be displayed as an image for the user to scan.
{
"success": true,
"qr": "data:image/png;base64,iVBO...",
"status": "qr_ready"
}
Send a WhatsApp message to any phone number. Costs 1 SyncCoin per message.
{
"to": "919876543210",
"message": "Hello from OgenSync! 🚀"
}
| Field | Type | Required | Description |
|---|---|---|---|
to |
string | ✅ | Recipient phone number with country code (no + or spaces) |
message |
string | ✅ | Message text to send (max 4096 characters) |
{
"success": true,
"message": "Message sent successfully",
"data": {
"to": "919876543210@s.whatsapp.net",
"creditsRemaining": 99,
"messageId": "BAE5B8E1..."
}
}
curl -X POST http://localhost:3000/api/send-message \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"to": "919876543210", "message": "Hello! 🚀"}'
const response = await fetch('http://localhost:3000/api/send-message', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: '919876543210',
message: 'Hello from OgenSync! 🚀',
}),
});
const data = await response.json();
console.log(data);
// { success: true, data: { creditsRemaining: 99 } }
import requests
response = requests.post(
'http://localhost:3000/api/send-message',
headers={
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
json={
'to': '919876543210',
'message': 'Hello from OgenSync! 🚀',
},
)
print(response.json())
Check the current status of your WhatsApp session.
{
"success": true,
"data": {
"connected": true,
"status": "connected",
"whatsappNumber": "919876543210"
}
}
Check your current SyncCoin balance and usage stats.
{
"success": true,
"data": {
"credits": 95,
"creditsUsed": 5,
"messagesSent": 5
}
}
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/register |
❌ | Create account |
| GET | /api/session/qr |
✅ | Get QR code for WhatsApp linking |
| GET | /api/session/status |
✅ | Check WhatsApp session status |
| POST | /api/send-message |
✅ | Send a WhatsApp message (1 coin) |
| POST | /api/token/regenerate |
✅ | Generate a new API token |
| GET | /api/credits |
✅ | Check SyncCoin balance |
| GET | /api/activity |
✅ | Get activity history |
| GET | /api/metrics |
✅ | Get usage metrics |
| GET | /ping |
❌ | Health check |
All errors follow a consistent format:
{
"success": false,
"error": "Error message here"
}
| Status | Meaning | Common Cause |
|---|---|---|
| 400 | Bad Request | Missing or invalid parameters |
| 401 | Unauthorized | Missing or invalid token |
| 402 | Payment Required | Insufficient SyncCoin credits |
| 403 | Forbidden | Account disabled |
| 409 | Conflict | Email already registered |
| 429 | Too Many Requests | Rate limit exceeded (wait 60s) |
| 500 | Server Error | Internal error (contact support) |
Create your free account and start sending WhatsApp messages in minutes