API for sending SMS messages to international numbers (e.g., OTP verification codes, marketing, notifications).
api.moymobile.com/smsHTTP / HTTPSPOSTBasic Auth (Base64 encoded account credentials)| Header Name | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Basic authentication, format:Basic Base64(AccountID:ApiKey) |
Content-Type |
string | Yes | Fixed value: application/json |
Assume:
AccountID: 1910159943521189888ApiKey: 12f76074-f686-4b23-8b15-8714651b815cConcatenate string:
Base64 encode:
Final header:
| Parameter | Type | Required | Description |
|---|---|---|---|
from |
string | ✅ | Sender identifier (Sender ID) |
to |
array of objects | ✅ | Recipient list, each item with phoneNumber (E.164 format) and optional variables |
templateId |
string | ✅ | Template ID for templated SMS |
reference |
string | ❌ | Custom parameter, max 400 characters, returned as-is in status report |
Each to item contains:
| Field | Type | Required | Description |
|---|---|---|---|
phoneNumber |
string | ✅ | Recipient number in E.164 format (e.g., +14155550000) |
| other variables | string / number | ❌ | According to your template, you can pass variables (e.g., code) |
For example, if your template is:
Your verification code is: ${code}
then you must provide a code variable in each to item.
If your template has no variables, you only need to pass phoneNumber.
📌 International SMS is charged per submission.
📌 E.164 format means '+' + country code + phone number, e.g., +14155550000.
📌 Template ID is assigned in your account; template variables (like
code) will replace placeholders.
📌 SMS content length is calculated after variable substitution:
GSM 7bit encoding counts 160 characters per SMS; over 160 characters split by 153 chars per segment.
Unicode encoding counts 70 characters per SMS; over 70 split by 67 chars per segment.
| Field | Type | Description |
|---|---|---|
messageId |
string | Unique SMS ID (globally unique) |
accountId |
string | Account ID |
to |
string | Recipient number |
from |
string | Sender identifier |
status |
string | Current status, e.g., PENDING |
fee |
number | SMS cost in currency units |
currency |
string | Currency code (e.g., USD) |
parts |
number | Number of segments (long SMS may be split) |
submittedAt |
string | Submission time (ISO 8601 format) |
These status codes are business-level response codes, returned in the JSON body.
Standard HTTP status codes are still used at the HTTP layer (e.g., 200, 400, 401, 500),
and these codes should be interpreted along with the HTTP status.
| Code | Description |
|---|---|
0 |
Request processed successfully |
1001 |
Missing or invalid Authorization header |
1002 |
Invalid Basic Authentication format |
1003 |
Missing or invalid account identifier |
1004 |
Account is not activated |
1005 |
Request IP address is restricted (not in the allowed whitelist) |
1006 |
Empty or malformed request body |
1007 |
Required parameters are missing |
1008 |
Invalid messageType parameter |
1009 |
Invalid phone number format (must be E.164) |
1010 |
Pricing is unavailable for the current country or region |
1011 |
Insufficient account balance |
1012 |
Template does not exist, is not approved, or has expired |
1013 |
Missing required variable(s) for the given phone recipient |
1000 |
Other or unspecified server-side error |
ℹ️ These codes are included in the response body under the
codefield,
while the HTTP status code will typically be200 OKif the request was technically successful,
or4xx/5xxif a transport-level error occurs.