API documentation

Base URL: https://<your-domain>/api/public. All requests and responses are JSON over HTTPS.

Authentication

Create a key in the dashboard and send it as a bearer token. Keys start with zbs_live_, are shown once, and are stored only as a SHA-256 hash. Never put keys in public website code — call the API from your server, or use a separate revocable key per mobile app.

Authorization: Bearer zbs_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Devices & platforms

Any device that speaks HTTPS can use the API. Send X-Client-Platform with one of web, ios, android, desktop, server, iot so traffic is grouped in your logs. CORS is enabled for browser apps.

Endpoints

MethodPathKeyDescription
GET/v1/statusNoGateway health and whether processing is paused.
GET/v1/meYesThe user and plan the key belongs to.
GET/v1/walletYesCurrent wallet balance.
GET/v1/productsNoCatalog of active products and prices.
POST/v1/products/{slug}YesCall a product. Charges the wallet on success.

Rate limits are per key per minute and depend on your plan. Paid calls are charged at the product price minus your plan discount.

Products

Errors

Errors return { "error": "message" } with an HTTP status code. Failed calls are never charged.

  • 400Invalid JSON body or product name
  • 401Missing, malformed or revoked API key
  • 402Wallet balance too low
  • 403Account suspended
  • 404Product not found or inactive
  • 413Body larger than 32 KB
  • 429Rate limit for your plan exceeded
  • 503Processing paused by the operator

Examples

cURL

curl https://<your-domain>/api/public/v1/wallet \
  -H "Authorization: Bearer $ZABAH_KEY" -H "X-Client-Platform: server"

JavaScript / Node

const res = await fetch("https://<your-domain>/api/public/v1/products/sms-send", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.ZABAH_KEY}`, "Content-Type": "application/json", "X-Client-Platform": "server" },
  body: JSON.stringify({ to: "+93700000000", text: "Hello" }),
});
const data = await res.json();

Android (Kotlin, OkHttp)

val req = Request.Builder()
  .url("https://<your-domain>/api/public/v1/me")
  .header("Authorization", "Bearer $key")
  .header("X-Client-Platform", "android")
  .build()
client.newCall(req).execute().use { println(it.body!!.string()) }

iOS (Swift)

var req = URLRequest(url: URL(string: "https://<your-domain>/api/public/v1/wallet")!)
req.setValue("Bearer \(key)", forHTTPHeaderField: "Authorization")
req.setValue("ios", forHTTPHeaderField: "X-Client-Platform")
let (data, _) = try await URLSession.shared.data(for: req)

Python

import requests
r = requests.get("https://<your-domain>/api/public/v1/status")
print(r.json())