Back to Docs

SMS API

Type-required messaging with built-in OTP, marketing, and transactional types

Global Delivery

Send to 195+ countries

Sub-2 Second

Ultra-fast delivery

Secure

Dual-key encryption

Real-time

Instant delivery reports

Dual-Key Authentication

All SMS API requests require both keys:

API KeyPermanent
X-Smsly-Key-Id: sk_live_xxx
SDK KeyRotatable
X-SMSLY-SDK-KEY: sdk_live_xxx

Quick Start

Choose your language. Languages without SDK use raw HTTP.

Python
from smsly import SMSly

# Initialize with dual keys
client = SMSly(
    api_key="sk_live_xxx",
    sdk_key="sdk_live_xxx"
)

# Send OTP
response = client.sms.otp("+1234567890", "123456")
print(f"Message ID: {response.message_id}")

# Send marketing SMS with scheduling
client.sms.marketing(
    "+1234567890",
    "50% off today only!",
    send_later="tomorrow 9am"
)

# Send transactional SMS
client.sms.transactional(
    "+1234567890",
    "Your order #12345 has shipped!"
)

API Endpoints

POST/v1/sms/otpSend OTP code
POST/v1/sms/marketingSend marketing SMS
POST/v1/sms/transactionalSend transactional SMS
POST/v1/sms/customSend custom type SMS
POST/v1/sms/bulkSend bulk SMS batch
GET/v1/sms/:idGet message status
GET/v1/smsList all messages
DELETE/v1/sms/:id/cancelCancel scheduled message

Message Types

OTP

One-time passwords with auto-generated or custom codes

client.sms.otp(to, code)

Marketing

Promotional messages with unsubscribe handling

client.sms.marketing(to, msg)

Transactional

Order updates, alerts, notifications

client.sms.transactional(to, msg)

Ready to send your first SMS?