Skip to main content

SMS REST API (Legacy)

Send SMS to your customers with a simple, reliable REST API. This legacy endpoint supports all the messaging features you need—from basic texts to scheduled sends, concatenated messages, and bulk broadcasting.

Security Update

Starting from January 15th, 2026, HTTP connections are accepted only over TLS (HTTPS). Non-TLS connections will be rejected. GET requests and form-encoded POST requests will no longer be accepted—only POST with JSON payload over HTTPS is supported.

Base URLs

Choose the endpoint based on your account type:

Legacy customers:

https://secure.agiletelecom.com/services/

New customers:

https://http-api.agiletelecom.com/services/

Authentication

Add one of these authentication methods to your request headers:

Basic Authentication

Authorization: Basic <base64_encoded_credentials>
X-Api-Key: YOUR_API_KEY

Send SMS

Send SMS messages to one or multiple recipients in a single API call.

Endpoint

POST /sms/send

Required Headers

Content-Type: application/json

Request Body

{
"globalId": "string",
"maxIdLen": 64,
"enableConcatenated": true,
"enableUnicode": true,
"enableDelivery": true,
"simulation": false,
"messages": [
{
"ids": ["string"],
"destinations": ["+393351234567"],
"sender": "string",
"body": "string",
"hexBody": false,
"udhData": "string",
"scheduling": "2025-12-08 06:00:00.002+0200"
}
]
}

Request Parameters

FieldTypeRequiredDefaultDescription
globalIdstringNo--Unique identifier for this send request, useful for tracking and correlating responses
maxIdLenintegerNo64Maximum length (characters) of message IDs
enableConcatenatedbooleanNotrueAutomatically split long messages into multiple SMS parts
enableUnicodebooleanNotrueSupport special characters and non-ASCII text
enableDeliverybooleanNotrueReceive delivery notifications via webhook
simulationbooleanNofalseTest your request without actually sending messages
messagesarrayYes--Array of message objects to send

Message Parameters

FieldTypeRequiredDefaultDescription
destinationsarrayYes--Phone numbers in international format (include country code)
idsarrayNo--Unique identifiers for tracking each message
senderstringYes--Sender ID (alphanumeric max 11 chars, or numeric max 16 digits)
bodystringYes--Message content (text or HEX if hexBody=true)
hexBodybooleanNofalseSet true if body is HEX-encoded
udhDatastringNo--User Data Header for special message formatting
schedulingstringNo--Delivery time in format "yyyy-MM-dd HH:mm:ss.SSSZ"

Check Account Credit

Verify your remaining account balance before sending.

Endpoint

GET /sms/credit

Success Response

{
"credit": 10.324
}

Response Formats

Success Response (2XX)

When your request succeeds, you'll receive:

{
"globalId": "f9b865ef-5ce3-4e44-b65c-615fd71bbd09",
"processedMessages": 2,
"processedSmsParts": 4,
"credit": 10.324
}
FieldTypeDescription
globalIdstringEcho of your global ID from the request
processedMessagesintegerNumber of message objects accepted
processedSmsPartsintegerTotal SMS parts to be sent (higher if concatenation occurs)
creditdoubleYour remaining credit in EUR

Client Errors (4XX)

Validation or authentication issues:

{
"status": "fail",
"data": {
"body": "Missing message body(ies)",
"number": "Wrong destination number(s)"
},
"code": 6
}
FieldTypeDescription
statusstringAlways "fail" for 4XX responses
dataobject/stringDetails about which fields failed validation
codeintegerError code (see table below)

Server Errors (5XX)

Service unavailability or timeouts:

{
"status": "error",
"message": "Number check service unavailable",
"code": 9
}
FieldTypeDescription
statusstringAlways "error" for 5XX responses
messagestringHuman-readable error description
codeintegerError code (see table below)

Error Codes

CodeDescription
1Wrong credentials
2Insufficient credit
3Destination not allowed
4Unknown error
5Destination number too short
6Destination number too long
7Invalid destination number
8Server error
9Service timeout
10Wrong global ID length
26Sender alias not allowed
100Source IP not allowed

Code Examples

Simple SMS

Send a basic text message to a single recipient.

curl -X POST https://secure.agiletelecom.com/services/sms/send \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"messages": [
{
"destinations": ["+393471234567"],
"sender": "MyApp",
"body": "Hello! This is your test message from Agile Telecom."
}
]
}'

SMS with Custom Message ID

Track individual messages with unique IDs for delivery reporting.

curl -X POST https://secure.agiletelecom.com/services/sms/send \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"messages": [
{
"ids": ["msg-001-20260408"],
"destinations": ["+393471234567"],
"sender": "MyApp",
"body": "Order confirmed! Your purchase reference is ORD-2026-4521."
}
]
}'

Long Message (Concatenated SMS)

Automatically split long messages into multiple SMS parts. Requires enableConcatenated: true.

curl -X POST https://secure.agiletelecom.com/services/sms/send \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"enableConcatenated": true,
"messages": [
{
"destinations": ["+393471234567"],
"sender": "Newsletter",
"body": "Stay healthy this summer with our top wellness tips. Drink plenty of water throughout the day to stay hydrated. Always wear broad-spectrum sunscreen (SPF 30+) to protect your skin from UV damage. Include fresh fruits and vegetables in every meal. Exercise for at least 30 minutes during cooler morning or evening hours."
}
]
}'

Unicode Message

Send messages with special characters, accents, and non-ASCII text.

