How to Send SMS
How to Send a Single SMS

How to Send a Single SMS

You can send a single SMS to one or many recipients by making a HTTP POST request with the following:

Endpoint

https://api.smsleopard.com/v1/sms/send

Authorization

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

Sample Request Body

{
	"source": "sms_test",
	"message": "Hello from SMSLeopard API",
	"destination": [
		{
			"number": "07000000001"
		}
	]
}

Code Examples

curl -u ACCOUNT_ID:ACCOUNT_SECRET -H "Content-Type: application/json" -X POST https://api.smsleopard.com/v1/sms/send -d '{"source": "SMSLeopard", "message": "Hello from SMSLeopard API", "destination": [{"number": "+254710000001"}, {"number": "+254710000002"}], "status_url": "https://your-status.url", "status_secret": "supersecret"}'

Payload

  • Message - The message you intend to send to the recipient.
  • Destination - An array of recipient objects with the number you intend to send the message to.
  • Number - The specific recipient number you intend to send to.
  • Source - Sender ID for the message.
Example of a Successful Response

Status code: 201

{
	"success": true,
	"message": "Sent to 1/1. Cost KES 0.90",
	"recipients": [
		{
			"id": "eb4647b2-2695-4aba-958e-0b39d965f6d0",
			"cost": 0.9,
			"number": "+254700000001",
			"status": "queued"
		}
	]
}