Developer documentation
ড্যাশবোর্ড
Getting started
The Amarseba API lets your servers send SMS and read your wallet balance over plain HTTPS and JSON. This guide takes you from zero to a first request in about a minute.
Create an API key
Open API Keys in your account settings and create a key. Pick test mode while you build: a test key runs the full flow without sending SMS or charging your wallet. The secret is shown exactly once, so store it in your server's secret manager or environment right away.
export AMARSEBA_API_KEY="sk-ams-test-…"
Base URL
Every endpoint lives under one versioned base URL. All requests must use HTTPS.
https://e-amarseba.com/api/v1
Make your first request
Check your wallet balance. It works with both test and live keys and needs the wallet:read scope.
wallet:read
curl -X GET https://e-amarseba.com/api/v1/wallet/balance \
-H "Authorization: Bearer $AMARSEBA_API_KEY" \
-H "Accept: application/json"
use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.amarseba.key'))
->acceptJson()
->get('https://e-amarseba.com/api/v1/wallet/balance');
$result = $response->json();
const response = await fetch("https://e-amarseba.com/api/v1/wallet/balance", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.AMARSEBA_API_KEY}`,
Accept: "application/json",
},
});
const result = await response.json();
import os
import requests
response = requests.get(
"https://e-amarseba.com/api/v1/wallet/balance",
headers={
"Authorization": f"Bearer {os.environ['AMARSEBA_API_KEY']}",
"Accept": "application/json",
},
)
result = response.json()
{
"success": true,
"message": "Wallet balance retrieved",
"data": {
"balance": "100.00",
"currency": "BDT",
"status": "active"
},
"code": 200,
"timestamp": "2026-09-26T10:00:00.000000Z"
}
Send a test SMS
With a sk-ams-test- key, send an SMS. Nothing reaches a handset and nothing is charged, but you get the same 202 Accepted response a live key returns. A 202 means the SMS is accepted and queued; it is sent in the background.
bulk-sms:send
curl -X POST https://e-amarseba.com/api/v1/bulk-sms/send \
-H "Authorization: Bearer $AMARSEBA_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"to": "01712345678",
"body": "Your OTP is 4821. It expires in 5 minutes."
}'
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
$response = Http::withToken(config('services.amarseba.key'))
->acceptJson()
->withHeaders(['Idempotency-Key' => (string) Str::uuid()])
->post('https://e-amarseba.com/api/v1/bulk-sms/send', [
'to' => '01712345678',
'body' => 'Your OTP is 4821. It expires in 5 minutes.',
]);
$result = $response->json();
const response = await fetch("https://e-amarseba.com/api/v1/bulk-sms/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AMARSEBA_API_KEY}`,
Accept: "application/json",
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
"to": "01712345678",
"body": "Your OTP is 4821. It expires in 5 minutes."
}),
});
const result = await response.json();
import os
import uuid
import requests
response = requests.post(
"https://e-amarseba.com/api/v1/bulk-sms/send",
headers={
"Authorization": f"Bearer {os.environ['AMARSEBA_API_KEY']}",
"Accept": "application/json",
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"to": "01712345678",
"body": "Your OTP is 4821. It expires in 5 minutes.",
},
)
result = response.json()
{
"success": true,
"message": "SMS queued for delivery",
"data": {
"batch_id": "bat_01j8z3k6q9w2m4n7p5r8t1v3x6",
"type": "single",
"status": "queued",
"mode": "test",
"sender": "Amarseba",
"is_masking": false,
"recipient_count": 1,
"total_parts": 1,
"total_cost": "0.30",
"balance_after": "100.00",
"messages": [
{
"message_id": "msg_01j8z3k6qa4b8c2d6e0f3g7h1j",
"to": "8801712345678",
"encoding": "gsm7",
"parts": 1,
"cost": "0.30",
"status": "queued"
}
]
},
"code": 202,
"timestamp": "2026-09-26T10:00:00.000000Z"
}
Next steps
- Authentication: key format, scopes, IP allowlists and rotation.
- Errors: every
error_codeand what to do about it. - Sending SMS: all four send modes.
- API reference: every endpoint with a live "Try it" console.