Skip to main content
Trigger a one-time password (OTP) message for multi-factor verification.
curl --request POST \
  --url https://ses.antryk.com/api/v1/sms/send-otp \
  --header 'Content-Type: application/json' \
  --data '{
    "accessKey": "YOUR_ACCESS_KEY",
    "secretKey": "YOUR_SECRET_KEY",
    "to": "+1XXXXXXXXXX",
    "serviceId": "YOUR_SERVICE_ID"
  }'

Request Parameters

accessKey
string
required
Authentication key for your SMS verification service.
secretKey
string
required
Secret credential paired with the access key.
to
string
required
End-user phone number in E.164 format (e.g. +1XXXXXXXXXX). Invalid formatting returns 400 invalid_recipient.
serviceId
string
required
ID of the verification service. If the ID is missing or invalid the API responds with 401 invalid_request.

Successful Response

{
  "success": true,
  "message": "Otp Sent Successfully!",
  "data": {
    "to": "+1XXXXXXXXXX",
    "serviceId": "YOUR_SERVICE_ID",
    "status": "pending"
  }
}
The OTP expires five minutes after issuance. Subsequent verification attempts with the same code after this window return 410 otp_expired.

Error Scenarios

  • 401 invalid credentials – incorrect accessKey/secretKey
  • 400 invalid_recipientto missing or improperly formatted
  • 409 otp_pending – a previous OTP for this number is still valid
  • 429 rate_limited – verification attempts exceed the allowed limit
  • 401 invalid_request – provided serviceId is invalid or not associated with the account
  • 500 provider_unavailable – temporary outage at the SMS gateway

Invalid Service ID Example

{
  "success": false,
  "errors": [
    {
      "message": "Invalid Request",
      "code": 401
    }
  ]
}
Each OTP remains valid for five minutes (expiresIn: 300). Surface the countdown in your UX and throttle resend requests to avoid otp_pending errors.