Getting Started
Send SMS messages to Mauritania with a single API call.
Moorsyl is an SMS API for Mauritania. Authenticate with an API key, call one endpoint, and your message gets delivered.
Setup
- Sign up at app.moorsyl.com using your email (you'll receive a 6-digit OTP code)
- Create an organization
- Generate an API key from the dashboard
- Start sending SMS
Authentication
All endpoints require an API key linked to an organization. Pass it in the x-api-key header:
curl -X POST https://api.moorsyl.com/rpc/enqueueSms \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{ "to": "+22221234567", "from": "MyApp", "body": "Hello!" }'Or as a Bearer token in the Authorization header:
curl -X POST https://api.moorsyl.com/rpc/enqueueSms \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{ "to": "+22221234567", "from": "MyApp", "body": "Hello!" }'Both methods are equivalent.
Send SMS
Endpoint
POST /rpc/enqueueSmsRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
to | string | yes | Recipient phone number in +222XXXXXXXXX format |
from | string | yes | Sender ID, 1–11 characters |
body | string | yes | Message text, 1–1600 characters |
idempotencyKey | string | no | 8–128 character key to prevent duplicates |
Quick Start
curl -X POST https://api.moorsyl.com/rpc/enqueueSms \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"to": "+22221234567",
"from": "MyApp",
"body": "Hello from Moorsyl!"
}'{
"accepted": true,
"idempotencyKey": "generated-uuid",
"organizationId": "org_123"
}A response of accepted: true means the message has been queued for delivery.
Phone Number Format
Only Mauritanian numbers are accepted. The format is +222 followed by a digit 2, 3, or 4, then 7 more digits:
+222[2-4]XXXXXXXValid: +22221234567, +22231234567, +22241234567
Invalid: +22251234567, +2221234567, 22221234567
Idempotency
If you provide an idempotencyKey, the same key will not create a duplicate message. If omitted, one is generated for you and returned in the response.
curl -X POST https://api.moorsyl.com/rpc/enqueueSms \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"to": "+22221234567",
"from": "MyApp",
"body": "Your code is 123456",
"idempotencyKey": "signup-otp-user42-attempt1"
}'Errors
| Status | Reason |
|---|---|
| 401 | Missing or invalid API key |
| 403 | API key is not linked to an organization |
| 400 | Invalid input (bad phone number, empty body, etc.) |
Organizations
API keys are scoped to an organization. Each organization has its own message history and billing. A user can belong to multiple organizations.
Rate Limiting
API keys have built-in rate limiting. The defaults are 10 requests per 24 hours per key. Contact us if you need higher limits.