Errors
Every error has the same JSON shape, a status code and a short code you can test for.
Error shape
{
"error": {
"code": "destination_not_allowed",
"message": "We do not send to this country.",
"request_id": "8b1f0c2a4d6e4f10a3c5d7e9f1b2c3d4",
"details": {
"field": "to",
"value": "+15551234567",
"country": "US",
"hint": "See https://sms.jtnoble.com/coverage for the countries we send to. Nothing was charged."
}
},
"detail": { "code": "destination_not_allowed", "message": "..." }
}- Test for
error.codein your code. Themessagetext can change. error.detailsis there when there is more to say, for examplerequiredandavailableoninsufficient_balance.detailrepeats the error for older clients. New code should readerror.- Give us the
request_idwhen you contact support. It is also in theX-Request-Idresponse header.
The account service (auth.sms.jtnoble.com) and the SMPP portal API (smpp.sms.jtnoble.com/api) answer with the same shape.
Common errors
| HTTP | Code | What it means | What to do |
|---|---|---|---|
| 400 | bad_request | Something in the request is wrong. | Read message and fix the request. |
| 400 | invalid_phone, invalid_phone_length | The number is not a valid mobile number. | Check the digits. See details.hint. |
| 400 | feature_not_enabled | flash, validity_period, priority or binary is not on sale yet. | Leave the field out. |
| 400 | invalid_webhook_url | The webhook URL is private or local. | Use a public URL. |
| 401 | unauthorized | No key, or the key is wrong or revoked. | Check the Authorization header. |
| 402 | insufficient_balance | Your balance does not cover the message. | Top up, then send again. |
| 403 | insufficient_scope | The key may not do this action. | Use a key with the right scope. |
| 403 | portal_only | Only available in the dashboard. | Sign in to the dashboard. |
| 403 | recipient_opted_out | The number replied STOP to you. | Do not send to this number. |
| 403 | recipient_dnd | The number is on the do-not-disturb list. | Do not send to this number. |
| 403 | sender_not_approved | The sender ID is not approved on your account. | Use an approved sender, or leave it out. |
| 404 | not_found | No such item, or it is not yours. | Check the id. |
| 409 | duplicate_message | Same text to the same number within 5 minutes, with duplicate protection on. | Wait, or turn the protection off. |
| 409 | content_review_required | The text waits for a review by an administrator. | Wait for the decision. |
| 413 | message_too_long | More than 10 segments. | Shorten the message. |
| 422 | destination_not_allowed | The number is in a country we do not send to. | Check the number and the coverage list. |
| 422 | content_rejected | The text breaks the content rules. | Change the text. |
| 422 | validation_error | A field is missing or has the wrong type. See error.details.errors. | Fix the field. |
| 429 | rate_limited | Too many requests. | Slow down. Wait for Retry-After when it is present. |
| 429 | verify_rate_limited | A Verify limit was reached. | Wait for Retry-After. |
| 500 | internal_error | Something broke on our side. | Retry later. Contact support with the request_id. |
| 502 | otp_send_failed | A Verify code could not be sent. Nothing was charged. | Retry. |
| 503 | destination_unavailable | Sending to this country is paused. Nothing was charged. | Retry later. |
Retrying
- Retry
429,500,502and503after a short wait, doubling the wait each time. - Always send an
Idempotency-Keyon sends, so a retry is never charged twice. - Do not retry
400,401,402,403,404or422without changing something first.
Every code on the send routes
This table is built from the service code and is checked by its tests. (value) stands for a value filled in at run time.
| HTTP | code | Exact error.message |
|---|---|---|
400 | bad_request | A message with status '(value)' cannot be retried. All recipients are opted out or duplicates At least one phone number is required At least one recipient is required Cannot detect country from phone numbers Cannot detect the country of this phone number. Invalid route code: (value) Invalid route code: (value). Invalid (value) - use ISO 8601 Message text is required No active route for country (value) No contacts found Provide at least one message id in ?ids= Provide contact_list_ids or recipients Rate check is limited to 1000 recipients per call Route no longer exists Validation is limited to 1000 numbers per call drip_rate (messages per minute, 1-5000) is required when schedule_mode is 'drip' schedule_mode must be 'now' or 'scheduled' schedule_mode must be 'now', 'scheduled' or 'drip' scheduled_at is required when schedule_mode is 'scheduled' scheduled_at must be an ISO 8601 date and time with a timezone. scheduled_at must be at least 5 minutes in the future scheduled_at must be within 7 days from now text is required |
400 | destinations_unavailable | None of the recipients are in an available country. |
400 | empty_message | The message is empty. |
400 | feature_not_enabled | (value) is not enabled on this platform yet. |
400 | invalid_audience | Unknown audience source type (value) |
400 | invalid_binary | Binary payload is (value) octets; one SMS carries at most (value). UCS-2 binary data must be an even number of octets Unknown binary field(s): (value) binary must be an object: {data, udh?, data_coding?} binary.data is required (hex) binary.data_coding must be 4 (8-bit data) or 8 (UCS-2) binary.udh has a truncated information element binary.udh information element overruns the header binary.udh is too short (UDHL + at least one IE header) binary.udh length byte (UDHL) is (value) but (value) header octets follow binary.(value) must be a hex string binary.(value) must contain only hex digits 0-9 a-f binary.(value) must have an even number of hex digits (whole octets) |
400 | invalid_callback_url | callback_url must be a public https URL |
400 | invalid_destination | This is not a valid phone number. |
400 | invalid_message_type | message_type must be transactional or promotional |
400 | invalid_option | Flash and binary SMS are not supported for destinations in (value) yet. Send either text or binary, not both binary payloads are only supported on single sends flash can't be combined with binary flash must be true or false priority must be 0 (normal), 1, 2 or 3 (highest) text is required validity_period must be a whole number of minutes between 1 and (value) |
400 | invalid_phone | The phone number is empty. This is not a valid mobile number. This is not a valid phone number. |
400 | invalid_phone_length | The phone number has the wrong length for its country. |
400 | invalid_quiet_hours | (varies) |
400 | invalid_schedule | Schedule within the next 12 months schedule.at is required for a scheduled campaign schedule.mode must be now, scheduled or recurring schedule.recurrence is required for a recurring campaign |
400 | invalid_status | status must be one of (value) |
400 | invalid_timezone | Unknown timezone (value) (use an IANA name like Africa/Lagos) |
400 | invalid_workspace | X-Workspace must be a workspace id. |
400 | legacy_campaign | Retry is available for campaigns sent with the new engine. |
400 | missing_merge_field | Some recipients have no value for (value). |
400 | nothing_to_retry | No failed recipients to retry. |
400 | phone_not_verified | Add and verify your phone number in your profile to receive tests. |
400 | recipients_required | Pass recipients (with a template) or messages. |
400 | recurrence_ended | The repeat rule has no future runs. |
400 | sandbox_no_retry | Sandbox (test) messages cannot be retried. |
400 | sandbox_no_schedule | Test keys cannot schedule sends. |
400 | scheduled_needs_list | Scheduled bulk sends need a contact list. |
400 | template_required | Pass template (or template_id) or a text per recipient. |
400 | text_required | Every entry in messages needs text. |
400 | to_required | Pass to with up to 3 of your own numbers. |
400 | too_many_recipients | At most (value) inline recipients per request; use POST /v1/imports for bigger lists. |
400 | unsupported_wallet_currency | Wallet currency (value) is not supported for sending. |
401 | unauthorized | Invalid API key Invalid or expired token Invalid token type Not authenticated Session has been revoked |
402 | insufficient_balance | Insufficient balance for the test message ((value) (value)). Insufficient balance to retry this message. Insufficient balance. Sandbox: simulated insufficient balance (magic number). Your balance is negative. |
402 | payment_required | Insufficient balance. |
403 | account_suspended | This account is paused for a payment review. This account is suspended. |
403 | country_blocked | Sending is disabled for this account. |
403 | country_not_enabled | Sending to (value) is not enabled for this account. |
403 | forbidden | Admin access required |
403 | insufficient_scope | This API key is not authorised for '(value)'. |
403 | no_account | Send refused: no account context. |
403 | not_a_member | You are not a member of this workspace. |
403 | recipient_opted_out | The recipient has opted out. |
403 | reseller_only | Reseller access required. |
403 | role_forbidden | Only an approver, an admin or the owner can approve campaigns. Only an approver, an admin or the owner can reject campaigns. |
403 | route_country_mismatch | This number cannot be sent on the selected route. route (value) can only carry (value) numbers. |
403 | self_approval | You submitted this campaign - another approver must approve it (maker-checker). |
403 | sender_id_required | A registered sender ID is required for (value). A registered sender ID is required. |
403 | sender_not_approved | No sender ID available. Sender ID '(value)' is not approved for (value). Sender ID '(value)' is not approved. |
403 | support_only | Support access required. |
404 | group_not_found | Contact group (value) not found |
404 | import_not_found | Import (value) not found |
404 | not_found | Batch not found Campaign not found Contact list (value) not found Message not found Segment not found |
404 | segment_not_found | Segment (value) not found |
404 | template_not_found | Template not found |
404 | workspace_not_found | Workspace not found. |
409 | busy | Pause or cancel the campaign before deleting it. Wait for the campaign to finish before retrying failed recipients. |
409 | conflict | Duplicate request (idempotency conflict) |
409 | delivery_being_confirmed | This message is still being confirmed with the network. |
409 | duplicate_message | An identical message was sent to this number in the last 5 minutes. |
409 | finished | The campaign is already (value). |
409 | has_history | A campaign that sent messages cannot be deleted. |
409 | idempotency_in_progress | A request with this Idempotency-Key is still being processed. |
409 | import_not_ready | Import (value) is (value) - process it first |
409 | not_cancellable | Only a scheduled batch that has not started can be cancelled (this one is '(value)'). Only a scheduled message can be cancelled (this one is '(value)'). |
409 | not_editable | A (value) campaign can't be edited. Duplicate it instead. A (value) campaign is already prepared. |
409 | not_launchable | A (value) campaign can't be launched. |
409 | not_paused | Only a paused campaign can be resumed. |
409 | not_pending | This campaign is not waiting for approval. |
409 | not_running | A (value) campaign can't be paused. |
413 | message_too_long | A message renders to (value) segments; the maximum is (value). Message is (value) segments; the maximum is (value) ((value) chars = 1 segment for (value)). |
422 | destination_not_allowed | We do not send to this country. |
422 | launch_blocked | This campaign cannot be launched yet. |
422 | validation_error | Request validation failed |
422 | value_too_long | One of the values is too long. |
429 | rate_limited | Rate limit exceeded: (value) |
500 | internal_error | Internal server error |
503 | destination_unavailable | Sending to this country is not available right now. |
Each route's own errors are in the API reference.