LanguageGuide · official SDK soon
Send SMS in Tunisia from Node.js with fetch.
Since Node.js 18, fetch is built in: no dependency is needed to call the Sendimo API from Express, NestJS, Next.js or a serverless function. The official JavaScript SDK is on its way.
What it does
- No dependency on Node.js 18 or newer.
- Works in Express, NestJS, Next.js API routes and serverless functions.
- JSON errors with a stable code so you can react cleanly (rate_limited, insufficient_balance…).
- The key stays on the server: never use it in the browser or a mobile app.
Setup
- 1Use Node.js 18 or newer.
- 2Put your API key in SENDIMO_API_KEY (.env file or your host's secrets).
- 3POST to /v1/messages from your server.
- 4Receive statuses by webhook and verify their signature.
// Node.js 18+ (fetch built in)
const response = await fetch("https://api.sendimo.tn/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SENDIMO_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "order-4821-otp",
},
body: JSON.stringify({
to: "+21620123456",
from: "SENDIMO",
text: "Your code is 482913. It expires in 5 minutes.",
reference: "order-4821",
}),
});
if (!response.ok) {
const { error } = await response.json();
throw new Error(`${error.code}: ${error.message}`);
}
const message = await response.json();
console.log(message.id, message.status); // msg_01HF8Z3K9QX2 queued{
"id": "msg_01HF8Z3K9QX2",
"status": "queued",
"to": "+21620123456",
"from": "SENDIMO",
"text": "Your code is 482913. It expires in 5 minutes.",
"encoding": "GSM-7",
"segments": 1,
"network": "ooredoo",
"cost": { "amount": "0.140", "currency": "TND" },
"reference": "order-4821",
"scheduled_at": null,
"created_at": "2026-10-30T09:15:00Z"
}Next steps
Other integrations
PythonLanguage
Send SMS in Tunisia from Python with the Sendimo API.
View integrationPHPLanguage
Send SMS in Tunisia from PHP, with no dependency.
View integrationLaravelPHP framework
Send SMS in Tunisia from Laravel with the built-in HTTP client.
View integrationJavaLanguage
Send SMS in Tunisia from Java, with no dependency.
View integrationSpring BootJava framework
Send SMS in Tunisia from Spring Boot with RestClient.
View integrationGoLanguage
Send SMS in Tunisia from Go with net/http.
View integration