{"id":18188,"date":"2026-11-18T23:50:32","date_gmt":"2026-11-18T18:20:32","guid":{"rendered":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/"},"modified":"2026-11-18T23:50:32","modified_gmt":"2026-11-18T18:20:32","slug":"smart-otp-verify-otp-api","status":"publish","type":"post","link":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/","title":{"rendered":"Fast2SMS Verify OTP API: how OTP verification works (with code)"},"content":{"rendered":"<p>The Fast2SMS Verify OTP API checks if the code your user typed matches the OTP you sent with Smart OTP. You send the mobile number and the code. Fast2SMS answers &#8220;OTP verified successfully&#8221; or tells you why it failed: wrong code, expired, too many tries, or no OTP waiting. This page explains how verification works, with code in cURL, PHP, Python, Node.js, Java, C# and Go, and a fix for every error.<\/p>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Verify OTPs without storing them<\/strong><p>Smart OTP keeps the code, checks expiry and counts wrong tries for you.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>How Verify OTP works<\/h2>\n<ul>\n<li><strong>No OTP ID needed.<\/strong> You send only <code>mobile<\/code> and <code>otp<\/code>.<\/li>\n<li><strong>Only the newest OTP counts.<\/strong> Fast2SMS checks the latest unverified OTP sent to that number from your account, whatever OTP ID it was sent with. Every new Send OTP to that number cancels the older codes.<\/li>\n<li><strong>One success only.<\/strong> Once a code is verified it cannot be verified again. A second call gets &#8220;OTP not found or already verified&#8221;.<\/li>\n<li><strong>Expiry is checked first.<\/strong> If the OTP is older than the <code>otp_expiry<\/code> you set on send (15 minutes by default), the answer is &#8220;OTP expired&#8221; and the code is cancelled.<\/li>\n<li><strong>Wrong tries are counted.<\/strong> The limit is <strong>Max Verify OTP Limit (Per SMS)<\/strong> in <strong>OTP Settings<\/strong>, 10 if you never saved that page. When the limit is reached, the OTP is cancelled and the user needs a new one.<\/li>\n<\/ul>\n<div class=\"f2s-note\">The check uses the exact text. Send <code>otp<\/code> as a string in quotes, for example <code>\"otp\":\"048213\"<\/code>. A number without quotes is refused by the API, and it would also lose a leading zero.<\/div>\n<h2>Endpoint and parameters<\/h2>\n<div class=\"f2s-facts\">\n<table>\n<tbody>\n<tr>\n<td>URL<\/td>\n<td><code>https:\/\/www.fast2sms.com\/dev\/otp\/verify<\/code><\/td>\n<\/tr>\n<tr>\n<td>Method<\/td>\n<td>POST with a JSON body (GET also works)<\/td>\n<\/tr>\n<tr>\n<td>Header<\/td>\n<td><code>authorization: YOUR_API_KEY<\/code>, without &#8220;Bearer&#8221;<\/td>\n<\/tr>\n<tr>\n<td><code>mobile<\/code><\/td>\n<td>Required. The same 10-digit number you sent the OTP to. <code>+91<\/code> or <code>91<\/code> in front is removed.<\/td>\n<\/tr>\n<tr>\n<td><code>otp<\/code><\/td>\n<td>Required. The code the user typed, as text, up to 10 characters.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>Code examples<\/h2>\n<p>Each example returns whether the code is right, plus the message from Fast2SMS. Log the user in only when the HTTP status is 200 and <code>return<\/code> is <code>true<\/code>.<\/p>\n<h3>cURL<\/h3>\n<pre><code class=\"language-bash\">curl -X POST \"https:\/\/www.fast2sms.com\/dev\/otp\/verify\" \\\n  -H \"authorization: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\"mobile\":\"9999999999\",\"otp\":\"482913\"}'<\/code><\/pre>\n<h3>PHP<\/h3>\n<pre><code class=\"language-php\">&lt;?php\nfunction verifyOtp(string $mobile, string $otp): array\n{\n    $ch = curl_init('https:\/\/www.fast2sms.com\/dev\/otp\/verify');\n    curl_setopt_array($ch, [\n        CURLOPT_POST           =&gt; true,\n        CURLOPT_RETURNTRANSFER =&gt; true,\n        CURLOPT_TIMEOUT        =&gt; 15,\n        CURLOPT_HTTPHEADER     =&gt; [\n            'authorization: YOUR_API_KEY',\n            'Content-Type: application\/json',\n        ],\n        CURLOPT_POSTFIELDS     =&gt; json_encode(['mobile' =&gt; $mobile, 'otp' =&gt; $otp]),\n    ]);\n    $body = curl_exec($ch);\n    $http = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n    curl_close($ch);\n\n    $res = json_decode((string) $body, true) ?: [];\n    return [\n        'ok'      =&gt; $http === 200 &amp;&amp; ($res['return'] ?? false) === true,\n        'message' =&gt; $res['message'] ?? 'No response',\n    ];\n}\n\n$result = verifyOtp('9999999999', (string) ($_POST['otp'] ?? ''));\nif ($result['ok']) {\n    \/\/ Mark the number as verified and log the user in\n} else {\n    echo htmlspecialchars($result['message']);\n}<\/code><\/pre>\n<h3>Python<\/h3>\n<pre><code class=\"language-python\">import requests\n\nAPI_KEY = \"YOUR_API_KEY\"\n\ndef verify_otp(mobile, otp):\n    r = requests.post(\n        \"https:\/\/www.fast2sms.com\/dev\/otp\/verify\",\n        headers={\"authorization\": API_KEY},\n        json={\"mobile\": mobile, \"otp\": str(otp)},\n        timeout=15,\n    )\n    data = r.json()\n    ok = r.status_code == 200 and data.get(\"return\") is True\n    return ok, data.get(\"message\")\n\nok, message = verify_otp(\"9999999999\", \"482913\")\nprint(ok, message)<\/code><\/pre>\n<h3>Node.js<\/h3>\n<pre><code class=\"language-javascript\">const API_KEY = \"YOUR_API_KEY\";\n\nasync function verifyOtp(mobile, otp) {\n  const res = await fetch(\"https:\/\/www.fast2sms.com\/dev\/otp\/verify\", {\n    method: \"POST\",\n    headers: { authorization: API_KEY, \"Content-Type\": \"application\/json\" },\n    body: JSON.stringify({ mobile, otp: String(otp) }),\n  });\n  const data = await res.json();\n  return { ok: res.status === 200 &amp;&amp; data.return === true, message: data.message };\n}\n\nverifyOtp(\"9999999999\", \"482913\").then(console.log);<\/code><\/pre>\n<h3>Java<\/h3>\n<pre><code class=\"language-java\">import java.net.URI;\nimport java.net.http.HttpClient;\nimport java.net.http.HttpRequest;\nimport java.net.http.HttpResponse;\n\npublic class VerifyOtp {\n    public static void main(String[] args) throws Exception {\n        String json = \"{\\\"mobile\\\":\\\"9999999999\\\",\\\"otp\\\":\\\"482913\\\"}\";\n\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https:\/\/www.fast2sms.com\/dev\/otp\/verify\"))\n                .header(\"authorization\", \"YOUR_API_KEY\")\n                .header(\"Content-Type\", \"application\/json\")\n                .POST(HttpRequest.BodyPublishers.ofString(json))\n                .build();\n\n        HttpResponse&lt;String&gt; response = HttpClient.newHttpClient()\n                .send(request, HttpResponse.BodyHandlers.ofString());\n\n        boolean verified = response.statusCode() == 200;\n        System.out.println(verified + \" \" + response.body());\n    }\n}<\/code><\/pre>\n<h3>C# (.NET)<\/h3>\n<pre><code class=\"language-csharp\">using System;\nusing System.Net.Http;\nusing System.Text;\n\nvar client = new HttpClient();\nvar json = \"{\\\"mobile\\\":\\\"9999999999\\\",\\\"otp\\\":\\\"482913\\\"}\";\n\nvar request = new HttpRequestMessage(HttpMethod.Post, \"https:\/\/www.fast2sms.com\/dev\/otp\/verify\");\nrequest.Headers.TryAddWithoutValidation(\"authorization\", \"YOUR_API_KEY\");\nrequest.Content = new StringContent(json, Encoding.UTF8, \"application\/json\");\n\nvar response = await client.SendAsync(request);\nvar body = await response.Content.ReadAsStringAsync();\nvar verified = (int)response.StatusCode == 200;\nConsole.WriteLine($\"{verified} {body}\");<\/code><\/pre>\n<h3>Go<\/h3>\n<pre><code class=\"language-go\">package main\n\nimport (\n\t\"bytes\"\n\t\"encoding\/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\/http\"\n\t\"time\"\n)\n\nfunc main() {\n\tpayload, _ := json.Marshal(map[string]string{\n\t\t\"mobile\": \"9999999999\",\n\t\t\"otp\":    \"482913\",\n\t})\n\n\treq, _ := http.NewRequest(\"POST\", \"https:\/\/www.fast2sms.com\/dev\/otp\/verify\", bytes.NewReader(payload))\n\treq.Header.Set(\"authorization\", \"YOUR_API_KEY\")\n\treq.Header.Set(\"Content-Type\", \"application\/json\")\n\n\tclient := &amp;http.Client{Timeout: 15 * time.Second}\n\tresp, err := client.Do(req)\n\tif err &#33;= nil {\n\t\tpanic(err)\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, _ := io.ReadAll(resp.Body)\n\tverified := resp.StatusCode == 200\n\tfmt.Println(verified, string(body))\n}<\/code><\/pre>\n<h2>Responses<\/h2>\n<p>A correct code:<\/p>\n<pre><code class=\"language-json\">{\"return\":true,\"status_code\":200,\"message\":\"OTP verified successfully\"}<\/code><\/pre>\n<p>A wrong code:<\/p>\n<pre><code class=\"language-json\">{\"return\":false,\"status_code\":400,\"message\":\"Invalid OTP\"}<\/code><\/pre>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>HTTP<\/th>\n<th>message<\/th>\n<th>What it means<\/th>\n<th>What your app should do<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>200<\/td>\n<td>OTP verified successfully<\/td>\n<td>The code is right. It is now used up.<\/td>\n<td>Log the user in or mark the number as verified.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Invalid OTP<\/td>\n<td>Wrong code. One try is used.<\/td>\n<td>Show &#8220;Wrong code, try again&#8221;.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Maximum verification attempts reached. OTP is no longer valid.<\/td>\n<td>The wrong tries reached your limit. The code is cancelled.<\/td>\n<td>Ask the user to request a new code, then call Send OTP.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>OTP expired<\/td>\n<td>The code is older than <code>otp_expiry<\/code>. It is cancelled.<\/td>\n<td>Offer a new code.<\/td>\n<\/tr>\n<tr>\n<td>404<\/td>\n<td>OTP not found or already verified<\/td>\n<td>No unverified OTP is waiting for this number. It was already verified, never sent, or was cancelled.<\/td>\n<td>Offer a new code. See the next section.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>The otp field is required. (or another field message)<\/td>\n<td>A field is missing or in the wrong format.<\/td>\n<td>Fix the request.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Mobile number format is invalid<\/td>\n<td><code>mobile<\/code> was sent as a list.<\/td>\n<td>Send one number as text.<\/td>\n<\/tr>\n<tr>\n<td>401<\/td>\n<td>Authorization key required \/ Invalid authorization key<\/td>\n<td>Key missing or wrong.<\/td>\n<td>Check the <code>authorization<\/code> header.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The last wrong try inside your limit already returns &#8220;Maximum verification attempts reached&#8221;. For example, with a limit of 5, the fifth wrong code gets that answer.<\/p>\n<h2>Set the number of verify attempts<\/h2>\n<p>Open Smart OTP, then <strong>OTP Settings<\/strong>. Enter a number from 1 to 100 in <strong>Max Verify OTP Limit (Per SMS)<\/strong> and click <strong>Save Settings<\/strong>. The limit counts per OTP, so a new OTP starts with a fresh count. The same page has <strong>SMS Resend \/ Time Limit (Seconds)<\/strong>, the wait before another OTP can be sent to the same number.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-settings-hd-9-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"OTP Settings page with Max Verify OTP Limit set to 5 and SMS Resend Time Limit set to 30 seconds, and a Save Settings button\"><figcaption>Here a user gets 5 tries for each OTP.<\/figcaption><\/figure>\n<p>For login OTPs, a small number such as 3 to 5 is a sensible choice. It gives users room for a typo and makes guessing hard.<\/p>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Add OTP verification to your app<\/strong><p>Send and verify OTPs on SMS and WhatsApp with two simple API calls.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>Why verify says &#8220;OTP not found or already verified&#8221;<\/h2>\n<p>This is the most common verify question. The usual causes:<\/p>\n<ol>\n<li><strong>The user asked for a second OTP.<\/strong> Each Send OTP cancels older codes for that number. If the user types the code from the first SMS, it no longer counts. Use the Resend OTP API for &#8220;Resend code&#8221; buttons. It sends the same code again.<\/li>\n<li><strong>The code was already verified.<\/strong> A double click or a page refresh can call verify twice. The first call succeeds, the second gets 404. Treat the first success as final.<\/li>\n<li><strong>The OTP was cancelled earlier.<\/strong> After &#8220;OTP expired&#8221; or &#8220;Maximum verification attempts reached&#8221;, the code is gone and later calls get 404.<\/li>\n<li><strong>Different account or number.<\/strong> The OTP was sent with a key from another Fast2SMS account, or the number in verify is not the same as in send.<\/li>\n<\/ol>\n<h2>See which users verified<\/h2>\n<p>Verification results do not show on the report pages. To see them, go to <strong>Delivery Reports<\/strong>, then <strong>Export<\/strong>, choose <strong>OTP<\/strong> and a date range, and click <strong>Submit<\/strong>. When the file is ready, click <strong>Download<\/strong>. The file has a <strong>Verified<\/strong> column (Yes, No or Expired) and a <strong>Verified At<\/strong> column. &#8220;Expired&#8221; also covers codes that used up their tries or were replaced by a newer OTP. Export files stay for 48 hours.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/otp-report-export-hd-2-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"Delivery Reports Export page with OTP selected, a date picker, Submit button and a list of OTP, WhatsApp and SMS export files with Download buttons\"><figcaption>Download the OTP export to see the Verified and Verified At columns.<\/figcaption><\/figure>\n<h2>Security tips for your verify step<\/h2>\n<ul>\n<li>Call verify from your server only. Never decide &#8220;verified&#8221; in the browser or app.<\/li>\n<li>Do not send the OTP back to the browser. Fast2SMS keeps it, so your page never needs it.<\/li>\n<li>Limit verify calls per user and per IP in your own app as well.<\/li>\n<li>After &#8220;Maximum verification attempts reached&#8221;, start again with a new Send OTP call, so the user gets a fresh code.<\/li>\n<\/ul>\n<section class=\"f2s-faq\">\n<h2>Frequently asked questions<\/h2>\n<h3>Do I need to pass the OTP ID to verify?<\/h3>\n<p>No. Verify needs only <code>mobile<\/code> and <code>otp<\/code>. It checks the newest unverified OTP for that number.<\/p>\n<h3>Can I verify an OTP that I created myself?<\/h3>\n<p>Yes, if you sent it through Smart OTP with the <code>otp<\/code> field. Fast2SMS stores the value you passed and checks it the same way.<\/p>\n<h3>Can I verify the same OTP twice?<\/h3>\n<p>No. After &#8220;OTP verified successfully&#8221; the code is used up and the next call returns &#8220;OTP not found or already verified&#8221;.<\/p>\n<h3>Is Verify OTP charged?<\/h3>\n<p>Charges apply to messages you send, such as Send and Resend. The verify call does not send a message.<\/p>\n<h3>Does a WhatsApp OTP verify the same way as an SMS OTP?<\/h3>\n<p>Yes. The verify call is the same for both channels and for fallback messages, because they carry the same code.<\/p>\n<h3>How long can a user wait before typing the code?<\/h3>\n<p>Up to the <code>otp_expiry<\/code> you set when sending, from 1 to 10080 minutes. The default is 15 minutes.<\/p>\n<\/section>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Start using Smart OTP<\/strong><p>Create an OTP template, send your first OTP and verify it with one call.<\/p><\/div><div class=\"f2s-cta__actions\"><a class=\"f2s-cta__btn f2s-cta__btn--primary\" href=\"https:\/\/www.fast2sms.com\/\"><span>Sign up free<\/span> <span class=\"f2sh-btn__arrow\" aria-hidden=\"true\">&rarr;<\/span><\/a><a class=\"f2s-cta__btn f2s-cta__btn--ghost\" href=\"https:\/\/www.fast2sms.com\/meet\/\" target=\"_blank\" rel=\"noopener\">Book a free meeting<\/a><\/div><\/aside>\n<h2>Related guides<\/h2>\n<ul>\n<li><a href=\"\/help\/smart-otp-setup-guide-fast2sms\/\">Smart OTP in Fast2SMS: set up OTP on SMS and WhatsApp with fallback<\/a><\/li>\n<li><a href=\"\/help\/fast2sms-webhooks-setup-delivery-reports\/\">Webhooks in Fast2SMS: get delivery reports on your own URL<\/a><\/li>\n<li><a href=\"https:\/\/www.fast2sms.com\/help\/otp-sms-smart-otp\/\">OTP SMS for websites: Smart OTP with WhatsApp fallback explained<\/a><\/li>\n<li><a href=\"https:\/\/www.fast2sms.com\/help\/otp-sms-whatsapp-faq\/\">OTP via SMS and WhatsApp: the complete FAQ<\/a><\/li>\n<li><a href=\"https:\/\/www.fast2sms.com\/otp-sms\">Fast2SMS OTP SMS<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Fast2SMS Verify OTP API checks if the code your user typed matches the OTP you sent with Smart OTP. You send the mobile number and the code. Fast2SMS answers &#8220;OTP verified successfully&#8221; or tells you why it failed: wrong code, expired, too many tries, or no OTP waiting. This page explains how verification works, [&hellip;]<\/p>\n","protected":false},"featured_media":18186,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-18188","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-api","category-otp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Verify OTP API: How OTP Verification Works | Fast2SMS<\/title>\n<meta name=\"description\" content=\"How the Fast2SMS Verify OTP API checks the code a user typed: rules, code in PHP, Python, Node.js, Java, C#, Go and cURL, every response and common fixes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Verify OTP API: How OTP Verification Works | Fast2SMS\" \/>\n<meta property=\"og:description\" content=\"How the Fast2SMS Verify OTP API checks the code a user typed: rules, code in PHP, Python, Node.js, Java, C#, Go and cURL, every response and common fixes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/\" \/>\n<meta property=\"og:site_name\" content=\"Fast2SMS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Fast2SMS\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-18T18:20:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-settings-hd-9-scaled.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@fast2sms\" \/>\n<meta name=\"twitter:site\" content=\"@fast2sms\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/\"},\"author\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"headline\":\"Fast2SMS Verify OTP API: how OTP verification works (with code)\",\"datePublished\":\"2026-11-18T18:20:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/\"},\"wordCount\":1219,\"publisher\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-settings-hd-9-scaled.webp\",\"articleSection\":[\"API\",\"OTP\"],\"inLanguage\":\"en-IN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/\",\"name\":\"Verify OTP API: How OTP Verification Works | Fast2SMS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-settings-hd-9-scaled.webp\",\"datePublished\":\"2026-11-18T18:20:32+00:00\",\"description\":\"How the Fast2SMS Verify OTP API checks the code a user typed: rules, code in PHP, Python, Node.js, Java, C#, Go and cURL, every response and common fixes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/#breadcrumb\"},\"inLanguage\":\"en-IN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-IN\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-settings-hd-9-scaled.webp\",\"contentUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-settings-hd-9-scaled.webp\",\"width\":2560,\"height\":1600,\"caption\":\"OTP Settings page with Max Verify OTP Limit set to 5 and SMS Resend Time Limit set to 30 seconds, and a Save Settings button\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-verify-otp-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API\",\"item\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/api\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Fast2SMS Verify OTP API: how OTP verification works (with code)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/#website\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/\",\"name\":\"Fast2SMS\",\"description\":\"Help\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"inLanguage\":\"en-IN\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\",\"name\":\"Fast2SMS\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#logo\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/Fast2SMS.png\",\"contentUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/Fast2SMS.png\",\"caption\":\"Fast2SMS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#logo\"},\"email\":\"support@fast2sms.com\",\"telephone\":\"+91-6262778822\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Fast2SMS\",\"https:\\\/\\\/www.instagram.com\\\/fast2sms\",\"https:\\\/\\\/x.com\\\/fast2sms\",\"https:\\\/\\\/www.youtube.com\\\/Fast2SMSofficial\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/fast2sms\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Verify OTP API: How OTP Verification Works | Fast2SMS","description":"How the Fast2SMS Verify OTP API checks the code a user typed: rules, code in PHP, Python, Node.js, Java, C#, Go and cURL, every response and common fixes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/","og_locale":"en_US","og_type":"article","og_title":"Verify OTP API: How OTP Verification Works | Fast2SMS","og_description":"How the Fast2SMS Verify OTP API checks the code a user typed: rules, code in PHP, Python, Node.js, Java, C#, Go and cURL, every response and common fixes.","og_url":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/","og_site_name":"Fast2SMS","article_publisher":"https:\/\/www.facebook.com\/Fast2SMS\/","article_published_time":"2026-11-18T18:20:32+00:00","og_image":[{"width":2560,"height":1600,"url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-settings-hd-9-scaled.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_creator":"@fast2sms","twitter_site":"@fast2sms","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/#article","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/"},"author":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"headline":"Fast2SMS Verify OTP API: how OTP verification works (with code)","datePublished":"2026-11-18T18:20:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/"},"wordCount":1219,"publisher":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-settings-hd-9-scaled.webp","articleSection":["API","OTP"],"inLanguage":"en-IN"},{"@type":"WebPage","@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/","url":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/","name":"Verify OTP API: How OTP Verification Works | Fast2SMS","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/#primaryimage"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-settings-hd-9-scaled.webp","datePublished":"2026-11-18T18:20:32+00:00","description":"How the Fast2SMS Verify OTP API checks the code a user typed: rules, code in PHP, Python, Node.js, Java, C#, Go and cURL, every response and common fixes.","breadcrumb":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/#breadcrumb"},"inLanguage":"en-IN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-IN","@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/#primaryimage","url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-settings-hd-9-scaled.webp","contentUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-settings-hd-9-scaled.webp","width":2560,"height":1600,"caption":"OTP Settings page with Max Verify OTP Limit set to 5 and SMS Resend Time Limit set to 30 seconds, and a Save Settings button"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-verify-otp-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fast2sms.com\/help\/"},{"@type":"ListItem","position":2,"name":"API","item":"https:\/\/www.fast2sms.com\/help\/api\/"},{"@type":"ListItem","position":3,"name":"Fast2SMS Verify OTP API: how OTP verification works (with code)"}]},{"@type":"WebSite","@id":"https:\/\/www.fast2sms.com\/help\/#website","url":"https:\/\/www.fast2sms.com\/help\/","name":"Fast2SMS","description":"Help","publisher":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"inLanguage":"en-IN"},{"@type":"Organization","@id":"https:\/\/www.fast2sms.com\/#organization","name":"Fast2SMS","url":"https:\/\/www.fast2sms.com\/","logo":{"@type":"ImageObject","@id":"https:\/\/www.fast2sms.com\/#logo","url":"https:\/\/www.fast2sms.com\/Fast2SMS.png","contentUrl":"https:\/\/www.fast2sms.com\/Fast2SMS.png","caption":"Fast2SMS"},"image":{"@id":"https:\/\/www.fast2sms.com\/#logo"},"email":"support@fast2sms.com","telephone":"+91-6262778822","sameAs":["https:\/\/www.facebook.com\/Fast2SMS","https:\/\/www.instagram.com\/fast2sms","https:\/\/x.com\/fast2sms","https:\/\/www.youtube.com\/Fast2SMSofficial","https:\/\/www.linkedin.com\/company\/fast2sms"]}]}},"_links":{"self":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/18188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/comments?post=18188"}],"version-history":[{"count":0,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/18188\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media\/18186"}],"wp:attachment":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media?parent=18188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/categories?post=18188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/tags?post=18188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}