💬 WhatsApp API @ Best Rate | Zero Setup Fee → 99.9% Uptime OTP Delivery — Try FREE Demo! 🏆 10,000+ Registered Businesses — 2,000+ Enterprise Clients Served 🚀 API Integration in Under 5 Minutes 🏅 Verified Business Badge with RCS Messaging 💬 WhatsApp API @ Best Rate | Zero Setup Fee → 99.9% Uptime OTP Delivery — Try FREE Demo! 🏆 10,000+ Registered Businesses — 2,000+ Enterprise Clients Served 🚀 API Integration in Under 5 Minutes 🏅 Verified Business Badge with RCS Messaging
Talk to Sales: India 1800 102 1822
Developer reference

SMS API Error Codes

What each SMSGatewayHub SMS API response code means and the exact fix, so your integration gets back to sending fast.

26 codes explainedFix for every codeDLT checksHTTP and JSON API
000Code for an accepted request
26Response codes documented
3Digits in every SMS API code
24/7Support for integration issues

Quick answer

SMSGatewayHub's SMS API returns an ErrorCode in every JSON response. 000 means the request was accepted; codes 001 to 027 mean it was rejected before sending. The most common are 007 (invalid API key), 011 (IP restriction), 013 (invalid number), 015 (sender ID not on DLT), 021 (insufficient Pay As You Go balance) and 024 (DLT template mismatch). Operator-level DLT failures appear later in the delivery report.

Start here

How to read an API response

Every SMSGatewayHub SMS API call returns JSON with an ErrorCode and an ErrorMessage. 000 means the request was accepted; any other code means it was rejected before reaching the operator, so no message was sent for that request.

FieldMeaning
ErrorCodeThree-digit result code from the table below. Balance and delivery-report calls return 0 for success.
ErrorMessagePlain-text description of the code.
JobIdID of the submitted job. Use it with the DLR Status API.
MessageDataOne entry per number with its MessageId.
An accepted request (000) can still fail at the operator, for example on a DLT scrubbing check. Those failures appear in the delivery report, not here. See DLT error codes and solutions.

All SMS API error codes at a glance

The full list of codes the SMS HTTP and JSON APIs can return. Codes 002 and 016 are not used.

CodeMessageTypeHow to fix
000SuccessRequest acceptedNo action. Store the JobId and MessageId so you can match the delivery report later.
001Login details cannot be blankAuthenticationPass APIKey on every call. Check that your code is not dropping the parameter when the value is read from config or an environment variable.
003Sender cannot be blankRequestAdd the senderid parameter with a 6-character DLT-approved header mapped to your account.
004Message text cannot be blankRequestSend a non-empty text parameter. URL-encode it so characters such as & and # do not cut the value short.
005Message data cannot be blankRequestFor JSON or bulk calls, include the message array with at least one number and text pair.
006Generic errorRequestRetry once after a short wait. If it repeats, send the full request (with the API key masked) and the response to support.
007Username or password is invalidAuthenticationCopy the APIKey again from API Settings in the panel. Remove stray spaces and regenerate the key if it may have leaked.
008Account not activeAccountThe account is inactive or expired. Contact support or your account manager to activate it.
009Account lockedAccountThe account has been locked. Contact your account manager to find out why and to unlock it.
010API restrictionAccountAPI access is not enabled for this account or route. Ask support to enable API sending.
011IP address restrictionSecurityIP whitelisting is on and the request came from another IP. Add your server's public IP in the panel or remove the restriction.
012Invalid length of message textContentThe text is longer than allowed. Shorten it, or check that a Unicode message is flagged correctly (70 characters per part instead of 160).
013Mobile numbers not validRequestUse the country code plus the number (for India, 91 followed by 10 digits) with no +, spaces or leading zero. Separate multiple numbers with commas.
014Account locked due to spam messageComplianceSending was stopped because of content flagged as spam. Contact support, review the content and send only DLT-approved templates.
015Sender ID not validDLTThe header is not approved on DLT or not mapped to your account. Check the header and the PE-TM chain in your DLT portal and the panel.
017Group ID not validRequestThe group ID does not exist in your panel account. Fetch the correct ID from the contacts or groups section.
018Multi message to group is not supportedRequestSend one text to a group, or use the bulk JSON call when every number needs a different message.
019Schedule date is not validSchedulingUse the documented date-time format and a future time. Check your server's time zone against IST.
020Message or mobile number cannot be blankRequestEvery entry in the request needs both a number and a message.
021Insufficient creditsBalanceYour Pay As You Go balance is too low for this send. Recharge, then retry. Call GetBalance before large campaigns.
022Invalid JobIdReportsThe JobId does not belong to this account or is mistyped. Use the JobId exactly as returned by the Send SMS response.
023Parameter missingRequestA required parameter is absent. Compare your call with the parameter table in the developer docs (APIKey, senderid, channel, DCS, flashsms, number, text, route, EntityId, dlttemplateid).
024Invalid template or template mismatchDLTThe text does not match the approved DLT template. Check spaces, punctuation, line breaks, variable values and the dlttemplateid.
025{Field} can not be blank or emptyRequestThe field named in the message is empty. Fill it in, or remove it if it is optional.
026Invalid date rangeReportsThe from date must be before the to date, and both must use the documented format.
027Invalid optin userComplianceThe number has not opted in for this route. Collect and record consent before sending on an opt-in route.
Codes by type

