Skip to main content
POST
/
sms
Send SMS
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"
  }
}'
{
"message": "SMS task created successfully",
"smsId": "sms-1234567890abcdef123456",
"remainingCredit": 14800,
"cost": 200,
"canCover": true,
"paymentType": "prepaid"
}

Authorizations

Authorization
string
header
required

API key authentication. Format: Bearer sk_live_your_api_key_here

Body

application/json

SMS request parameters. First select smsType; inputs show/hide accordingly.

  • Verification Message
  • Custom Message
  • WhatsApp Template Message
phoneNumber
string
required

Phone number in international format without + (e.g., 964750123456)

Examples:

"964750123456"

smsType
string
required

Must be set to "verification" for sending verification codes. This value determines the message type and required fields.

verificationCode
string
required

Verification code to send

Required string length: 1 - 20
Examples:

"123456"

senderId
string

Optional sender ID to use for the message

Maximum length: 11
Examples:

"OTPIQ"

whatsappAccountId
string

Optional WhatsApp Business Account ID for using custom WhatsApp sender

Examples:

"68c46fecc509cdcec8fb3ef2"

whatsappPhoneId
string

Optional WhatsApp Phone Number ID for using custom WhatsApp sender

Examples:

"68da31fb518ac3db3eb0a0f4"

templateName
string

Optional WhatsApp template name for using custom WhatsApp sender

Examples:

"verification_template"

provider
enum<string>
default:auto

Provider/channel to use

Available options:
auto,
whatsapp-sms,
telegram-sms,
whatsapp-telegram-sms,
sms,
whatsapp,
telegram
Examples:

"whatsapp-sms"

deliveryReport
object

Optional webhook delivery report configuration

Response

SMS sent successfully. Response body includes: message (string), smsId (string), remainingCredit (number), cost (number), canCover (boolean), paymentType ('prepaid' | 'postpaid').

message
string
required

Success message

Examples:

"SMS task created successfully"

smsId
string
required

Unique identifier for the SMS message

Examples:

"sms-1234567890abcdef123456"

remainingCredit
number
required

Remaining credit balance after the transaction

Required range: x >= 0
Examples:

14800

cost
number
required

Cost of the SMS in IQD

Required range: x >= 0
Examples:

200

canCover
boolean
required

Whether the user has sufficient credit to cover the cost

Examples:

true

paymentType
enum<string>
required

Payment type of the user account

Available options:
prepaid,
postpaid
Examples:

"prepaid"

I