{"id":18177,"date":"2026-11-18T23:50:20","date_gmt":"2026-11-18T18:20:20","guid":{"rendered":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/"},"modified":"2026-11-19T00:54:06","modified_gmt":"2026-11-18T19:24:06","slug":"smart-otp-send-otp-api","status":"publish","type":"post","link":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/","title":{"rendered":"Fast2SMS Send OTP API: parameters, code examples and response"},"content":{"rendered":"<p>The Fast2SMS Send OTP API sends a one-time password to an Indian mobile number on SMS or WhatsApp with one call. You pass the mobile number and your Smart OTP <strong>OTP ID<\/strong>. Fast2SMS creates the code, sends it and keeps it so you can check it later with the Verify OTP API. This page covers the endpoint, every parameter, ready code in cURL, PHP, Python, Node.js, Java, C# and Go, the response and every error.<\/p>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Send OTP with one API call<\/strong><p>Create a Smart OTP template, copy the OTP ID and start sending OTPs on SMS and WhatsApp.<\/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>Before you start<\/h2>\n<ul>\n<li><strong>API key:<\/strong> from <strong>API Key<\/strong> under UTILITY in the panel. <strong>API Access<\/strong> must be switched on.<\/li>\n<li><strong>OTP ID:<\/strong> from a Smart OTP template in <strong>OTP Template List<\/strong>. The template links your approved DLT template or WhatsApp template to this ID.<\/li>\n<li><strong>Wallet balance:<\/strong> enough for at least one OTP. Every send is charged.<\/li>\n<li><strong>A server:<\/strong> call the API from your backend, never from app or browser code, so your <a href=\"\/help\/api-key-find-reset\/\">API key<\/a> stays private.<\/li>\n<\/ul>\n<h2>Endpoint and authentication<\/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\/send<\/code><\/td>\n<\/tr>\n<tr>\n<td>Method<\/td>\n<td>POST (recommended). GET with query parameters also works.<\/td>\n<\/tr>\n<tr>\n<td>Body<\/td>\n<td>JSON, or normal form fields<\/td>\n<\/tr>\n<tr>\n<td>Header<\/td>\n<td><code>authorization: YOUR_API_KEY<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"f2s-note\">Send the key exactly as it is shown in the panel. The OTP API does not remove a &#8220;Bearer &#8221; prefix, so <code>authorization: Bearer YOUR_API_KEY<\/code> fails with &#8220;Invalid authorization key&#8221;.<\/div>\n<h2>Parameters<\/h2>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Required<\/th>\n<th>Rules<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>mobile<\/code><\/td>\n<td>Yes<\/td>\n<td>One 10-digit Indian mobile number, as a string. Spaces, <code>+91<\/code> and <code>91<\/code> in front are cleaned for you. Only one number per call.<\/td>\n<\/tr>\n<tr>\n<td><code>otp_id<\/code><\/td>\n<td>Yes<\/td>\n<td>The 10-character OTP ID from your Smart OTP template. It must belong to the same account as the API key.<\/td>\n<\/tr>\n<tr>\n<td><code>otp_expiry<\/code><\/td>\n<td>No<\/td>\n<td>How long the OTP stays valid, in minutes. 1 to 10080. Default 15.<\/td>\n<\/tr>\n<tr>\n<td><code>otp_length<\/code><\/td>\n<td>No<\/td>\n<td>Number of digits Fast2SMS makes. 4 to 10. Default 6. Above 10 gives an error, below 4 is changed to 6.<\/td>\n<\/tr>\n<tr>\n<td><code>otp<\/code><\/td>\n<td>No<\/td>\n<td>Your own OTP value, up to 10 characters. Leave it out and Fast2SMS makes a numeric OTP.<\/td>\n<\/tr>\n<tr>\n<td><code>variables_values<\/code><\/td>\n<td>No<\/td>\n<td>Values for the template&#8217;s other variables, in order, separated by <code>|<\/code>. Do not include the OTP. Writing <code>{otp}<\/code> inside a value puts the OTP there too.<\/td>\n<\/tr>\n<tr>\n<td><code>udf1<\/code>, <code>udf2<\/code>, <code>udf3<\/code><\/td>\n<td>No<\/td>\n<td>Your own reference text, for example a user ID. It comes back in the OTP webhook.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3>How variables_values works<\/h3>\n<p>Say your DLT template is &#8220;Dear {#var#}, use OTP {#var#} to verify your mobile number with Demo Traders. Valid for {#var#} minutes.&#8221; and the OTP is set on Variable 2 in your Smart OTP template. Send <code>\"variables_values\":\"Rahul|5\"<\/code>. Fast2SMS puts &#8220;Rahul&#8221; in the first variable, the OTP in the second and &#8220;5&#8221; in the third. If your template has only the OTP variable, leave <code>variables_values<\/code> out.<\/p>\n<h2>Send your first OTP<\/h2>\n<ol class=\"f2s-steps\">\n<li>\n<h3>Copy your OTP ID<\/h3>\n<p>Open Smart OTP, then <strong>OTP Template List<\/strong>. Click the copy icon next to <strong>OTP ID<\/strong> on the template you want to use.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-template-list-hd-11-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"OTP Template List with WhatsApp and SMS template cards, each with an OTP ID and copy icon\"><figcaption>Each card has its own OTP ID.<\/figcaption><\/figure>\n<\/li>\n<li>\n<h3>Copy your API key<\/h3>\n<p>Go to <strong>API Key<\/strong>. Click <strong>View<\/strong>, enter the OTP sent to your account mobile, and copy the key. Store it in your server&#8217;s environment settings, not in your code repository.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/api-key-hd-15-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"API Key page with masked Authorization Key, View and Reset buttons and API Access switched on\"><figcaption>Keep API Access on, or every call is refused.<\/figcaption><\/figure>\n<\/li>\n<li>\n<h3>Call the API from your server<\/h3>\n<p>Use one of the code samples below. Replace <code>YOUR_API_KEY<\/code> and <code>YOUR_OTP_ID<\/code>, and use a real number in place of 9999999999.<\/p>\n<\/li>\n<li>\n<h3>Check the call in API Logs<\/h3>\n<p>Every call made with your key shows in <strong>API Logs<\/strong> under Account Settings for 7 days. Click a row, then <strong>View Details<\/strong> to see the request you sent and the response you got.<\/p>\n<figure class=\"f2s-shot\"><img src=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/api-logs-detail-modal-success-hd-scaled.webp\" width=\"1440\" height=\"900\" loading=\"lazy\" decoding=\"async\" alt=\"API Request Details for POST \/dev\/otp\/send with status 200 and a response body with return true, request_id and OTP sent successfully\"><figcaption>A successful Send OTP call in API Logs.<\/figcaption><\/figure>\n<\/li>\n<\/ol>\n<h2>Code examples<\/h2>\n<p>Each example sends a 6-digit OTP that is valid for 5 minutes. They all use POST with a JSON body.<\/p>\n<h3>cURL<\/h3>\n<pre><code class=\"language-bash\">curl -X POST \"https:\/\/www.fast2sms.com\/dev\/otp\/send\" \\\n  -H \"authorization: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\/json\" \\\n  -d '{\"mobile\":\"9999999999\",\"otp_id\":\"YOUR_OTP_ID\",\"otp_expiry\":5,\"otp_length\":6}'<\/code><\/pre>\n<h3>PHP<\/h3>\n<pre><code class=\"language-php\">&lt;?php\n$payload = [\n    'mobile'     =&gt; '9999999999',\n    'otp_id'     =&gt; 'YOUR_OTP_ID',\n    'otp_expiry' =&gt; 5,\n    'otp_length' =&gt; 6,\n];\n\n$ch = curl_init('https:\/\/www.fast2sms.com\/dev\/otp\/send');\ncurl_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($payload),\n]);\n$body = curl_exec($ch);\n$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);\ncurl_close($ch);\n\n$res = json_decode($body, true);\nif ($http === 200 &amp;&amp; &#33;empty($res['return'])) {\n    echo 'OTP sent. Request ID: ' . $res['request_id'];\n} else {\n    echo 'Send failed: ' . ($res['message'] ?? 'no response');\n}<\/code><\/pre>\n<h3>Python<\/h3>\n<pre><code class=\"language-python\">import requests\n\nAPI_KEY = \"YOUR_API_KEY\"\n\ndef send_otp(mobile, otp_id):\n    r = requests.post(\n        \"https:\/\/www.fast2sms.com\/dev\/otp\/send\",\n        headers={\"authorization\": API_KEY},\n        json={\"mobile\": mobile, \"otp_id\": otp_id, \"otp_expiry\": 5, \"otp_length\": 6},\n        timeout=15,\n    )\n    data = r.json()\n    if r.status_code == 200 and data.get(\"return\"):\n        return data[\"request_id\"]\n    raise RuntimeError(data.get(\"message\", \"OTP send failed\"))\n\nprint(send_otp(\"9999999999\", \"YOUR_OTP_ID\"))<\/code><\/pre>\n<h3>Node.js<\/h3>\n<p>Node.js 18 and later have <code>fetch<\/code> built in.<\/p>\n<pre><code class=\"language-javascript\">const API_KEY = \"YOUR_API_KEY\";\n\nasync function sendOtp(mobile, otpId) {\n  const res = await fetch(\"https:\/\/www.fast2sms.com\/dev\/otp\/send\", {\n    method: \"POST\",\n    headers: { authorization: API_KEY, \"Content-Type\": \"application\/json\" },\n    body: JSON.stringify({ mobile, otp_id: otpId, otp_expiry: 5, otp_length: 6 }),\n  });\n  const data = await res.json();\n  if (res.ok &amp;&amp; data.return) return data.request_id;\n  throw new Error(data.message || \"OTP send failed\");\n}\n\nsendOtp(\"9999999999\", \"YOUR_OTP_ID\").then(console.log).catch(console.error);<\/code><\/pre>\n<h3>Java<\/h3>\n<p>Uses the HttpClient that comes with Java 11 and later.<\/p>\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 SendOtp {\n    public static void main(String[] args) throws Exception {\n        String json = \"{\\\"mobile\\\":\\\"9999999999\\\",\\\"otp_id\\\":\\\"YOUR_OTP_ID\\\",\"\n                    + \"\\\"otp_expiry\\\":5,\\\"otp_length\\\":6}\";\n\n        HttpRequest request = HttpRequest.newBuilder()\n                .uri(URI.create(\"https:\/\/www.fast2sms.com\/dev\/otp\/send\"))\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        System.out.println(response.statusCode() + \" \" + 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_id\\\":\\\"YOUR_OTP_ID\\\",\\\"otp_expiry\\\":5,\\\"otp_length\\\":6}\";\n\nvar request = new HttpRequestMessage(HttpMethod.Post, \"https:\/\/www.fast2sms.com\/dev\/otp\/send\");\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();\nConsole.WriteLine($\"{(int)response.StatusCode} {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]any{\n\t\t\"mobile\":     \"9999999999\",\n\t\t\"otp_id\":     \"YOUR_OTP_ID\",\n\t\t\"otp_expiry\": 5,\n\t\t\"otp_length\": 6,\n\t})\n\n\treq, _ := http.NewRequest(\"POST\", \"https:\/\/www.fast2sms.com\/dev\/otp\/send\", 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\tfmt.Println(resp.StatusCode, string(body))\n}<\/code><\/pre>\n<aside class=\"f2s-cta\" aria-label=\"Get started with Fast2SMS\"><div class=\"f2s-cta__copy\"><strong class=\"f2s-cta__title\">Get your OTP ID<\/strong><p>Link your DLT or WhatsApp template to Smart OTP and use the code above in minutes.<\/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>Success response<\/h2>\n<pre><code class=\"language-json\">{\n  \"return\": true,\n  \"status_code\": 200,\n  \"request_id\": \"Oa1B2c3D4e5F6g7\",\n  \"message\": \"OTP sent successfully\"\n}<\/code><\/pre>\n<p>&#8220;OTP sent successfully&#8221; means Fast2SMS accepted and queued the OTP. It does not mean the phone received it yet. Save the <code>request_id<\/code>. It starts with &#8220;O&#8221; and you can search it in the <strong>OTP Report<\/strong> or match it in your OTP webhook to see if it was delivered.<\/p>\n<h2>Error responses<\/h2>\n<p>Errors come back with <code>\"return\": false<\/code> and a <code>message<\/code>. Show your user a simple message and log the real one.<\/p>\n<div class=\"f2s-facts\">\n<table>\n<thead>\n<tr>\n<th>HTTP<\/th>\n<th>message<\/th>\n<th>What it means and the fix<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>401<\/td>\n<td>Authorization key required<\/td>\n<td>No key was sent. Add the <code>authorization<\/code> header.<\/td>\n<\/tr>\n<tr>\n<td>401<\/td>\n<td>Invalid authorization key<\/td>\n<td>The key is wrong, was reset, or has &#8220;Bearer&#8221; or spaces in front. Copy it again.<\/td>\n<\/tr>\n<tr>\n<td>401<\/td>\n<td>Invalid Authentication, Authorization Key Disabled<\/td>\n<td>API Access is off. Turn it on in <strong>API Key<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>401<\/td>\n<td>IP is blacklisted from Dev API section<\/td>\n<td><a href=\"\/help\/api-security-ip-whitelist\/\">API Security<\/a> is on and your server IP is not whitelisted. Add it in <strong>API Security<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>The mobile must be 10 digits. (or another field error)<\/td>\n<td>Fix the field named in the message.<\/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. Send one number as text.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Invalid OTP ID<\/td>\n<td>The OTP ID is not in this account or was deleted. Copy it from <strong>OTP Template List<\/strong>.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Template is not approved<\/td>\n<td>The Smart OTP template is no longer active. Create it again.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Please wait N seconds before requesting a new OTP<\/td>\n<td>The resend wait from <strong>OTP Settings<\/strong> is still running for this number and OTP ID. Wait, or lower the wait.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>DLT content not found for this template \/ Sender ID not found for this template<\/td>\n<td>The linked DLT template or sender was removed. Re-add it in <a href=\"\/help\/dlt-manager-entity-sender-template-guide\/\">DLT Manager<\/a> and create a new OTP template.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Entity blocked \/ Content template blocked \/ Sender ID blocked<\/td>\n<td>Your DLT entity, template or sender is blocked. Contact support.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>WhatsApp template not found for this OTP template<\/td>\n<td>The WhatsApp template was deleted. Create the OTP template again.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>WhatsApp Business Number is not active or connected<\/td>\n<td>Reconnect the number in WhatsApp Manager.<\/td>\n<\/tr>\n<tr>\n<td>400<\/td>\n<td>Insufficient wallet balance. You need at least \u20b9&#8230;<\/td>\n<td>Add money to your wallet.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2>What happens after you call Send OTP<\/h2>\n<ul>\n<li><strong>Older OTPs stop working.<\/strong> A new send to a number cancels every earlier unverified OTP for that number, even one sent with a different OTP ID.<\/li>\n<li><strong>The wallet is charged when the message goes out.<\/strong> SMS OTPs cost your plan&#8217;s SMS rate times the SMS parts. WhatsApp OTPs cost the WhatsApp rate for the template&#8217;s category. Each send is its own line in <strong>Transaction History<\/strong>, starting with &#8220;Smart OTP (SMS&#8221; or &#8220;Smart OTP (WhatsApp&#8221;.<\/li>\n<li><strong>Fallback runs if set.<\/strong> If the template has a fallback and the first message is reported failed within 120 seconds, the same OTP goes once on the other channel. The fallback is charged too.<\/li>\n<li><strong>Verify uses the mobile only.<\/strong> When the user types the code, call <code>\/dev\/otp\/verify<\/code> with <code>mobile<\/code> and <code>otp<\/code>. No OTP ID is needed.<\/li>\n<\/ul>\n<div class=\"f2s-note\">Need to send the same code again? Use <code>\/dev\/otp\/resend<\/code> instead of calling Send again. Send makes a new code and cancels the old one, which confuses users who already have the first SMS.<\/div>\n<section class=\"f2s-faq\">\n<h2>Frequently asked questions<\/h2>\n<h3>Can I send the OTP to many numbers in one call?<\/h3>\n<p>No. The Send OTP API takes one mobile number per call. Call it once per user.<\/p>\n<h3>Can I send OTP to international numbers?<\/h3>\n<p>No. <code>mobile<\/code> must be a 10-digit Indian number after cleaning.<\/p>\n<h3>Can I use GET instead of POST?<\/h3>\n<p>Yes, the same parameters work in the query string. POST is better because a GET URL with your key can end up in server and proxy logs.<\/p>\n<h3>Does the API return the OTP it created?<\/h3>\n<p>No. The response has the request ID, not the code. If your app needs to know the code, create it yourself and pass it in <code>otp<\/code>.<\/p>\n<h3>Can the OTP have letters?<\/h3>\n<p>Codes made by Fast2SMS are numbers only. If you pass your own value in <code>otp<\/code> it can be up to 10 characters, but a DLT template tagged for numbers needs digits.<\/p>\n<h3>Why does the Sample Code in the panel fail when I paste it?<\/h3>\n<p>The JSON in the Sample Code window has <code>\/\/ optional<\/code> notes. JSON does not allow comments. Remove them, or drop the optional lines.<\/p>\n<h3>Is there a rate limit on Send OTP?<\/h3>\n<p>The limits are per number: the resend wait in <strong>OTP Settings<\/strong> (10 seconds if you never set it). Add your own limit per user and per IP in your app as well, to stop abuse.<\/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 sending OTPs today<\/strong><p>Smart OTP sends on SMS and WhatsApp with fallback, and checks the code 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>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=\"\/help\/sms-delivery-report-status-meaning\/\">SMS delivery report in Fast2SMS: every status explained<\/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\/otp-sms\">Fast2SMS OTP SMS<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The Fast2SMS Send OTP API sends a one-time password to an Indian mobile number on SMS or WhatsApp with one call. You pass the mobile number and your Smart OTP OTP ID. Fast2SMS creates the code, sends it and keeps it so you can check it later with the Verify OTP API. This page covers [&hellip;]<\/p>\n","protected":false},"featured_media":18171,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,5],"tags":[],"class_list":["post-18177","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>Send OTP API: Parameters and Code Examples | Fast2SMS<\/title>\n<meta name=\"description\" content=\"Use the Fast2SMS Send OTP API to send an OTP on SMS or WhatsApp. Parameters, code in PHP, Python, Node.js, Java, C#, Go and cURL, responses and errors.\" \/>\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-send-otp-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Send OTP API: Parameters and Code Examples | Fast2SMS\" \/>\n<meta property=\"og:description\" content=\"Use the Fast2SMS Send OTP API to send an OTP on SMS or WhatsApp. Parameters, code in PHP, Python, Node.js, Java, C#, Go and cURL, responses and errors.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fast2sms.com\/help\/smart-otp-send-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:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-11-18T19:24:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-template-list-hd-11-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-send-otp-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/\"},\"author\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"headline\":\"Fast2SMS Send OTP API: parameters, code examples and response\",\"datePublished\":\"2026-11-18T18:20:20+00:00\",\"dateModified\":\"2026-11-18T19:24:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/\"},\"wordCount\":1459,\"publisher\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-template-list-hd-11-scaled.webp\",\"articleSection\":[\"API\",\"OTP\"],\"inLanguage\":\"en-IN\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/\",\"name\":\"Send OTP API: Parameters and Code Examples | Fast2SMS\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-template-list-hd-11-scaled.webp\",\"datePublished\":\"2026-11-18T18:20:20+00:00\",\"dateModified\":\"2026-11-18T19:24:06+00:00\",\"description\":\"Use the Fast2SMS Send OTP API to send an OTP on SMS or WhatsApp. Parameters, code in PHP, Python, Node.js, Java, C#, Go and cURL, responses and errors.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/#breadcrumb\"},\"inLanguage\":\"en-IN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-IN\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-otp-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-template-list-hd-11-scaled.webp\",\"contentUrl\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/smart-otp-template-list-hd-11-scaled.webp\",\"width\":2560,\"height\":1600,\"caption\":\"OTP Template List with WhatsApp and SMS template cards, each with an OTP ID and copy icon\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.fast2sms.com\\\/help\\\/smart-otp-send-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 Send OTP API: parameters, code examples and response\"}]},{\"@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":"Send OTP API: Parameters and Code Examples | Fast2SMS","description":"Use the Fast2SMS Send OTP API to send an OTP on SMS or WhatsApp. Parameters, code in PHP, Python, Node.js, Java, C#, Go and cURL, responses and errors.","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-send-otp-api\/","og_locale":"en_US","og_type":"article","og_title":"Send OTP API: Parameters and Code Examples | Fast2SMS","og_description":"Use the Fast2SMS Send OTP API to send an OTP on SMS or WhatsApp. Parameters, code in PHP, Python, Node.js, Java, C#, Go and cURL, responses and errors.","og_url":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/","og_site_name":"Fast2SMS","article_publisher":"https:\/\/www.facebook.com\/Fast2SMS\/","article_published_time":"2026-11-18T18:20:20+00:00","article_modified_time":"2026-11-18T19:24:06+00:00","og_image":[{"width":2560,"height":1600,"url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-template-list-hd-11-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-send-otp-api\/#article","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/"},"author":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"headline":"Fast2SMS Send OTP API: parameters, code examples and response","datePublished":"2026-11-18T18:20:20+00:00","dateModified":"2026-11-18T19:24:06+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/"},"wordCount":1459,"publisher":{"@id":"https:\/\/www.fast2sms.com\/#organization"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-template-list-hd-11-scaled.webp","articleSection":["API","OTP"],"inLanguage":"en-IN"},{"@type":"WebPage","@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/","url":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/","name":"Send OTP API: Parameters and Code Examples | Fast2SMS","isPartOf":{"@id":"https:\/\/www.fast2sms.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/#primaryimage"},"image":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-template-list-hd-11-scaled.webp","datePublished":"2026-11-18T18:20:20+00:00","dateModified":"2026-11-18T19:24:06+00:00","description":"Use the Fast2SMS Send OTP API to send an OTP on SMS or WhatsApp. Parameters, code in PHP, Python, Node.js, Java, C#, Go and cURL, responses and errors.","breadcrumb":{"@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/#breadcrumb"},"inLanguage":"en-IN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-IN","@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-otp-api\/#primaryimage","url":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-template-list-hd-11-scaled.webp","contentUrl":"https:\/\/www.fast2sms.com\/help\/wp-content\/uploads\/2026\/11\/smart-otp-template-list-hd-11-scaled.webp","width":2560,"height":1600,"caption":"OTP Template List with WhatsApp and SMS template cards, each with an OTP ID and copy icon"},{"@type":"BreadcrumbList","@id":"https:\/\/www.fast2sms.com\/help\/smart-otp-send-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 Send OTP API: parameters, code examples and response"}]},{"@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\/18177","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=18177"}],"version-history":[{"count":1,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/18177\/revisions"}],"predecessor-version":[{"id":19426,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/posts\/18177\/revisions\/19426"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media\/18171"}],"wp:attachment":[{"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/media?parent=18177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/categories?post=18177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fast2sms.com\/help\/wp-json\/wp\/v2\/tags?post=18177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}