Login, account and IP codes

These codes mean the platform could not identify you or your account is not allowed to send right now.

CodeMessageTypeHow to fix
001Login details cannot be blankAuthenticationPass APIKey on every call. Check that your code is not dropping the parameter when the value is read from config or an environment variable.
007Username or password is invalidAuthenticationCopy the APIKey again from API Settings in the panel. Remove stray spaces and regenerate the key if it may have leaked.
008Account not activeAccountThe account is inactive or expired. Contact support or your account manager to activate it.
009Account lockedAccountThe account has been locked. Contact your account manager to find out why and to unlock it.
010API restrictionAccountAPI access is not enabled for this account or route. Ask support to enable API sending.
011IP address restrictionSecurityIP whitelisting is on and the request came from another IP. Add your server's public IP in the panel or remove the restriction.
Never put your API key in browser or app code. Call the API from your server and whitelist that server's IP.

Request and parameter codes

Most integration bugs show up here. Compare your call against the parameter table in the developer API docs.

CodeMessageTypeHow to fix
003Sender cannot be blankRequestAdd the senderid parameter with a 6-character DLT-approved header mapped to your account.
004Message text cannot be blankRequestSend a non-empty text parameter. URL-encode it so characters such as & and # do not cut the value short.
005Message data cannot be blankRequestFor JSON or bulk calls, include the message array with at least one number and text pair.
006Generic errorRequestRetry once after a short wait. If it repeats, send the full request (with the API key masked) and the response to support.
012Invalid length of message textContentThe text is longer than allowed. Shorten it, or check that a Unicode message is flagged correctly (70 characters per part instead of 160).
013Mobile numbers not validRequestUse the country code plus the number (for India, 91 followed by 10 digits) with no +, spaces or leading zero. Separate multiple numbers with commas.
017Group ID not validRequestThe group ID does not exist in your panel account. Fetch the correct ID from the contacts or groups section.
018Multi message to group is not supportedRequestSend one text to a group, or use the bulk JSON call when every number needs a different message.
019Schedule date is not validSchedulingUse the documented date-time format and a future time. Check your server's time zone against IST.
020Message or mobile number cannot be blankRequestEvery entry in the request needs both a number and a message.
022Invalid JobIdReportsThe JobId does not belong to this account or is mistyped. Use the JobId exactly as returned by the Send SMS response.
023Parameter missingRequestA required parameter is absent. Compare your call with the parameter table in the developer docs (APIKey, senderid, channel, DCS, flashsms, number, text, route, EntityId, dlttemplateid).
025{Field} can not be blank or emptyRequestThe field named in the message is empty. Fill it in, or remove it if it is optional.
026Invalid date rangeReportsThe from date must be before the to date, and both must use the documented format.

