Skip to main content

Error Codes Reference

The Ruach SMS API returns standardized error codes to help you understand and handle different response scenarios.

Success Codes

CodeDescription
0Success - Message successfully submitted

Authentication & Account Errors

CodeDescription
001Account details cannot be blank
002Username or password cannot be blank
007Invalid API credentials (ApiKey or ClientId)
008Account inactive
009Account lock
010Unauthorized API access
011Unauthorized IP address
016Transactional account not active
030Account expired

Message & Content Errors

CodeDescription
003SenderId cannot be blank
004Message cannot be blank
005Message properties cannot be blank
012Message length violation
013Invalid mobile numbers
014Account locked due to spam message contact support
015Invalid SenderId
020Message or mobile number cannot be blank
024Invalid template or template mismatch
025Cannot be blank or empty
038Spam Message

Group & Template Errors

CodeDescription
017Invalid groupid
018Cannot send multi message to group
032Parent group doesn’t exist

System & Processing Errors

CodeDescription
006ServerError#Error message
019Invalid schedule date
021Insufficient credits
022Invalid jobid
023Parameter missing
026Invalid date range
033Queue Connection Closed
034Unable to create campaign at this time please try again later
040Error While Publishing DLR
041Report Not Found

Data & Validation Errors

CodeDescription
027Already exist
028Can not be found
029Duplicate

Gateway & Routing Errors

CodeDescription
031No gateway is assigned
101Message failed due to loss protection
801Country Undefined
802Invalid Country
803Message failed due to undefined price for gateway/user
804Message failed due to loss protection
805Message failed due to undefined route

Error Response Format

All error responses follow this standard format:
{
  "ErrorCode": 001,
  "ErrorDescription": "Account details cannot be blank"
}

Handling Errors

Common Error Handling Patterns

try {
  const response = await fetch('https://accounts.netvox.ng/api/v2/SendSMS', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(requestData)
  });
  
  const result = await response.json();
  
  if (result.ErrorCode === 0) {
    // Success
    console.log('Message sent:', result.Data);
  } else {
    // Handle specific errors
    switch (result.ErrorCode) {
      case 001:
        console.error('Authentication required');
        break;
      case 021:
        console.error('Insufficient credits');
        break;
      case 015:
        console.error('Invalid Sender ID');
        break;
      default:
        console.error('Error:', result.ErrorDescription);
    }
  }
} catch (error) {
  console.error('Network error:', error);
}

Best Practices

  1. Always check ErrorCode: Never assume success without checking the error code
  2. Handle common errors: Implement specific handling for frequent errors (001, 021, 015)
  3. Log errors: Keep logs of error responses for debugging
  4. Retry logic: Implement retry logic for transient errors (033, 034)
  5. User feedback: Provide meaningful error messages to end users