--- title: "OTP Template" slug: "mindbehind-code-station-otp-template" description: "Use the OTP Code Station template in MindBehind to generate and verify one-time passwords (OTPs) over SMS and WhatsApp in your flows." tags: ["code station templates", "mindbehind", "otp template"] updated: 2026-10-11T17:27:30Z published: 2026-10-11T17:27:30Z canonical: "academy.insiderone.com/mindbehind-code-station-otp-template" --- > ## Documentation Index > Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt > Use this file to discover all available pages before exploring further. # OTP Template > **Suggested reading**: [Integrate Code Station](/docs/mindbehind-integrate-code-station) You can use One-Time Password (OTP) verification through SMS and WhatsApp with Code Station Templates. This guide provides answers to these questions: - [What are the requirements for using the OTP template?](/v1/docs/mindbehind-code-station-otp-template#requirements) - [How can I use the OTP template in Code Station modules?](/v1/docs/mindbehind-code-station-otp-template#how-to-use-the-otp-template-in-code-station-modules) - [How can I use the OTP template in the maps?](/v1/docs/mindbehind-code-station-otp-template#how-to-use-the-otp-template-in-the-maps) ## Requirements Before using the OTP template in your [Code Station](/docs/mindbehind-integrate-code-station) modules, you should create a **Secret Key**. 1. Navigate to **Companies** > **Your Company** > **Code Station** > **Secret Manager.** 2. Click the **Add Secret** button and add the parameters below: - **BASE_URL**: If you use Insider’s OTP services, you can use “https://verify.useinsider.com” as the endpoint. - **X_INS_AUTH_KEY**: To create an **API key** from Insider’s services, refer to the [Generate API Keys](https://academy.insiderone.com/docs/verify-api-generate-otp-codes). ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/Monosnap%20OTP%20With%20Code%20Station%20-%20Google%20Docs%202024-10-21%2022-25-18(1).png) After generating the **Secret Key**, you can create code modules to generate and verify the OTPs. ## How to use the OTP template in Code Station modules After completing the requirements above, follow the steps below to create your OTP template: 1. Navigate to **Companies**> **Your Company**> **Code Station**. Click the **Add Code Block** button. ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/acb9.png) 2. Click the **Select** button for the **Create from Template** option.![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/acb2(1).png) 3. Select the **OTP** integration.![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/otp1*.png)The OTP category has two functions, and it is important to use both of them: - **Generate OTP**: This function is designed to send a one-time password (OTP) to a specific communication channel (for example, [WhatsApp](/docs/whatsapp-overview) or [SMS](/docs/sms-overview)) of the user. - **Verify OTP**: This function verifies whether the one-time password (OTP) entered by the user is correct. 4. Choose the **template** you want to use. ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/image-1729577330971.png) 5. Select the **Secret Key** that you created for your code block in the [requirements](/v1/docs/mindbehind-code-station-otp-template#requirements) steps. Click the **Add Code Block** button. ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/otp3*.png) ## How to use the OTP template in the maps You can use the OTP template in your maps to both generate and verify OTP's. To use the **Generate** **OTP** function, you should add certain parameters in the [Code Station Action module](/docs/code-station-action):![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/Monosnap%20Untitled%2017%202024-10-22%2009-15-36(1).png) You can find these parameters and their functions in the table below: | Parameter | Function | | --- | --- | | to | It specifies the destination phone number in E.164 format to which the OTP code will be sent (+90XXXXXXXXXX, +55XXXXXXXXXX). | | channel | It indicates the channel through which the OTP code will be sent (SMS or WhatsApp). | | codeLength | It specifies the length of the OTP code to be generated, which must be between 4 and 8 digits. For example, when you set the codeLength to 5, OTP will look like XXXXX). | | locale | It determines the language in which the OTP code message will be sent (For example, tr: Turkish, de: German, en: English, etc.) | | ttl | It specifies the Time-To-Live (TTL) duration for the OTP code, indicating the time window within which the OTP code is valid. This is measured in seconds (min: 60, max: 600). | | maximumAttempts | It sets the maximum number of allowed OTP verification attempts. If verification fails after reaching this limit, further attempts might be denied (min: 1, max: 10). | To use the **verify OTP** function in your maps, you need to include certain parameters in the [Code Station Action module](/docs/code-station-action): ![](https://cdn.document360.io/c6df4583-da94-4cb2-bb8a-be0cbdd11109/Images/Documentation/Monosnap%20Untitled%2017%202024-10-22%2009-30-12(1).png) You can find these parameters and their functions in the table below: | Parameters | Function | | --- | --- | | code | It is the OTP code that you received. | | to | It is the phone number to which the OTP code is sent. | Output parameters of the Generate and Verify OTP functions are: - **Generate**: isSent (true/false) - **Verify**: isVerified (true/false)