Developers

API documentation

Everything you need to send messages from your application: authentication, endpoints and ready-to-run examples.

Base URL https://swiftsmsgh.com/api/v3

Introduction

SWIFT SMS exposes a REST API for sending messages across SMS, WhatsApp, Voice, MMS, Viber and OTP, and for managing contacts and campaigns. Every request and response uses JSON.

All requests must be made over HTTPS and include the headers Accept: application/json and Content-Type: application/json.

Authentication

Authenticate with your API token as a Bearer token. Generate or rotate your token in the dashboard under Developers.

HTTP
Authorization: Bearer YOUR_API_TOKEN
Accept: application/json
Content-Type: application/json

Keep your token secret. Never expose it in client-side code or public repositories.

SDKs

Official, open-source libraries wrap every endpoint below, including authentication, error handling and all message types. They’re the fastest way to integrate.

PHP SDK

PHP 8.0+

composer require swiftsmsgh/swiftsmsgh-api-sdk

Node.js SDK

Node.js 18+ · TypeScript types included

npm install swiftsmsgh-api-sdk

Quick start

require __DIR__ . '/vendor/autoload.php';

use Swiftsms\Swiftsmsgh;
use Swiftsms\SwiftsmsException;

$client = new Swiftsmsgh('YOUR_API_TOKEN', 'YourSenderID');

try {
    // Comma-separate multiple recipients
    $response = $client->send_sms('233538000000,233540000000', 'Hello from SWIFT SMS!');

    // Optional: schedule and override the sender ID
    $client->send_sms('233538000000', 'See you tomorrow', [
        'schedule_time' => '2026-12-25 08:00',
        'sender_id'     => 'MyAlert',
    ]);
} catch (SwiftsmsException $e) {
    echo 'Error: ' . $e->getMessage();
}

Only use the SDKs on your server. Bundling them into front-end code exposes your API token to anyone who visits your site.

Method reference

TaskPHPNode.js
Send SMSsend_sms($to, $msg, $options)sms.send(to, msg, options)
Send to contact lists—sms.sendCampaign(listIds, msg, options)
Voice callsend_voice($to, $msg, $gender, $lang)voice.send(to, msg, gender, lang)
MMSsend_mms($to, $msg, $mediaUrl)mms.send(to, msg, mediaUrl)
OTPsend_otp($to, $msg)otp.send(to, msg)
WhatsAppsend_whatsapp($to, $msg)whatsapp.send(to, msg, options)
Vibersend_viber($to, $msg)viber.send(to, msg, options)
List messages—sms.list(filters)
View a message / campaign—sms.view(uid), campaign.view(uid)
Balancecheck_balance()account.balance()
Profileprofile()account.profile()
Contact groupsall_contact_groups(), view_contact_group($id), delete_contact_group($id)contacts.groups.list(), contacts.groups.create(name), contacts.groups(id).fetch()
Contacts in a groupall_contacts_in_group($id), view_contact($id, $uid), delete_contact($id, $uid)contacts.groups(id).contacts.list(), .create({...}), contacts(uid).update({...})

See each repository’s README for the full list of methods and options.

POST Send a message

https://swiftsmsgh.com/api/v3/sms/send

Send a message to one or more recipients. Separate multiple numbers with a comma. Using PHP or Node.js? The SDKs do this in one line.

ParameterTypeDescription
recipientrequiredstringNumber(s) to send to, including country code. Example: 233241234567,233201234567
sender_idrequiredstringA phone number with country code, or an alphanumeric sender of up to 11 characters.
typerequiredstringMessage type. Use plain for text. See message types.
messagerequiredstringThe body of the message.
schedule_timedatetimeSend later, formatted Y-m-d H:i. Example: 2026-12-20 07:00
dlt_template_idstringDLT content template ID, where required by local regulation.
curl -X POST https://swiftsmsgh.com/api/v3/sms/send \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "recipient": "233241234567",
    "sender_id": "YourName",
    "type": "plain",
    "message": "This is a test message"
  }'

Message types

The same endpoint sends every channel. Set type and add any extra fields the channel needs.

typeChannelExtra parameters
plainSMS—
unicodeSMS (non-Latin characters & emoji)—
otpOne-time passcode—
whatsappWhatsApp—
viberViber—
mmsMMSmedia_url — URL of an image to attach
voiceVoice (text-to-speech)language (e.g. en-gb), gender (male|female)