curl -X POST https://secure.agiletelecom.com/services/sms/send \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"enableUnicode": true,
"messages": [
{
"destinations": ["+393471234567"],
"sender": "WeatherAlert",
"body": "ATTENZIONE: Domani temperature fino a 38°C. Rimani idratato e stai al riparo dalle 12:00 alle 17:00."
}
]
}'

Scheduled SMS

Send a message at a specific time in the future.

curl -X POST https://secure.agiletelecom.com/services/sms/send \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"messages": [
{
"destinations": ["+393471234567"],
"sender": "ReminderBot",
"body": "Reminder: Your appointment is tomorrow at 10:00 AM. Please arrive 10 minutes early.",
"scheduling": "2026-04-09 19:30:00.000+0200"
}
]
}'

Bulk SMS to Multiple Recipients

Send the same message to multiple phone numbers in one request.

curl -X POST https://secure.agiletelecom.com/services/sms/send \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"messages": [
{
"ids": ["bulk-promo-001", "bulk-promo-002"],
"destinations": ["+393471234567", "+393471234568"],
"sender": "PromoShop",
"body": "Limited-time offer: Buy 2 get 1 free on all summer items! Valid until Sunday midnight."
}
]
}'

Check Account Credit

Verify your current credit balance before sending campaigns.

curl -X GET https://secure.agiletelecom.com/services/sms/credit \
-H "X-Api-Key: YOUR_API_KEY"

Delivery Notifications

When you enable delivery notifications, AgileTelecom will post the delivery status of each SMS to your webhook endpoint (configured in your account settings). This lets you track whether messages were successfully delivered, rejected, or expired.

Webhook Payload Format

{
"messageId": "msg-001-20260408",
"destination": "+393471234567",
"statusCode": 3,
"description": "Delivered",
"doneDate": "2026-04-08 14:35:22.045+0200",
"concatTotal": 1,
"concatProgressive": 1,
"lcrOperator": "22210",
"realOperator": "22201",
"price": 0.005
}

Report Fields

FieldTypeDescription
messageIdstringYour message ID from the send request
destinationstringRecipient's phone number
statusCodeintegerStatus code (see table below)
descriptionstringHuman-readable status (Delivered, Rejected, etc.)
doneDatestringWhen the delivery status was determined
concatTotalintegerTotal parts if message was concatenated
concatProgressiveintegerWhich part of a concatenated message this is
lcrOperatorstringNetwork operator code (if available)
realOperatorstringActual carrier handling the number
pricedoubleCredit cost for this SMS

Delivery Status Codes

CodeDescriptionMeaning
1AcceptedOperator has accepted the message
2RejectedOperator rejected the message
3DeliveredMessage successfully delivered to phone
4ExpiredMessage was not delivered before expiry
5DeletedMessage was deleted
6UndeliverableOperator unable to deliver

Best Practices

Message Tracking

Always include unique IDs in the ids array when sending messages—this makes webhook delivery reports much easier to match against your records.

Phone Number Format

Use international format with country code. Examples: +39 for Italy, +44 for UK, +1 for USA, +33 for France.

SMS Length Limits
  • Standard (GSM 7-bit alphabet): 160 characters per part
  • Unicode (special characters): 70 characters per part
  • Messages longer than these limits are automatically split into multiple parts (concatenated SMS) if enableConcatenated is true
Sender ID Rules
  • Alphanumeric: Maximum 11 characters (e.g., "MyCompany", "Support")
  • Numeric: Maximum 16 digits (e.g., "1234567890123456")
  • Check error code 26 if your sender ID is rejected
Rate Limits

Contact AgileTelecom support to confirm your account's rate limits (messages per second/minute). Exceeding these limits may result in request queueing or rejection.

Encoding

By default, messages are sent as UTF-8 text. For HEX-encoded bodies, set hexBody: true in your request.

Test with Postman

We provide pre-configured Postman collections to speed up your testing:

Download Collections

How to Import

  1. Open Postman
  2. Click Import (top left corner)
  3. Upload the downloaded JSON file
  4. Confirm the import

Set Your Credentials

  1. In Postman, open the collection in the left sidebar
  2. Navigate to the Variables tab
  3. Update the "Current Value" for:
    • username: Your Agile Telecom username (if using Basic Auth)
    • password: Your password (if using Basic Auth)
    • api-key: Your API key (if using API Key auth)
    • enable_apikey: Set to true for API Key, false for Basic Auth
  4. Click Save
Test Data

The collection includes sample requests and placeholder credentials. Replace them with your real credentials before sending actual messages.

Generate Code Snippets

Generate integration code directly from Postman:

  1. Open any request in the collection
  2. Click the </> code icon (right side)
  3. Select your language (cURL, Python, Node.js, PHP, Java, C#, Go, Ruby)
  4. Copy the generated code into your application

Troubleshooting

Error 1 (Wrong credentials): Verify your API key or username/password are correct and enabled in your account.

Error 2 (Insufficient credit): Your account balance is too low. Check credit with the /sms/credit endpoint and top up if needed.

Error 26 (Sender alias not allowed): The sender ID you used is not approved. Configure allowed sender IDs in your account settings.

Error 100 (Source IP not allowed): Your server's IP address is not whitelisted. Update IP whitelist in your account settings.

Need Help?

For technical support or billing questions, reach out to AgileTelecom:

Email: help@agiletelecom.com

Next Steps

Explore related APIs and protocols: