Developer API Reference
Complete endpoint documentation with real-world examples in multiple languages. All examples include live responses and parameter documentation.
Authentication
Every request requires your API key in the X-API-Key header.
Never commit your API key to version control. Keep it secret like a password.
Rate Limits
429 response = rate limited. Wait before retrying.
Endpoints
All SMS, SMM, wallet, and communication endpoints available via API.
WhatsApp Notifications
/api/developer/v1/notifications/sendWhatsApp Notifications API
Send approved production WhatsApp templates with fixed NGN billing per one message. Provider details are never exposed to the user.
💡 Use Case
Use this to send OTPs, alerts, order updates, and system notifications from approved templates only. Wallet balance is required before each send.
Parameters
template_idrequiredintegerApproved WhatsApp template ID
torequiredstringRecipient phone number in E.164 format
variablesoptionalobjectTemplate variables keyed by placeholder index
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/notifications/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.SMSGANG_API_KEY
},
body: JSON.stringify({
template_id: 1,
to: '+2348012345678',
variables: { '1': '123456' }
})
});
console.log(await response.json());Response (201)
{
"message": "WhatsApp notification queued successfully.",
"data": {
"id": 1,
"template_id": 1,
"message_sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"status": "queued",
"to": "+2348012345678",
"unit_price_ngn": 20,
"quantity": 1,
"charged_amount_ngn": 20,
"billing_status": "charged"
}
}Possible Errors
/api/developer/v1/notifications/messagesList WhatsApp Notification History
List your WhatsApp notification history with status and wallet billing data only. Provider name, provider cost, and internal profit data are hidden from the user.
💡 Use Case
Use this to build a user history page that shows charges and delivery state.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/notifications/messages', {
headers: { 'X-API-Key': process.env.SMSGANG_API_KEY }
});
console.log(await response.json());Response (200)
{
"data": [
{
"id": 1,
"template_id": 1,
"message_sid": "SMXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"status": "delivered",
"to": "+2348012345678",
"unit_price_ngn": 20,
"quantity": 1,
"charged_amount_ngn": 20,
"billing_status": "charged"
}
]
}/api/webhooks/whatsapp/statusWhatsApp Webhook Status
Twilio status callback for production WhatsApp messages.
💡 Use Case
Use this to keep delivery status updated in real time.
Parameters
MessageSidrequiredstringTwilio message SID
MessageStatusrequiredstringqueued, sent, delivered, read, failed, or undelivered
Example
// Twilio posts this automatically; no manual client call is needed.
console.log('Status callback endpoint is consumed by SMSGang backend.');Response (200)
{ "message": "ok" }SMS Catalog
/api/developer/v1/servicesList SMS Services
Retrieve all available SMS services your account has access to. This includes services like WhatsApp, Telegram, Gmail, etc.
💡 Use Case
Use this endpoint to populate a dropdown or list of available services before purchasing an activation.
Example
const services = await fetch('https://api.smsgang.org/api/developer/v1/services', {
headers: { 'X-API-Key': process.env.SMSGANG_API_KEY }
}).then(r => r.json());
services.forEach(s => console.log(s.name + ' (ID: ' + s.id + ')'));Response (200)
{
"data": [
{
"id": 1,
"name": "Telegram",
"slug": "telegram",
"price": 0.15,
"min_quantity": 1,
"max_quantity": 2500
},
{
"id": 2,
"name": "WhatsApp",
"slug": "whatsapp",
"price": 0.35,
"min_quantity": 1,
"max_quantity": 5000
}
]
}/api/developer/v1/countriesList Countries
Get a complete list of countries where SMS activations are available. Each country includes its name, code, and current availability status.
💡 Use Case
Build a country selector in your application or filter services by specific regions.
Example
const countries = await fetch('https://api.smsgang.org/api/developer/v1/countries', {
headers: { 'X-API-Key': process.env.SMSGANG_API_KEY }
}).then(r => r.json());
// Filter available countries
const available = countries.data.filter(c => c.is_available);Response (200)
{
"data": [
{
"id": 1,
"name": "United States",
"code": "US",
"is_available": true
},
{
"id": 2,
"name": "United Kingdom",
"code": "GB",
"is_available": true
}
]
}/api/developer/v1/services/{service}/countriesGet Service Countries & Pricing
Retrieve available countries for a specific service with live pricing for each country. Prices update in real-time based on demand.
💡 Use Case
Show users the exact price they'll pay before they select a country for their activation.
Parameters
servicerequiredstringService slug (e.g., "telegram", "whatsapp", "gmail")
Example
const prices = await fetch('https://api.smsgang.org/api/developer/v1/services/telegram/countries', {
headers: { 'X-API-Key': process.env.SMSGANG_API_KEY }
}).then(r => r.json());
prices.data.forEach(country => {
console.log(country.name + ': $' + country.price + '/code');
});Response (200)
{
"data": [
{
"id": 1,
"name": "United States",
"price": 0.15,
"operators_count": 3
},
{
"id": 2,
"name": "United Kingdom",
"price": 0.18,
"operators_count": 2
}
]
}SMS Activations
/api/developer/v1/activations/buyPurchase SMS Activation
Purchase a new SMS activation for receiving verification codes. The SMS is deducted from your account balance and you have a limited time to receive the code.
💡 Use Case
Example: Your user selects Telegram in US → call this endpoint → receive a phone number → user signs up on Telegram with that number.
Parameters
servicerequiredstringService slug (e.g., "telegram", "whatsapp")
countryrequiredstringCountry code (e.g., "US", "GB")
Example
const activation = await fetch('https://api.smsgang.org/api/developer/v1/activations/buy', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.SMSGANG_API_KEY
},
body: JSON.stringify({
service: 'telegram',
country: 'US'
})
}).then(r => r.json());
console.log('Phone: ' + activation.data.phone);
console.log('Code expires in: ' + activation.data.timeout + 's');Response (201)
{
"data": {
"id": 12345,
"phone": "+1234567890",
"service": "telegram",
"country": "US",
"timeout": 900,
"created_at": "2024-04-17T10:30:00Z"
}
}Possible Errors
/api/developer/v1/activations/{activation}/check-smsCheck SMS Code
Poll for the incoming SMS code for a pending activation. If no code has arrived yet, returns empty. Must be called while the activation is in pending state.
💡 Use Case
Call this endpoint every 3-5 seconds to check if the SMS code has arrived. Stop polling once you have the code or the timeout expires.
Parameters
activationrequiredintegerActivation ID returned from the buy endpoint
Example
async function waitForCode(activationId) {
const maxAttempts = 300; // 15 minutes
let attempts = 0;
while (attempts < maxAttempts) {
const res = await fetch(
'https://api.smsgang.org/api/developer/v1/activations/' + activationId + '/check-sms',
{ headers: { 'X-API-Key': process.env.SMSGANG_API_KEY } }
).then(r => r.json());
if (res.data.code) {
return res.data.code;
}
await new Promise(r => setTimeout(r, 5000)); // Wait 5 seconds
attempts++;
}
}Response (200)
{
"data": {
"code": "123456",
"status": "completed"
}
}Possible Errors
Wallet Management
/api/developer/v1/wallet/balanceGet Wallet Balance
Check your current account balance. This balance is used to purchase activations, SMM services, and other features.
💡 Use Case
Display the current balance to users or check if there's sufficient balance before making a purchase.
Example
const balance = await fetch('https://api.smsgang.org/api/developer/v1/wallet/balance', {
headers: { 'X-API-Key': process.env.SMSGANG_API_KEY }
}).then(r => r.json());
console.log('Available: $' + balance.data.balance);
console.log('Hold: $' + balance.data.hold);Response (200)
{
"data": {
"balance": 150.50,
"hold": 10.00,
"available": 140.50,
"currency": "USD"
}
}Developer Account
/api/developer/api-keysList API Keys
List every API key owned by the authenticated user, including name, status, prefix, and usage metadata.
💡 Use Case
Use this to show the key management screen inside your dashboard.
Example
const response = await fetch('https://api.smsgang.org/api/developer/api-keys', {
headers: { Authorization: 'Bearer YOUR_SANCTUM_TOKEN' }
});
console.log(await response.json());Response (200)
{
"data": [
{
"id": 1,
"name": "Production key",
"key_prefix": "sgk_ab12",
"last_used_at": "2026-04-17T09:10:00Z",
"revoked_at": null
}
]
}/api/developer/api-keysCreate API Key
Create a new API key for a developer account. The secret is shown once and the stored key is hashed.
💡 Use Case
Use this when a user clicks Create Key in the dashboard. Store the plain secret only once.
Parameters
namerequiredstringFriendly name for the key, such as Production or Staging
Example
const response = await fetch('https://api.smsgang.org/api/developer/api-keys', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer YOUR_SANCTUM_TOKEN'
},
body: JSON.stringify({ name: 'Production key' })
});
console.log(await response.json());Response (201)
{
"data": {
"id": 2,
"name": "Production key",
"plain_key": "sgk_live_XXXXXXXXXXXXXXXX",
"key_prefix": "sgk_live",
"revoked_at": null
}
}/api/developer/api-keys/{developerApiKey}Delete API Key
Revoke an API key permanently. This should be used when a key is compromised or no longer needed.
💡 Use Case
Use this from the dashboard when the user clicks Revoke.
Parameters
developerApiKeyrequiredintegerThe API key record ID to revoke
Example
const response = await fetch('https://api.smsgang.org/api/developer/api-keys/2', {
method: 'DELETE',
headers: { Authorization: 'Bearer YOUR_SANCTUM_TOKEN' }
});
console.log(await response.json());Response (200)
{
"message": "API key revoked successfully"
}SMM / Boosting
/api/developer/v1/smm/servicesList SMM Services
List all social media marketing services available to the developer account.
💡 Use Case
Use this to show followers, likes, views, and engagement products in your app.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/smm/services', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "id": 101, "name": "Instagram Followers", "rate": 0.5 },
{ "id": 102, "name": "TikTok Views", "rate": 0.2 }
]
}/api/developer/v1/smm/services/{service}Show SMM Service
Get pricing, limits, and metadata for one SMM service.
💡 Use Case
Use this when the user opens a specific SMM product page.
Parameters
servicerequiredintegerSMM service ID
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/smm/services/101', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": {
"id": 101,
"name": "Instagram Followers",
"min": 100,
"max": 10000,
"rate": 0.5
}
}/api/developer/v1/smm/ordersCreate SMM Order
Create a new SMM order for a social media service.
💡 Use Case
Use this to place boost orders after the user provides a target link and quantity.
Parameters
smm_service_idrequiredintegerSMM service ID
linkrequiredstringTarget URL or social profile link
quantityrequiredintegerRequested quantity
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/smm/orders', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'sgk_your_key_here'
},
body: JSON.stringify({
smm_service_id: 101,
link: 'https://instagram.com/example',
quantity: 1000
})
});
console.log(await response.json());Response (201)
{
"data": {
"id": 9001,
"status": "pending",
"quantity": 1000
}
}/api/developer/v1/smm/ordersList SMM Orders
List all SMM orders for the authenticated developer account.
💡 Use Case
Use this to build an orders page for boost deliveries and status tracking.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/smm/orders', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "id": 9001, "status": "pending" },
{ "id": 9002, "status": "completed" }
]
}/api/developer/v1/smm/orders/{order}Show SMM Order
Get the current state and progress for one SMM order.
💡 Use Case
Use this to show delivery progress after an order is placed.
Parameters
orderrequiredintegerSMM order ID
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/smm/orders/9001', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": { "id": 9001, "status": "pending", "progress": 42 }
}Monthly Numbers
/api/developer/v1/monthly-numbers/inventoryMonthly Number Inventory
Show the monthly communication number inventory and prices before purchase.
💡 Use Case
Use this to let developers choose a subscription country or package.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/monthly-numbers/inventory', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "country": "US", "price": 6.0 },
{ "country": "GB", "price": 5.0 }
]
}/api/developer/v1/monthly-numbers/purchasePurchase Monthly Number
Purchase a monthly communication number subscription.
💡 Use Case
Use this after a user selects a country and you want to start the subscription.
Parameters
countryrequiredstringCountry code to purchase
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/monthly-numbers/purchase', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'sgk_your_key_here'
},
body: JSON.stringify({ country: 'US' })
});
console.log(await response.json());Response (201)
{
"data": { "id": 7001, "country": "US", "status": "active" }
}/api/developer/v1/monthly-numbers/subscriptionsList Monthly Subscriptions
List active and past monthly communication number subscriptions.
💡 Use Case
Use this in a subscriptions dashboard.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/monthly-numbers/subscriptions', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "id": 7001, "country": "US", "status": "active" }
]
}/api/developer/v1/monthly-numbers/subscriptions/{subscription}Show Monthly Subscription
Get details for one monthly number subscription.
💡 Use Case
Use this to show the current subscription state and renewal settings.
Parameters
subscriptionrequiredintegerSubscription ID
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/monthly-numbers/subscriptions/7001', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": { "id": 7001, "country": "US", "status": "active" }
}/api/developer/v1/monthly-numbers/subscriptions/{subscription}/auto-renewUpdate Auto Renew
Enable or disable auto-renew for a monthly number subscription.
💡 Use Case
Use this in a billing settings page.
Parameters
subscriptionrequiredintegerSubscription ID
auto_renewrequiredbooleanTrue to enable auto-renew
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/monthly-numbers/subscriptions/7001/auto-renew', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'sgk_your_key_here'
},
body: JSON.stringify({ auto_renew: true })
});
console.log(await response.json());Response (200)
{
"message": "Auto renew updated successfully"
}/api/developer/v1/monthly-numbers/subscriptions/{subscription}/messagesList Subscription Messages
List incoming messages received on a monthly communication number.
💡 Use Case
Use this when you need to display SMS history for a purchased number.
Parameters
subscriptionrequiredintegerSubscription ID
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/monthly-numbers/subscriptions/7001/messages', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "from": "+1234567890", "message": "Your code is 123456" }
]
}/api/developer/v1/monthly-numbers/subscriptions/{subscription}/messagesSend Number Message
Send an SMS message using a purchased monthly communication number.
💡 Use Case
Use this to build user-initiated outbound SMS flows.
Parameters
subscriptionrequiredintegerSubscription ID
torequiredstringDestination phone number
messagerequiredstringMessage body
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/monthly-numbers/subscriptions/7001/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'sgk_your_key_here'
},
body: JSON.stringify({ to: '+1234567890', message: 'Hello from SMSGang' })
});
console.log(await response.json());Response (201)
{
"message": "Message sent successfully"
}Wallet
/api/developer/v1/wallet/transactionsWallet Transactions
List wallet debit and credit history for the developer account.
💡 Use Case
Use this to build statement or ledger views.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/wallet/transactions', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "id": 1, "type": "credit", "amount": 100 },
{ "id": 2, "type": "debit", "amount": 15 }
]
}/api/developer/v1/wallet/historyWallet History Alias
Alias for wallet transactions, kept for backward compatibility.
💡 Use Case
Use this only if a legacy client already calls /history.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/wallet/history', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "id": 1, "type": "credit", "amount": 100 },
{ "id": 2, "type": "debit", "amount": 15 }
]
}/api/developer/v1/transactionsPlatform Transactions
List all transactions related to the developer account across SMS, SMM, and numbers.
💡 Use Case
Use this for an all-in-one finance and activity page.
Example
const response = await fetch('https://api.smsgang.org/api/developer/v1/transactions', {
headers: { 'X-API-Key': 'sgk_your_key_here' }
});
console.log(await response.json());Response (200)
{
"data": [
{ "id": 11, "type": "sms_purchase", "amount": 5 },
{ "id": 12, "type": "smm_order", "amount": 20 }
]
}