Skip to main content
POST
/
sms
/
send
cURL
curl --request POST \
  --url https://api.simpu.co/sms/send \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "recipients": "2348023456789, 2348098765432",
  "sender_id": "Simpu",
  "channel": "sms",
  "content": "Hello! World. This is a test message.",
  "template_id": "674535b2b39158b9aae90188fcec23eb",
  "personalisation": [
    {
      "to": "2348023456789",
      "substitutions": {
        "name": "John Doe"
      }
    }
  ],
  "external_ref": "674535b2b39158b9aae90188fcec23eb",
  "is_trackable": false,
  "callback": "https://example.com/sms/delivery_report"
}
'
import requests

url = "https://api.simpu.co/sms/send"

payload = {
    "recipients": "2348023456789, 2348098765432",
    "sender_id": "Simpu",
    "channel": "sms",
    "content": "Hello! World. This is a test message.",
    "template_id": "674535b2b39158b9aae90188fcec23eb",
    "personalisation": [
        {
            "to": "2348023456789",
            "substitutions": { "name": "John Doe" }
        }
    ],
    "external_ref": "674535b2b39158b9aae90188fcec23eb",
    "is_trackable": False,
    "callback": "https://example.com/sms/delivery_report"
}
headers = {
    "Authorization": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    recipients: '2348023456789, 2348098765432',
    sender_id: 'Simpu',
    channel: 'sms',
    content: 'Hello! World. This is a test message.',
    template_id: '674535b2b39158b9aae90188fcec23eb',
    personalisation: [{to: '2348023456789', substitutions: {name: 'John Doe'}}],
    external_ref: '674535b2b39158b9aae90188fcec23eb',
    is_trackable: false,
    callback: 'https://example.com/sms/delivery_report'
  })
};

fetch('https://api.simpu.co/sms/send', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.simpu.co/sms/send",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'recipients' => '2348023456789, 2348098765432',
    'sender_id' => 'Simpu',
    'channel' => 'sms',
    'content' => 'Hello! World. This is a test message.',
    'template_id' => '674535b2b39158b9aae90188fcec23eb',
    'personalisation' => [
        [
                'to' => '2348023456789',
                'substitutions' => [
                                'name' => 'John Doe'
                ]
        ]
    ],
    'external_ref' => '674535b2b39158b9aae90188fcec23eb',
    'is_trackable' => false,
    'callback' => 'https://example.com/sms/delivery_report'
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: <api-key>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.simpu.co/sms/send"

	payload := strings.NewReader("{\n  \"recipients\": \"2348023456789, 2348098765432\",\n  \"sender_id\": \"Simpu\",\n  \"channel\": \"sms\",\n  \"content\": \"Hello! World. This is a test message.\",\n  \"template_id\": \"674535b2b39158b9aae90188fcec23eb\",\n  \"personalisation\": [\n    {\n      \"to\": \"2348023456789\",\n      \"substitutions\": {\n        \"name\": \"John Doe\"\n      }\n    }\n  ],\n  \"external_ref\": \"674535b2b39158b9aae90188fcec23eb\",\n  \"is_trackable\": false,\n  \"callback\": \"https://example.com/sms/delivery_report\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.simpu.co/sms/send")
  .header("Authorization", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"recipients\": \"2348023456789, 2348098765432\",\n  \"sender_id\": \"Simpu\",\n  \"channel\": \"sms\",\n  \"content\": \"Hello! World. This is a test message.\",\n  \"template_id\": \"674535b2b39158b9aae90188fcec23eb\",\n  \"personalisation\": [\n    {\n      \"to\": \"2348023456789\",\n      \"substitutions\": {\n        \"name\": \"John Doe\"\n      }\n    }\n  ],\n  \"external_ref\": \"674535b2b39158b9aae90188fcec23eb\",\n  \"is_trackable\": false,\n  \"callback\": \"https://example.com/sms/delivery_report\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.simpu.co/sms/send")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"recipients\": \"2348023456789, 2348098765432\",\n  \"sender_id\": \"Simpu\",\n  \"channel\": \"sms\",\n  \"content\": \"Hello! World. This is a test message.\",\n  \"template_id\": \"674535b2b39158b9aae90188fcec23eb\",\n  \"personalisation\": [\n    {\n      \"to\": \"2348023456789\",\n      \"substitutions\": {\n        \"name\": \"John Doe\"\n      }\n    }\n  ],\n  \"external_ref\": \"674535b2b39158b9aae90188fcec23eb\",\n  \"is_trackable\": false,\n  \"callback\": \"https://example.com/sms/delivery_report\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "674535b2b39158b9aae90188fcec23eb",
  "recipients": [
    "2348023456789"
  ],
  "sender_id": "Simpu",
  "is_trackable": false,
  "content": "Hello! World. This is a test message.",
  "external_ref": "674535b2b39158b9aae90188fcec23eb",
  "callback": "https://example.com/sms/delivery_report",
  "template_id": "674535b2b39158b9aae90188fcec23eb",
  "personalisation": [
    {
      "to": "2348023456789",
      "substitutions": {
        "name": "John Doe"
      }
    }
  ],
  "created_datetime": "2024-06-28T23:56:38.128604+00:00",
  "updated_datetime": "2024-06-28T23:56:38.128604+00:00",
  "meta": {
    "method": "POST",
    "resource": "/send/sms",
    "estimate": {
      "available_balance": 1000.5,
      "charge": 3,
      "encoding": "UTF-8",
      "message_length": 160,
      "pages": 1
    }
  }
}
{
  "status": 200,
  "message": "Invalid request",
  "errors": [
    {
      "field": "name",
      "message": "Error in field: 'name' Field required.",
      "type": "missing"
    }
  ]
}

