SendComms
Testing

Sandbox Mode

Test EnvironmentNo Charges

Test your integration without sending real messages or incurring charges. Sandbox mode provides realistic mock responses for all API endpoints.

API Key Types

🧪

Test Keys

sc_test_
  • Mock responses returned
  • No real messages sent
  • No balance deducted
  • Full validation applied
🚀

Live Keys

sc_live_
  • Real messages sent
  • Balance deducted
  • Production metrics
  • Webhooks triggered

Getting Test Keys

  1. 1

    Go to Dashboard → API Keys

    Navigate to your API keys management page

  2. 2

    Click "Create API Key"

    Open the key creation modal

  3. 3

    Toggle "Sandbox Mode" ON

    Enable test mode for this key

  4. 4

    Copy your test key

    Your key will start with sc_test_

Example Request

curl -X POST https://api.sendcomms.com/api/v1/sms/send \
  -H "Authorization: Bearer sc_test_YOUR_TEST_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+233540800994",
    "message": "Hello from sandbox mode!"
  }'

Sandbox Response

Response200 OK
{
  "success": true,
  "data": {
    "transaction_id": "sms_test_mji01l2o_g8pamf65",
    "message_id": "SMtest1c7pkfx8z",
    "status": "sent",
    "to": "+233540800994",
    "from": "SendComms",
    "message_length": 24,
    "segments": 1,
    "price": {
      "amount": 0.029,
      "currency": "USD"
    },
    "provider": "sandbox",
    "country": {
      "code": "233",
      "name": "Ghana"
    },
    "region": "africa",
    "_sandbox": {
      "mode": "test",
      "message": "This is a test transaction. No real SMS was sent.",
      "note": "Switch to a live API key (sc_live_) to send real messages."
    }
  }
}

Note the _sandbox object in the response indicating test mode.

Supported Services

ServiceEndpointSandbox
SMS/api/v1/sms/sendSupported
Email/api/v1/email/sendSupported
Email Batch/api/v1/email/batchSupported
Data Bundles/api/v1/data/purchaseSupported
Airtime/api/v1/airtime/purchaseComing Soon

What Gets Validated

Sandbox mode performs the same validation as production. If your request works in sandbox, it will work in production.

Validated in Sandbox

  • • API key authentication
  • • Request body format
  • • Phone number format (E.164)
  • • Email address format
  • • Required fields
  • • Message length limits
  • • Network validation
  • • Rate limiting

Skipped in Sandbox

  • • Balance check
  • • Actual message delivery
  • • Provider API calls
  • • Real charges

Detecting Sandbox Mode

All sandbox responses include a _sandbox object. Check for this to confirm you're in test mode:

if (response.data._sandbox) {
  console.log('⚠️ Running in sandbox mode');
  // Handle test mode logic
}

Switching to Production

When you're ready to go live, simply swap your test key for a live key:

# Development
SENDCOMMS_API_KEY=sc_test_xxx

# Production
SENDCOMMS_API_KEY=sc_live_xxx

Important

Ensure you have sufficient balance before switching to production. Live requests will charge your account.

Best Practices

Use Environment Variables

Store different keys for development and production environments

Add Production Checks

Verify you're not using test keys in production environments

Test All Scenarios

Test successful sends, validation errors, and edge cases

Log Sandbox Responses

Check for _sandbox in responses to verify test mode

FAQ

Do test transactions count toward rate limits?
Yes, rate limits apply to both test and live keys to ensure your integration handles limits correctly.
Is there a test balance limit?
No, sandbox mode doesn't check or deduct balance. You can make unlimited test requests.
Can I convert a test key to live?
No, you need to create a new live key. Keys cannot be converted between modes.
Are test transactions logged?
Yes, all test transactions are logged to a separate table for debugging purposes.