Skip to content
Connect Media Connect Media

Developers

Ship SMS in minutes, not days.

One HTTPS endpoint, Bearer-token auth and JSON responses. Send single or bulk SMS, check balance, pull delivery history and read two-way replies.

Quickstart

Three steps to your first message

Step 1

Create an account

Sign up on the dashboard and top up credit.

Step 2

Generate a key

Go to Profile → API keys. The 64-character key is shown once, so store it in an environment variable.

Step 3

Send

POST action=send with a recipient and message. A 201 code means the message was accepted.

Code samples

Copy, paste, send

<?php
$ch = curl_init('https://dashboard.connectmedia.co.ke/api.php');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('CM_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        'action'  => 'send',
        'to'      => '254712345678',
        'message' => 'Payment received. Thank you!',
    ]),
]);
$res = json_decode(curl_exec($ch), true);
if (($res['code'] ?? '') !== '201') {
    error_log('SMS failed: ' . ($res['message'] ?? 'no response'));
}

Endpoint

One URL, four actions

Send requests to https://dashboard.connectmedia.co.ke/api.php as JSON or form data. Authenticate with Authorization: Bearer <key>; the X-Api-Key header also works.

  • send → 201to (254XXXXXXXXX, comma-separated for bulk), message, optional sender (max 11 chars), schedule and schedule_datetime (Africa/Nairobi).
  • balance → 200Current account credit.
  • history → 202Sent messages and delivery status, with limit, offset, start_date and end_date.
  • inbox → 302Replies from two-way SMS, with limit and offset.

Responses

Check code, not HTTP status

Every response uses the same JSON envelope. HTTP status is usually 200, so the application code tells you what happened.

{
  "code": "201",
  "message": "…",
  "data": { … },
  "api_version": "…"
}
CodeMeaning
100Invalid or missing API key
101Insufficient balance
102Rejected (content, hold or gateway busy)
103No action given
104No valid recipients
105Message missing
106Banned words detected
500Server or gateway failure

Good to know

Before you go live

Phone numbers

International format without the plus: 254712345678. Bad numbers return code 104.

Retries

A retried request can send the message twice. De-duplicate on your side before retrying after a timeout.

Keep keys secret

Send the key in a header, not the query string, and call the API from your server, never from a browser or mobile app.

OpenAPI 3 spec

Import into Postman or Insomnia, or generate a client. Download the spec.

Prefer Postman? Open our public Postman workspace or download the collection. We are also listed on RapidAPI.

Official libraries: PHP (composer require connectmedia/sms), Python (pip install connectmedia-sms) and Node.js (npm install connectmedia-sms).

Sending high volumes continuously? SMPP connections are available on request. Email us or read SMPP vs HTTP API.

Sender IDs

Send under your brand name. Register a sender ID.

Payment alerts

See how to send SMS receipts from M-Pesa callbacks.

Need a hand integrating?

Our Nairobi team helps with setup, sender IDs, USSD and IVR integrations.