Authorizations

Authorization
string
header
required

An API key to authenticate requests

Body

application/json

SMS message object

recipients
string
required

Recipients of the SMS message, comma separated list of phone numbers

Example:

"2348023456789, 2348098765432"

sender_id
string
required

Sender ID of the SMS message

Maximum string length: 11
Example:

"Simpu"

channel
enum<string>

Channel to send the SMS message

Available options:
sms,
whatsapp
Example:

"sms"

content
string

Content of the SMS message, this is required if a template ID is not specified

Example:

"Hello! World. This is a test message."

template_id
string

Template ID of the SMS message, this is required if content is not specified

Example:

"674535b2b39158b9aae90188fcec23eb"

personalisation
object[]

Personalisation of the SMS message, this is applicable if a template ID is specified

external_ref
string

This is a reference to the message in your system

Example:

"674535b2b39158b9aae90188fcec23eb"

is_trackable
boolean
default:false

This determines if links in the message should be tracked, links in the message will be replaced with trackable links

Example:

false

callback
string

This is the URL to receive delivery reports for the message test

Example:

"https://example.com/sms/delivery_report"

Response

SMS response

id
string
required

Unique ID of the SMS message

Example:

"674535b2b39158b9aae90188fcec23eb"

recipients
array
required

Recipients of the SMS message

Example:
["2348023456789"]
sender_id
string
required

Sender ID of the SMS message

Maximum string length: 11
Example:

"Simpu"

is_trackable
boolean
required

This determines if links in the message should be tracked

Example:

false

content
string

Content of the SMS message

Example:

"Hello! World. This is a test message."

external_ref
string

This is a reference to the message in your system

Example:

"674535b2b39158b9aae90188fcec23eb"

callback
string

This is the URL to receive delivery reports for the message

Example:

"https://example.com/sms/delivery_report"

template_id
string

Template ID of the SMS message

Example:

"674535b2b39158b9aae90188fcec23eb"

personalisation
object[]

Personalisation of the SMS message

created_datetime
string

Date and time the SMS was created

Example:

"2024-06-28T23:56:38.128604+00:00"

updated_datetime
string

Date and time the SMS token was last updated, if any

Example:

"2024-06-28T23:56:38.128604+00:00"

meta
object