Error codes
Errors use `{ success: false, error, code }`.
The full list is also on GET https://api.messengernepal.com.np/api/v1/sms and in the OpenAPI spec.
Error envelope
json
{
"success": false,
"error": "Human-readable message",
"code": "VALIDATION_ERROR"
}Example: insufficient credits (402)
json
{
"success": false,
"error": "Insufficient credits",
"code": "INSUFFICIENT_CREDITS"
}Example: rate limited (429)
json
{
"success": false,
"error": "Rate limit exceeded. Try again later.",
"code": "RATE_LIMIT_EXCEEDED",
"retry_after": 42
}NO_API_KEYMissing X-API-Key headerINVALID_API_KEYUnknown, revoked, or malformed keyAPI_KEY_EXPIREDKey past its expiryINSUFFICIENT_PERMISSIONSKey is missing the required scopeIP_RESTRICTEDCaller IP is not on the key allowlistVALIDATION_ERRORQuery or body failed validationMISSING_TORecipient field is missingMISSING_MESSAGEMessage body is missing (and no template rendered)TOO_MANY_RECIPIENTSMore than 1000 recipients in one requestMESSAGE_TOO_LONGBody exceeds GSM 720 septets or unicode 335 (one Nepali character uses unicode)INSUFFICIENT_CREDITSCredits cannot cover the sendTEMPLATE_NOT_FOUNDtemplate_id or template_name did not matchRATE_LIMIT_EXCEEDEDPer-key minute or hour limit hit (HTTP 429; see Rate limits)OTP_NOT_FOUNDNo matching OTP challengeOTP_EXPIREDOTP past ttl_secondsOTP_INVALIDCode did not matchOTP_LOCKEDToo many verify attemptsSERVICE_UNAVAILABLESending is temporarily unavailable. Retry later.KYC_REQUIREDLive send without approved dashboard KYC (individual or company) or an active grace periodKYC_PENDINGLive send while KYC is waiting for reviewLIVE_API_NOT_APPROVEDLive send without admin live API approvalFLEX_LIVE_API_BLOCKEDLive key create/use while the account is on Flex