Developer-first SMS API for Ghana

One REST API for transactional SMS, bulk sends, and OTP verification. Bearer keys, idempotent POST, inspectable delivery reports, and signed webhooks, the same pipeline the dashboard uses.

A developer writing code on two monitors, with a phone on a stand beside the keyboard
POST /v1/messagesTEST

The request body

{
  "to": "+233200000001",
  "sender_id": "TAYSEND",
  "message": "Hello from Taysend",
  "type": "transactional"
}
Answer202 Accepted
Auth
Bearer keys
Keys
TEST and LIVE
Sends
Idempotent POST

Send your first message

  1. 01

    Create an account and copy a TEST key. It is shown once.

  2. 02

    POST /v1/messages with a Bearer key and an Idempotency-Key.

  3. 03

    Open the message id. Accepted is not the same as delivered.

export TAYSEND_KEY=sms_test_your_key

curl -X POST "https://api.taysend.com/v1/messages" \
  -H "Authorization: Bearer $TAYSEND_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+233200000001",
    "sender_id": "TAYSEND",
    "message": "Hello from Taysend",
    "type": "transactional"
  }'

The Idempotency-Key header is optional.

Try it in the sandbox

Try it in the sandbox

No API key. Your Ghana number receives one real text a day, or pick a simulated outcome.

SandboxLIVE

One real SMS to this number per day. Sender Taysend.

Arrives as “Taysend sandbox: Hello from Taysend”, 35 of 160 characters.

Response

{
  "id": "msg_…",
  "status": "QUEUED",
  "environment": "LIVE"
}

What the API covers

One REST surface for send, OTP, delivery, and webhooks. The dashboard calls the same paths.

  • Bearer sms_test_

    Authentication

    Bearer API keys prefixed sms_test_ or sms_live_. Keys are shown once at creation. TEST keys cannot send LIVE traffic.

  • POST /v1/messages

    Send single or bulk

    POST /v1/messages accepts to for one recipient or recipients for bulk. Include sender_id and either message or template_id. type is optional and defaults to transactional; marketing, otp, alert, and service are also accepted.

  • POST /v1/verify/send

    OTP verification

    POST /v1/verify/send and POST /v1/verify/check handle codes on a dedicated queue. Codes are hashed at rest; TEST never hits a real handset.

  • GET /v1/messages/:id

    Delivery reports

    GET /v1/messages/:id returns status, segments, and encoding. 202 Accepted on send means accepted. Delivery is a later delivery report state.

  • X-Taysend-Signature

    Webhooks

    Signed payloads. The X-Taysend-Signature header carries a t= timestamp and a v1= HMAC signature. Events include message.delivered, message.failed, message.expired, and message.rejected.

  • Idempotency-Key

    Idempotency

    Send Idempotency-Key with POST /v1/messages. Replay the same key and body for the original response. A different body with the same key returns a conflict.

  • Simulated numbers

    TEST vs LIVE

    TEST uses simulated numbers with known outcomes (+233200000001 delivers, +233200000002 fails, etc.). LIVE requires an approved sender ID.

  • INSUFFICIENT_BALANCE

    Errors and rate limits

    Structured error envelope with codes like INSUFFICIENT_BALANCE. Rate limit headers document remaining quota. See /developers/errors and /developers/rate-limits.

Encoding and Ghana routing

Network is inferred from the recipient prefix: MTN, Telecel, or AT. Encoding is computed from the message body. GSM-7 allows 160 characters per segment. UCS-2 (Unicode) uses 70. Longer messages split into parts of 153 or 67. The API returns segment count on acceptance so you can reconcile wallet charges.

160

characters per segment

GSM-7

70

characters per segment

UCS-2 (Unicode)

Routing

Prefix picks the network

  • MTN
  • Telecel
  • AT

Straight answers

If something here is product behaviour, it matches the dashboard and the API.

  1. 01

    What is the API base URL?

    Production API host is https://api.taysend.com. Copy-paste examples in the docs use this host.

  2. 02

    How do I send my first message?

    Create an account at /register and a TEST key in the console, then POST /v1/messages with Authorization: Bearer sms_test_..., an Idempotency-Key header, and a JSON body with to, sender_id, and message.

  3. 03

    Can I send bulk SMS through the API?

    Yes. Pass a recipients array instead of to. Bulk responses include a count. Campaign snapshot logic applies when sending from the dashboard.

  4. 04

    How do webhooks verify authenticity?

    Each webhook carries an X-Taysend-Signature header with t= (timestamp) and v1= (HMAC signature). Verify the signature before trusting the payload. Full reference at /developers/webhooks.

Create a TEST key and hit a simulated number today.

TEST uses simulated numbers with known outcomes. +233200000001 delivers, +233200000002 fails.

Get API keyQuick start guide