sendbaze
Menu

Getting started

Quickstart

From an empty account to a delivered message. Email needs a verified domain; SMS needs nothing but a number.

1. Create an account and a test key

Sign up, create an organisation, then open API keys and create a test key. Test keys start with sk_test_. They run every validation and return an id, but nothing is sent and no credits are used, so you can wire up your code before your domain is verified.

2. Verify a sending domain

Add your domain under Domains. The dashboard shows five DNS records: three DKIM CNAMEs, an MX and an SPF TXT record for the mail subdomain, plus a suggested DMARC record. Add them at your registrar and each one turns green as it is found, usually within five to thirty minutes.

Cloudflare users: set the DKIM CNAMEs to DNS only (grey cloud). Proxied records cannot be verified.

3. Send an email

Once the domain is verified, create a live key and send. The response is { "id": "em_01j9...", "status": "queued" }.

terminal
curl https://api.sendbaze.com/v1/emails \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "from": "orders@yourshop.co.za",
    "to": "thandi@example.com",
    "subject": "Your order #1042 has shipped",
    "html": "<p>Tracking: <b>CG123456789ZA</b></p>"
  }'
send.ts
import { Sendbaze } from "@sendbaze/sdk";

const sendbaze = new Sendbaze({ apiKey: process.env.SENDBAZE_API_KEY! });

const { id } = await sendbaze.emails.send({
  from: "orders@yourshop.co.za",
  to: "thandi@example.com",
  subject: "Your order #1042 has shipped",
  html: "<p>Tracking: <b>CG123456789ZA</b></p>",
});
// id: "em_01j9..." — status arrives by webhook

4. Send an SMS

SMS needs a recipient number in E.164 format and a message class. Transactional messages (OTPs, order updates, reminders) go out at any hour. Marketing messages require a consent record and are held to the 08:00 to 20:00 SAST window, no Sundays or public holidays.

terminal
curl https://api.sendbaze.com/v1/sms \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+27821234567",
    "body": "Your OTP is 482 913. It expires in 5 minutes.",
    "class": "transactional"
  }'
# → { "id": "sm_01j9...", "segments": 1, "credits": 1 }

The response includes segments and credits, so you know what a message cost before it leaves.

5. Check what happened

Fetch any message by id to see its status and timeline. In production you will want webhooks instead of polling.

terminal
curl https://api.sendbaze.com/v1/emails/em_01j9x7k2r4m8q3v5n6b7c8d9e0 \
  -H "Authorization: Bearer sk_live_..."

# {
#   "id": "em_01j9x7k2r4m8q3v5n6b7c8d9e0",
#   "channel": "email",
#   "status": "delivered",
#   "to": "thandi@example.com",
#   "from": "orders@yourshop.co.za",
#   "subject": "Your order #1042 has shipped",
#   "events": [
#     { "type": "queued",    "occurredAt": "2026-09-22T08:14:02.114Z" },
#     { "type": "sent",      "occurredAt": "2026-09-22T08:14:02.688Z" },
#     { "type": "delivered", "occurredAt": "2026-09-22T08:14:04.201Z" }
#   ]
# }

What to do next

  • Add an Idempotency-Key to sends triggered by retries or queues, so a retry never produces a duplicate.
  • Add a webhook endpoint and handle bounces and complaints in your own records.
  • Read the compliance guide before sending marketing SMS.