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": "<string>",
  "smsType": "<string>",
  "verificationCode": "<string>",
  "senderId": "<string>",
  "whatsappAccountId": "<string>",
  "whatsappPhoneId": "<string>",
  "templateName": "<string>",
  "provider": "auto",
  "deliveryReport": {
    "webhookUrl": "<string>",
    "deliveryReportType": "all",
    "webhookSecret": "<string>"
  }
}
'
{
"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.

phoneNumber
string
required

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

Example:

"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
Example:

"123456"

senderId
string

Optional sender ID to use for the message

Maximum string length: 11
Example:

"OTPIQ"

whatsappAccountId
string

Optional WhatsApp Business Account ID for using custom WhatsApp sender

Example:

"68c46fecc509cdcec8fb3ef2"

whatsappPhoneId
string

Optional WhatsApp Phone Number ID for using custom WhatsApp sender

Example:

"68da31fb518ac3db3eb0a0f4"

templateName
string

Optional WhatsApp template name for using custom WhatsApp sender

Example:

"verification_template"

provider
enum<string>
default:auto

Provider/channel to use

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

"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

Example:

"SMS task created successfully"

smsId
string
required

Unique identifier for the SMS message

Example:

"sms-1234567890abcdef123456"

remainingCredit
number
required

Remaining credit balance after the transaction

Required range: x >= 0
Example:

14800

cost
number
required

Cost of the SMS in IQD

Required range: x >= 0
Example:

200

canCover
boolean
required

Whether the user has sufficient credit to cover the cost

Example:

true

paymentType
enum<string>
required

Payment type of the user account

Available options:
prepaid,
postpaid
Example:

"prepaid"