REST API Specification &
Endpoints Reference.
Complete HTTP endpoint documentation, dual authentication headers, JSON request/response schemas, error codes, and OpenAPI 3.0 specification for NepalOTP.
"phone": "+9779841234567",
"reference": "user_signup_abc123"
}
"success": true,
"message": "OTP sent successfully",
"otp_id": "otp_8f9a7b6c5d4e3f2a",
"data": {
"expires_at": "2026-01-15T10:35:00+05:45",
"expires_in_seconds": 300
}
}
HTTP Endpoints & Routes
Base URL: https://nepalotp.com/api/v1
Authentication: X-API-Key: npot_live_... or Authorization: Bearer npot_live_...
Send OTP Code
Generates a 6-digit OTP and delivers it via SMS to Nepali phone numbers. In Sandbox mode (`npot_test_`), OTP is fixed to `123456` with zero balance deduction.
Verify OTP Passcode
Verifies the code entered by the user against an `otp_id`. The OTP is automatically invalidated upon successful verification or when max attempts (3) are exceeded.
Transactional SMS
Dispatches operational notifications (order confirmations, payment receipts, appointment reminders) using pre-approved templates with dynamic `{{variable}}` substitution.
Webhooks & Signatures
Receives real-time delivery and verification updates (`otp.sent`, `otp.verified`, `sms.sent`, `sms.failed`). Signed with HMAC-SHA256 in `X-Npot-Signature`.
Always-Free Sandbox
Test integration with zero balance cost. Test keys (`npot_test_`) log requests without sending real SMS, always returning `123456` code for predictable testing.
Rate Limits & Quotas
Platform throttle allows 120 req/min per key and 300 req/min per IP. Per-destination limits defaults: 1 OTP/min, 5 OTPs/hr, 20 OTPs/24hr (all configurable per app).
Bulk / Promotional SMS
Sends one free-text message to up to 500 recipients at once. Content is screened by AI moderation before anything is charged — fair promotional copy sends instantly, anything ambiguous is queued for manual review.
Bulk SMS Batch Status
Looks up a batch's status and carrier delivery breakdown — mainly for batches queued for manual review, since a `202` response has no other synchronous way to learn the outcome.
HTTP Status Codes & Error Reference
Standard HTTP status codes and structured top-level JSON error payload definitions returned by the NepalOTP API.
| HTTP Code | Error Code (`code`) |
|---|---|
| 200 OK | SUCCESS |
| 400 Bad Request | INVALID_OTP |
| 400 Bad Request | OTP_EXPIRED |
| 400 Bad Request | MAX_ATTEMPTS_EXCEEDED |
| 400 Bad Request | MISSING_VARIABLES |
| 400 Bad Request | CONTENT_REJECTED |
| 202 Accepted | SUCCESS (pending_review) |
| 401 Unauthorized | INVALID_API_KEY |
| 402 Payment Required | INSUFFICIENT_BALANCE |
| 403 Forbidden | API_KEY_ENVIRONMENT_MISMATCH |
| 404 Not Found | OTP_NOT_FOUND / TEMPLATE_NOT_FOUND |
| 422 Validation Error | VALIDATION_ERROR |
| 422 Validation Error | TOO_MANY_RECIPIENTS |
| 429 Too Many Requests | RATE_LIMIT_EXCEEDED |
| 500 Internal Error | INTERNAL_ERROR |
Start building with NepalOTP.
Create your account, generate your API keys, and test endpoints in sandbox mode for free.