curl --request POST \
--url https://api.otpiq.com/api/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "964750123456",
"smsType": "<string>",
"verificationCode": "123456",
"senderId": "OTPIQ",
"whatsappAccountId": "68c46fecc509cdcec8fb3ef2",
"whatsappPhoneId": "68da31fb518ac3db3eb0a0f4",
"templateName": "verification_template",
"provider": "whatsapp-sms",
"deliveryReport": {
"webhookUrl": "https://your-app.com/webhooks/sms-status",
"deliveryReportType": "all",
"webhookSecret": "your_webhook_secret_123"
}
}
'import requests
url = "https://api.otpiq.com/api/sms"
payload = {
"phoneNumber": "964750123456",
"smsType": "<string>",
"verificationCode": "123456",
"senderId": "OTPIQ",
"whatsappAccountId": "68c46fecc509cdcec8fb3ef2",
"whatsappPhoneId": "68da31fb518ac3db3eb0a0f4",
"templateName": "verification_template",
"provider": "whatsapp-sms",
"deliveryReport": {
"webhookUrl": "https://your-app.com/webhooks/sms-status",
"deliveryReportType": "all",
"webhookSecret": "your_webhook_secret_123"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '964750123456',
smsType: '<string>',
verificationCode: '123456',
senderId: 'OTPIQ',
whatsappAccountId: '68c46fecc509cdcec8fb3ef2',
whatsappPhoneId: '68da31fb518ac3db3eb0a0f4',
templateName: 'verification_template',
provider: 'whatsapp-sms',
deliveryReport: {
webhookUrl: 'https://your-app.com/webhooks/sms-status',
deliveryReportType: 'all',
webhookSecret: 'your_webhook_secret_123'
}
})
};
fetch('https://api.otpiq.com/api/sms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.otpiq.com/api/sms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '964750123456',
'smsType' => '<string>',
'verificationCode' => '123456',
'senderId' => 'OTPIQ',
'whatsappAccountId' => '68c46fecc509cdcec8fb3ef2',
'whatsappPhoneId' => '68da31fb518ac3db3eb0a0f4',
'templateName' => 'verification_template',
'provider' => 'whatsapp-sms',
'deliveryReport' => [
'webhookUrl' => 'https://your-app.com/webhooks/sms-status',
'deliveryReportType' => 'all',
'webhookSecret' => 'your_webhook_secret_123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.otpiq.com/api/sms"
payload := strings.NewReader("{\n \"phoneNumber\": \"964750123456\",\n \"smsType\": \"<string>\",\n \"verificationCode\": \"123456\",\n \"senderId\": \"OTPIQ\",\n \"whatsappAccountId\": \"68c46fecc509cdcec8fb3ef2\",\n \"whatsappPhoneId\": \"68da31fb518ac3db3eb0a0f4\",\n \"templateName\": \"verification_template\",\n \"provider\": \"whatsapp-sms\",\n \"deliveryReport\": {\n \"webhookUrl\": \"https://your-app.com/webhooks/sms-status\",\n \"deliveryReportType\": \"all\",\n \"webhookSecret\": \"your_webhook_secret_123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.otpiq.com/api/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"964750123456\",\n \"smsType\": \"<string>\",\n \"verificationCode\": \"123456\",\n \"senderId\": \"OTPIQ\",\n \"whatsappAccountId\": \"68c46fecc509cdcec8fb3ef2\",\n \"whatsappPhoneId\": \"68da31fb518ac3db3eb0a0f4\",\n \"templateName\": \"verification_template\",\n \"provider\": \"whatsapp-sms\",\n \"deliveryReport\": {\n \"webhookUrl\": \"https://your-app.com/webhooks/sms-status\",\n \"deliveryReportType\": \"all\",\n \"webhookSecret\": \"your_webhook_secret_123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otpiq.com/api/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"964750123456\",\n \"smsType\": \"<string>\",\n \"verificationCode\": \"123456\",\n \"senderId\": \"OTPIQ\",\n \"whatsappAccountId\": \"68c46fecc509cdcec8fb3ef2\",\n \"whatsappPhoneId\": \"68da31fb518ac3db3eb0a0f4\",\n \"templateName\": \"verification_template\",\n \"provider\": \"whatsapp-sms\",\n \"deliveryReport\": {\n \"webhookUrl\": \"https://your-app.com/webhooks/sms-status\",\n \"deliveryReportType\": \"all\",\n \"webhookSecret\": \"your_webhook_secret_123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "SMS task created successfully",
"smsId": "sms-1234567890abcdef123456",
"remainingCredit": 14800,
"cost": 200,
"canCover": true,
"paymentType": "prepaid"
}Send SMS
Send an SMS message. Supports both verification codes and custom messages with multiple provider options.
curl --request POST \
--url https://api.otpiq.com/api/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"phoneNumber": "964750123456",
"smsType": "<string>",
"verificationCode": "123456",
"senderId": "OTPIQ",
"whatsappAccountId": "68c46fecc509cdcec8fb3ef2",
"whatsappPhoneId": "68da31fb518ac3db3eb0a0f4",
"templateName": "verification_template",
"provider": "whatsapp-sms",
"deliveryReport": {
"webhookUrl": "https://your-app.com/webhooks/sms-status",
"deliveryReportType": "all",
"webhookSecret": "your_webhook_secret_123"
}
}
'import requests
url = "https://api.otpiq.com/api/sms"
payload = {
"phoneNumber": "964750123456",
"smsType": "<string>",
"verificationCode": "123456",
"senderId": "OTPIQ",
"whatsappAccountId": "68c46fecc509cdcec8fb3ef2",
"whatsappPhoneId": "68da31fb518ac3db3eb0a0f4",
"templateName": "verification_template",
"provider": "whatsapp-sms",
"deliveryReport": {
"webhookUrl": "https://your-app.com/webhooks/sms-status",
"deliveryReportType": "all",
"webhookSecret": "your_webhook_secret_123"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
phoneNumber: '964750123456',
smsType: '<string>',
verificationCode: '123456',
senderId: 'OTPIQ',
whatsappAccountId: '68c46fecc509cdcec8fb3ef2',
whatsappPhoneId: '68da31fb518ac3db3eb0a0f4',
templateName: 'verification_template',
provider: 'whatsapp-sms',
deliveryReport: {
webhookUrl: 'https://your-app.com/webhooks/sms-status',
deliveryReportType: 'all',
webhookSecret: 'your_webhook_secret_123'
}
})
};
fetch('https://api.otpiq.com/api/sms', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.otpiq.com/api/sms",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'phoneNumber' => '964750123456',
'smsType' => '<string>',
'verificationCode' => '123456',
'senderId' => 'OTPIQ',
'whatsappAccountId' => '68c46fecc509cdcec8fb3ef2',
'whatsappPhoneId' => '68da31fb518ac3db3eb0a0f4',
'templateName' => 'verification_template',
'provider' => 'whatsapp-sms',
'deliveryReport' => [
'webhookUrl' => 'https://your-app.com/webhooks/sms-status',
'deliveryReportType' => 'all',
'webhookSecret' => 'your_webhook_secret_123'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.otpiq.com/api/sms"
payload := strings.NewReader("{\n \"phoneNumber\": \"964750123456\",\n \"smsType\": \"<string>\",\n \"verificationCode\": \"123456\",\n \"senderId\": \"OTPIQ\",\n \"whatsappAccountId\": \"68c46fecc509cdcec8fb3ef2\",\n \"whatsappPhoneId\": \"68da31fb518ac3db3eb0a0f4\",\n \"templateName\": \"verification_template\",\n \"provider\": \"whatsapp-sms\",\n \"deliveryReport\": {\n \"webhookUrl\": \"https://your-app.com/webhooks/sms-status\",\n \"deliveryReportType\": \"all\",\n \"webhookSecret\": \"your_webhook_secret_123\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.otpiq.com/api/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"964750123456\",\n \"smsType\": \"<string>\",\n \"verificationCode\": \"123456\",\n \"senderId\": \"OTPIQ\",\n \"whatsappAccountId\": \"68c46fecc509cdcec8fb3ef2\",\n \"whatsappPhoneId\": \"68da31fb518ac3db3eb0a0f4\",\n \"templateName\": \"verification_template\",\n \"provider\": \"whatsapp-sms\",\n \"deliveryReport\": {\n \"webhookUrl\": \"https://your-app.com/webhooks/sms-status\",\n \"deliveryReportType\": \"all\",\n \"webhookSecret\": \"your_webhook_secret_123\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.otpiq.com/api/sms")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"964750123456\",\n \"smsType\": \"<string>\",\n \"verificationCode\": \"123456\",\n \"senderId\": \"OTPIQ\",\n \"whatsappAccountId\": \"68c46fecc509cdcec8fb3ef2\",\n \"whatsappPhoneId\": \"68da31fb518ac3db3eb0a0f4\",\n \"templateName\": \"verification_template\",\n \"provider\": \"whatsapp-sms\",\n \"deliveryReport\": {\n \"webhookUrl\": \"https://your-app.com/webhooks/sms-status\",\n \"deliveryReportType\": \"all\",\n \"webhookSecret\": \"your_webhook_secret_123\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "SMS task created successfully",
"smsId": "sms-1234567890abcdef123456",
"remainingCredit": 14800,
"cost": 200,
"canCover": true,
"paymentType": "prepaid"
}Authorizations
Project API key (sk_live… or sk_dev…). Send it as Authorization: Bearer <api_key>.
Body
SMS request parameters. First select smsType; inputs show/hide accordingly.
- Verification Message
- Custom Message
- WhatsApp Template Message
Phone number in international format without + (e.g., 964750123456)
^[0-9]{10,15}$"964750123456"
Must be set to "verification" for sending verification codes. This value determines the message type and required fields.
Verification code to send
1 - 20"123456"
Optional sender ID to use for the message
11"OTPIQ"
Optional WhatsApp Business Account ID for using custom WhatsApp sender
"68c46fecc509cdcec8fb3ef2"
Optional WhatsApp Phone Number ID for using custom WhatsApp sender
"68da31fb518ac3db3eb0a0f4"
Optional WhatsApp template name for using custom WhatsApp sender
"verification_template"
Provider/channel to use
auto, whatsapp-sms, telegram-sms, whatsapp-telegram-sms, sms, whatsapp, telegram "whatsapp-sms"
Optional webhook delivery report configuration
Show child attributes
Show child attributes
Response
SMS sent successfully. Response body includes: message (string), smsId (string), remainingCredit (number), cost (number), canCover (boolean), paymentType ('prepaid' | 'postpaid').
Success message
"SMS task created successfully"
Unique identifier for the SMS message
^sms-[a-f0-9]{24}$"sms-1234567890abcdef123456"
Remaining credit balance after the transaction
x >= 014800
Cost of the SMS in IQD
x >= 0200
Whether the user has sufficient credit to cover the cost
true
Payment type of the user account
prepaid, postpaid "prepaid"