Send OTP
One-time password delivery — standard and custom template.
The OTP endpoints use a high-priority delivery route. The code is generated automatically by the system.
Standard OTP
/otp/send generates and sends a 4–6 digit code using the standard template.
POSThttps://api.turkeysms.com.tr/otp/send
| Parameter | Type | Status | Description |
|---|---|---|---|
| api_key | string | Required | Your V4 API key. |
| mobile | string | Required | Recipient, international format (905xxxxxxxxx). |
| lang | int | Optional | 0 EN · 1 TR · 2 AR/Unicode. |
| digits | int | Optional | Code length, 4–6 (default 6). |
cURL
curl -X POST https://api.turkeysms.com.tr/otp/send \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"mobile": "905xxxxxxxxx",
"lang": 1,
"digits": 6
}'Custom OTP
/otp/detailed uses a fully custom template. The text field must contain the TS-CODE placeholder; the system replaces it with the generated code.
POSThttps://api.turkeysms.com.tr/otp/detailed
cURL
curl -X POST https://api.turkeysms.com.tr/otp/detailed \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"mobile": "905xxxxxxxxx",
"title": "MyApp",
"text": "MyApp code: TS-CODE (valid 5 minutes)",
"lang": 0,
"digits": 6
}'The request is rejected if the
text field does not contain the TS-CODE placeholder.