Swift SMS

Developer docs

Use Swift SMS to send SMS and OTP messages for a business, with sender-specific API keys that can be regenerated at any time.

Sender keys SMS OTP ERPNext-ready

Authentication

Each sender ID has its own API key. Pass it with every request.

  • Header: X-Sender-Key: sx_...
  • Fallback body field: sender_api_key
  • Rotating the sender key invalidates the old key immediately.

Sender IDs

A business can have multiple sender IDs. One can be marked primary, and each sender can be used independently.

  • Set or change sender IDs from the dashboard.
  • Use the sender-specific API key for that sender.
  • If you regenerate the key, update the client app right away.

Send SMS

POST to the SMS endpoint with the sender key, recipient, and message.

POST https://sms.brillsinnovation.com/send_sms.phpHeaders:
  Content-Type: application/json
  X-Sender-Key: sx_your_sender_key

Body:
{
  "to": "0540519119",
  "message": "Hello from Swift SMS",
  "sender_id": "TESTSMS"
}

Send OTP

Use the same sender key and let Swift SMS send the one-time password message.

POST https://sms.brillsinnovation.com/send_otp.phpHeaders:
  Content-Type: application/json
  X-Sender-Key: sx_your_sender_key

Body:
{
  "phone": "0540519119",
  "pin_length": 6,
  "expiry_amount": 10,
  "expiry_duration": "minutes",
  "sender_id": "TESTSMS"
}

Verify OTP

Verify a code that was previously sent to the phone number.

POST https://sms.brillsinnovation.com/verify_otp.phpHeaders:
  Content-Type: application/json
  X-Sender-Key: sx_your_sender_key

Body:
{
  "phone": "0540519119",
  "code": "243714"
}

cURL example

curl -X POST https://sms.brillsinnovation.com/send_sms.php \
  -H "Content-Type: application/json" \
  -H "X-Sender-Key: sx_your_sender_key" \
  -d '{"to":"0540519119","message":"Test SMS","sender_id":"TESTSMS"}'

ERPNext notes

  • Use a server script, HTTP request node, or custom app integration.
  • Store the sender key securely in ERPNext.
  • Call the SMS or OTP endpoint directly from your workflow.
  • When a sender key changes, update the ERPNext setting.

Common response fields

Field Meaning
success Whether the request was accepted and processed.
message Human-readable status text.
data.request_id SMS batch identifier.
data.id OTP request identifier.