POST Send to a contact list

https://swiftsmsgh.com/api/v3/sms/campaign

Send a campaign to an entire contact list. Pass the list’s UID as recipient; all other parameters match Send a message.

cURL
curl -X POST https://swiftsmsgh.com/api/v3/sms/campaign \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "recipient": "6415907d0d37a",
    "sender_id": "YourName",
    "type": "plain",
    "message": "Our weekend sale is live!",
    "schedule_time": "2026-12-20 07:00"
  }'

View messages

GET/sms

List all messages sent from your account.

GET/sms/{uid}

Retrieve a single message and its delivery status.

GET/campaign/{uid}/view

Retrieve a campaign and its progress.

Contacts & groups

Contact groups (lists) hold your contacts. Contacts are identified by group UID and contact UID.

Contact groups

GET/contacts

List all contact groups.

POST/contacts

Create a group. Body: {"name": "Customers"}

POST/contacts/{group_id}/show

Retrieve a group.

PATCH/contacts/{group_id}

Rename a group.

DELETE/contacts/{group_id}

Delete a group.

Contacts

POST/contacts/{group_id}/store

Add a contact. Body: PHONE plus optional fields such as FIRST_NAME, LAST_NAME.

POST/contacts/{group_id}/search/{uid}

Retrieve a contact.

PATCH/contacts/{group_id}/update/{uid}

Update a contact.

DELETE/contacts/{group_id}/delete/{uid}

Delete a contact.

POST/contacts/{group_id}/all

List all contacts in a group.

Profile & balance

GET/me

Retrieve your account profile.

GET/balance

Retrieve your remaining SMS units and expiry.

HTTP API

For systems that can’t send headers or JSON, every endpoint is also available under https://swiftsmsgh.com/api/http. Pass your token as the api_token parameter instead of a header.

GET
https://swiftsmsgh.com/api/http/sms/send?recipient=233241234567&sender_id=YourName&type=plain&message=Hello&api_token=YOUR_API_TOKEN

Responses & errors

Every response includes a status field. On success you receive the requested data; on failure, a human-readable message.

Success
{
  "status": "success",
  "data": { ... }
}
Error
{
  "status": "error",
  "message": "A human-readable description of the error."
}

Status codes

CodeMeaning
okMessage sent successfully
100Bad gateway requested
101Wrong action
102Authentication failed
103Invalid phone number
104Phone coverage not active
105Insufficient balance
106Invalid sender ID
107Invalid SMS type
108SMS gateway not active
109Invalid schedule time
110Media URL required
111Message contains a spam word and is awaiting approval

Plugins

Prefer not to write code? Use one of our ready-made plugins.

FAQ

Common questions from developers. For billing, sender IDs and more, visit the full FAQ.

How do I integrate with my application?

Use the REST API with a Bearer token, the simple HTTP API with query parameters, or our official PHP and Node.js SDKs. The documentation has ready-to-run examples.

Where do I find my API token?

Log in and open Developers in the dashboard. You can copy your token there or generate a new one at any time.

Is there a rate limit?

Yes. API requests are rate-limited per account to keep the platform fast for everyone. If you hit the limit, wait a moment and retry. The Node.js SDK can retry automatically.

Can I send to a whole contact list from the API?

Yes. Call the campaign endpoint with your contact list’s UID as the recipient and the message is sent to everyone on that list.

How long can a message be?

A standard SMS holds 160 characters, or 70 if it contains Unicode such as emoji or non-Latin script. Longer messages are split into parts and joined on the handset, and each part counts as one credit.

Can I schedule messages?

Yes. Pick a date and time when you create a campaign, or pass schedule_time in the API, and the message goes out automatically.

Do you offer delivery reports?

Yes. Every message has a live delivery status, and you can filter and export detailed reports at any time.

Why is my message waiting for approval?

Messages that contain words often used in spam are held for a quick review before sending. This protects your sender reputation and delivery rates.

How do I check my balance?

Your remaining credits are shown on the dashboard. Developers can also call the /balance endpoint or use the SDK balance method.

Ready to reach every customer?

Create a free account in under a minute, or talk to our team about volume pricing and dedicated routes.