KIMISMS Bulk SMS API
Send SMS messages to any Kenyan mobile network programmatically. Two endpoints. No SDK required. Works from any language.
Overview
The KIMISMS REST API lets you send SMS messages from any application. All requests and responses use JSON over HTTPS.
client_id and client_secret.POST /api/generate-token to receive a 30-day Bearer token.POST /api/send-sms with the token in every request.Base URL
Authentication
The API uses OAuth 2 client credentials. Every protected request needs a Bearer token in the Authorization header.
expires_in field is in seconds.
Error Codes
| Code | Meaning | Common cause |
|---|---|---|
| 200 | OK | Request succeeded |
| 400 | Bad Request | Validation error — see field messages in body |
| 401 | Unauthorized | Missing, expired or invalid Bearer token |
| 429 | Too Many Requests | Rate limit exceeded — back off and retry |
| 500 | Server Error | Unexpected failure — contact support |
Generate Token
Exchange your client_id and client_secret for a JWT Bearer token required by all other endpoints.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| grant_type | string | required | Must be client_credentials |
| client_id | string | required | Your API client ID from Developer → Credentials |
| client_secret | string | required | Your API client secret from Developer → Credentials |
Code examples
Responses
Send SMS
Send a single SMS to any mobile number. Requires a valid Bearer token and an approved Sender ID on your account.
Request headers
| Header | Required | Value |
|---|---|---|
| Authorization | required | Bearer <access_token> |
| Content-Type | required | application/json |
| Idempotency-Key | optional | Unique UUID — prevents duplicate sends on retry |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| sender_name | string | required | Approved Sender ID on your account, e.g. KIMISMS |
| contact | string | required | Recipient phone without +, e.g. 254712345678 (9–13 digits) |
| message | string | required | SMS body. 160 chars = 1 unit; longer messages split and billed per part. |
| callback_url | string | optional | HTTPS URL that receives a delivery-status webhook |
Code examples
Responses
Idempotency
Pass a unique Idempotency-Key header to safely retry without sending duplicate messages. Keys are cached 24 hours.
Delivery Callbacks
Provide a callback_url and KIMISMS will POST a delivery status update to it once the message is delivered or fails. Your endpoint must respond with HTTP 200 within 5 seconds.