{"id":1544,"date":"2025-03-05T15:43:38","date_gmt":"2025-03-05T10:13:38","guid":{"rendered":"https:\/\/www.smsgatewaycenter.com\/blog\/?post_type=docs&#038;p=1544"},"modified":"2025-06-15T14:28:16","modified_gmt":"2025-06-15T08:58:16","password":"","slug":"what-are-the-maximum-and-minimum-otp-expiry-times-on-sms-gateway-center","status":"publish","type":"docs","link":"https:\/\/www.smsgatewaycenter.com\/blog\/kb\/what-are-the-maximum-and-minimum-otp-expiry-times-on-sms-gateway-center\/","title":{"rendered":"What are the Maximum and Minimum OTP Expiry Times on SMS Gateway Center?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When using <strong>SMSGatewayCenter<\/strong>\u2019s <strong><a href=\"https:\/\/www.smsgatewaycenter.com\/integrated-otp-sms\/\">Integrated OTP SMS<\/a><\/strong> service, you have the flexibility to customize the OTP expiry time to suit your needs. The expiry time determines how long the one-time password (OTP) remains valid before it becomes unusable, ensuring both security and user convenience.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our <strong><a href=\"https:\/\/www.smsgatewaycenter.com\/developer-api\/generate-otp\/\">Generate OTP API<\/a><\/strong>, we\u2019ve included an optional parameter called <strong>codeExpiry<\/strong>, which allows you to set the OTP expiry time in seconds. Here\u2019s what you need to know:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Default Expiry Time:<\/strong> If you don\u2019t specify a value, the OTP expires in <strong>300 seconds<\/strong> (5 minutes). This strikes a balance between giving users enough time to enter the code and maintaining security.<\/li>\n\n\n\n<li><strong>Customizable Range:<\/strong> You can adjust the <strong>codeExpiry<\/strong> value based on your requirements. While there\u2019s no strict maximum or minimum enforced by the API, we recommend setting a practical range:\n<ul class=\"wp-block-list\">\n<li><strong>Minimum:<\/strong> As low as <strong>30 seconds<\/strong> for high-security scenarios (e.g., financial transactions).<\/li>\n\n\n\n<li><strong>Maximum:<\/strong> Up to <strong>1800 seconds<\/strong> (30 minutes) or more for less time-sensitive use cases (e.g., account recovery).<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How to Set OTP Expiry Time:<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Simply include the <strong>codeExpiry<\/strong> parameter in your <a href=\"https:\/\/www.smsgatewaycenter.com\/developer-api\/generate-otp\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Generate OTP API<\/strong><\/a> request and specify the duration in seconds. For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>codeExpiry<\/strong>: 120 sets the OTP to expire in 2 minutes.<\/li>\n\n\n\n<li><strong>codeExpiry<\/strong>: 600 extends it to 10 minutes.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Why It Matters:<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Customizing the OTP expiry time lets you tailor the authentication experience. A shorter expiry enhances security by reducing the window for misuse, while a longer expiry improves usability for users who might need extra time. With <strong>SMSGatewayCenter<\/strong>, you\u2019re in control\u2014set it as per your application\u2019s unique needs!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ready to optimize your OTP flow? Check out our <strong><a href=\"https:\/\/www.smsgatewaycenter.com\/developer-api\/\">API documentation<\/a><\/strong> and start integrating today!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using SMSGatewayCenter\u2019s Integrated OTP SMS service, you have the flexibility to customize the OTP expiry time to suit your needs. The expiry time determines how long the one-time password (OTP) remains valid before it becomes unusable, ensuring both security and user convenience. In our Generate OTP API, we\u2019ve included an optional parameter called codeExpiry, [&hellip;]<\/p>\n","protected":false},"author":118,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[1341],"doc_tag":[],"class_list":["post-1544","docs","type-docs","status-publish","hentry","doc_category-integrated-otp-sms"],"year_month":"2026-07","word_count":271,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"admin","author_nicename":"admin","author_url":"https:\/\/www.smsgatewaycenter.com\/blog\/author\/admin\/"},"doc_category_info":[{"term_name":"Integrated OTP SMS","term_url":"https:\/\/www.smsgatewaycenter.com\/blog\/kb-cat\/integrated-otp-sms\/"}],"doc_tag_info":[],"_links":{"self":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/docs\/1544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/users\/118"}],"replies":[{"embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/comments?post=1544"}],"version-history":[{"count":0,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/docs\/1544\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/media?parent=1544"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/doc_category?post=1544"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.smsgatewaycenter.com\/blog\/wp-json\/wp\/v2\/doc_tag?post=1544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}