Custom Codes
Learn how to use generate your own custom OTP in your verification requests.
Introduction
Although Prelude can generate a code for you, you can also generate your own custom OTP. This is useful when:
- You use a multiprovider setup where you recognize which provider converted the user.
- You want to integrate Prelude effortlesly with an existing authentication flow.
- Use alphanumeric characters in the code (subject to Prelude’s approval).
To enable the custom code feature on your account, you need to contact our support team.
If you just want to use codes of a variable length, you can simply use the options.code_size
parameter on the POST /v2/verification
endpoint.
How to use custom codes in your verification flow
To use a custom code for your verification flow, you need to set the custom_code
parameter to the code you want to use on the POST /v2/verification
endpoint.
The custom code needs to be a string of 4 to 8 numeric characters.
The custom code you want to use. The code needs to be a string of 4 to 8 numeric characters.
Then Prelude will send a message with this custom code to the user.
Caveats
To ensure optimal performance:
- Ensure that you are sending a different custom code for each verification request/retry.
- Ensure that you are always sending the
POST /v2/verification/check
request to verify the code when the user enters the code.
Prelude uses the custom code to identify which provider converted the user. If you send the same custom code for multiple verification requests, Prelude will not be able to identify which provider converted the user and will not be able to attribute the conversion to a specific provider and thus optimize the routing algorithm for your account. You can read more about the multi-routing system here.
Alphanumeric custom codes
Prelude allows you to use alphanumeric characters in the custom code. However, this is subject to approval. Please contact our support team to enable this feature for your account.