Quickstart
Send your first SMS in under 5 minutes
Create an account
Sign up at getersaal.com and log in to your dashboard.
Create a project
Navigate to Projects and create a new project. Each project has its own API token. Sender IDs are shared across your company's projects.
Copy your API token
Open the project details page and copy the API token. Store it in an environment variable — never hardcode it.
export ERSAAL_API_TOKEN="your_token_here"Send your first message
curl -X POST https://sms.lamah.com/api/sms/messages \
-H "Authorization: Bearer $ERSAAL_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"message": "Hello from Ersaal!",
"sender": "MySender",
"payment_type": "wallet",
"receiver": "00218912345678"
}'Response:
{
"message_id": "b9e8a1f2-4c60-4b0b-9f51-0c4f2f6c9e7a",
"cost": 1
}Before your first call, add your server's public outbound IP to the project's allowed IP list — requests from anywhere else are rejected with 401. See Authentication.
A 200 means the message was accepted and your balance reserved, not that it has been delivered. Use the message_id to poll delivery status via the Get Message endpoint.
Until your company is verified, messages are redirected to your company's registered phone number no matter what receiver you pass.
Code examples
const response = await fetch('https://sms.lamah.com/api/sms/messages', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.ERSAAL_API_TOKEN}`,
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({
message: 'Hello from Ersaal!',
sender: 'MySender',
payment_type: 'wallet',
receiver: '00218912345678',
}),
});
const data = await response.json();
console.log(data.message_id);import requests
import os
response = requests.post(
'https://sms.lamah.com/api/sms/messages',
headers={
'Authorization': f'Bearer {os.getenv("ERSAAL_API_TOKEN")}',
'Content-Type': 'application/json',
'Accept': 'application/json',
},
json={
'message': 'Hello from Ersaal!',
'sender': 'MySender',
'payment_type': 'wallet',
'receiver': '00218912345678',
}
)
print(response.json())$response = Http::withToken(env('ERSAAL_API_TOKEN'))
->acceptJson()
->post('https://sms.lamah.com/api/sms/messages', [
'message' => 'Hello from Ersaal!',
'sender' => 'MySender',
'payment_type' => 'wallet',
'receiver' => '00218912345678',
]);
echo $response->json('message_id');