Resend OTP POST
Sends a new OTP SMS for an existing otpId (e.g. the user did not receive the SMS). A new code replaces the old one, while the otpId and referenceCode stay the same.
Authorization
API Key (Authentication) in the header Authorization: Bearer <API_KEY> — you can only resend OTPs of your own account.
This endpoint does not support Idempotency-Key (it is ignored if sent) — every call sends a new SMS and counts as one resend.
HTTP Request
http
POST https://public-api.smsup-plus.com/OTP/resendotpContent Type
application/json (JSON only)
Parameter Description
| Property | Type | Required | Description |
|---|---|---|---|
otpid | string | Required | otpId from Request OTP |
vp | string | Optional | Accepted for backward compatibility; currently has no effect |
Behaviour
| Item | Value |
|---|---|
| OTP code | A new code every time; the previous code stops working |
referenceCode | Unchanged |
| Lifetime | Not extended — the OTP still expires at the time counted from Request OTP |
| Wrong attempts | Not reset |
| Resends allowed | At most 3 per otpId |
| Wait between resends | Not enforced by the API — we recommend your app enforce one (e.g. enable "Resend" after 30–60 seconds) |
| Credit | Checked like Request OTP (prepaid needs at least 1), and each SMS is charged by message length |
Response Description
HTTP 200 is returned both on success and when the resend is not possible — check whether the body has success or error.
| Property | Type | Description |
|---|---|---|
otcId | string | OTP config ID of this OTP |
otpId | string | The same otpid |
referenceCode | string | The same reference code |
success.code | string | "200" |
success.message | string | SUCCESS |
success.description | string | OTP has been resent successfully |
Request Example
bash
curl -X POST 'https://public-api.smsup-plus.com/OTP/resendotp' \
-H 'Authorization: Bearer <API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"otpid": "7f3c9a1e-2b4d-4c6e-8a0f-1e3d5b7c9a2f"
}'js
const res = await fetch('https://public-api.smsup-plus.com/OTP/resendotp', {
method: 'POST',
headers: { Authorization: 'Bearer <API_KEY>', 'Content-Type': 'application/json' },
body: JSON.stringify({ otpid: '7f3c9a1e-2b4d-4c6e-8a0f-1e3d5b7c9a2f' }),
})
console.log(await res.json())Response Example
json
{
"otcId": "c2a4e6f8-1b3d-4f5a-9c7e-0d2b4f6a8c1e",
"otpId": "7f3c9a1e-2b4d-4c6e-8a0f-1e3d5b7c9a2f",
"referenceCode": "KQZPWD",
"success": {
"code": "200",
"message": "SUCCESS",
"description": "OTP has been resent successfully"
}
}Possible Errors
See Error Codes for the overview.
| HTTP | Response | Cause |
|---|---|---|
| 200 | {"error":{"code":"400","message":"RESEND_FAILED","description":"Failed to resend OTP"}} | OTP expired / otpid not found / already resent 3 times, or a temporary system failure — request a new OTP |
| 400 | {"error":{"code":"400","message":"BAD_REQUEST","description":"Invalid request body"}} | Body is not valid JSON, or otpid is missing |
| 402 | {"error":{"code":"402","message":"INSUFFICIENT_CREDIT","description":"insufficient credit: required 1.00, available 0.00"}} | Prepaid account has less than 1 credit |
| 403 | {"error":{"code":"403","message":"ACCOUNT_INACTIVE","description":"account is inactive"}} | Account is inactive |
| 403 | {"error":{"code":"403","message":"ACCOUNT_HELD","description":"account is on credit hold"}} | Account is on credit hold |
| 403 | {"error":{"code":"403","message":"SERVICE_NOT_ALLOWED","description":"OTP is not enabled for this account"}} | OTP is not enabled for the account |
| 404 | {"error":{"code":"404","message":"OTP_NOT_FOUND","description":"OTP not found for this account"}} | The otpid belongs to another account |
| 429 | {"error":{"statusCode":"429","description":"rate limit exceeded: max 50 requests per second per account","message":"TOO_MANY_REQUESTS"}} | Too many requests — wait as told by Retry-After |
| 500 | {"error":{"code":"500","message":"INTERNAL_SERVER_ERROR","description":"Failed to validate OTP request"}} | Temporary failure while checking the request |