DLT, template and compliance codes

Under TRAI's TCCCPR rules every commercial SMS in India must use a registered header and a registered template. These codes mean the request failed that check on our side.

CodeMessageTypeHow to fix
014Account locked due to spam messageComplianceSending was stopped because of content flagged as spam. Contact support, review the content and send only DLT-approved templates.
015Sender ID not validDLTThe header is not approved on DLT or not mapped to your account. Check the header and the PE-TM chain in your DLT portal and the panel.
024Invalid template or template mismatchDLTThe text does not match the approved DLT template. Check spaces, punctuation, line breaks, variable values and the dlttemplateid.
027Invalid optin userComplianceThe number has not opted in for this route. Collect and record consent before sending on an opt-in route.

Checklist for code 024

  • The fixed text matches the template character for character, including spaces and line breaks.
  • Each variable value fits the variable type registered in the template (numeric, alphanumeric, URL, callback number, email).
  • URLs, APKs and callback numbers in the text are whitelisted on DLT.
  • The dlttemplateid and EntityId belong to the same entity as the header.

Need help registering or fixing templates? See DLT registration and sample templates.

Balance code

SMSGatewayHub works on Pay As You Go, so a send is rejected when the balance cannot cover it.

CodeMessageTypeHow to fix
021Insufficient creditsBalanceYour Pay As You Go balance is too low for this send. Recharge, then retry. Call GetBalance before large campaigns.

Check the balance before large campaigns with the GetBalance API.

Other products

Error codes for email, DLT and other channels

DLT and operator codes

Delivery failures from operator scrubbing. See the DLT guide.

Email API codes

EC codes for the email API and SMTP relay. Email error codes.

RCS responses

Response format for RCS sends. RCS response.

WhatsApp responses

Template message responses. WhatsApp response.

Troubleshooting

Troubleshooting steps

  1. Log the full request URL or body (mask the API key) and the full JSON response.
  2. Find the code in the table above and apply the fix.
  3. For 000 with no delivery, check the delivery report for the operator status.
  4. Check platform status if many requests fail at once.
  5. Still stuck? Contact support with the JobId and time of the request.
Retry only codes that can change on their own (006 and 021 after a recharge). Retrying 007, 015 or 024 without fixing the cause will fail again.

Frequently asked questions

Code 000 means success: the request was accepted and a JobId was created. It does not confirm handset delivery. Check the delivery report with the JobId to see whether each message was delivered.

Error 024 means the message text does not match the DLT template registered for the dlttemplateid you sent. Check spaces, punctuation, line breaks and variable values, and make sure the template, header and entity ID belong to the same entity.

Error 007 means the APIKey is wrong. Copy it again from API Settings in the panel, remove spaces or line breaks, and regenerate it if it may have been exposed.

IP whitelisting is enabled on your account and the request came from a different IP. Add your server's public IP in the panel or switch the restriction off.

The header (sender ID) is not approved on DLT or not mapped to your SMSGatewayHub account. Check the header status in your DLT portal and ask support to map it if needed.

Your Pay As You Go balance cannot cover the send. Recharge your account and retry. Calling the GetBalance API before large campaigns avoids this.

API error codes are returned straight away when SMSGatewayHub rejects a request. DLT error codes come later in the delivery report when an operator rejects an accepted message during scrubbing.

Retry only errors that can clear on their own, such as 006 (generic error) or 021 after a recharge. Errors like 007, 013, 015 and 024 need a fix to the request first.

The number has not opted in for the route you used. Collect and record the customer's consent before sending on an opt-in route.

Need help staying compliant?

Our DLT team registers your entity, headers and templates and checks every campaign before it goes out.