This endpoint begins the registration flow by generating a unique 6-digit numeric OTP and delivering it to the provided email address via the Brevo transactional email API. The OTP is stored in MongoDB with a 5-minute TTL and must be submitted alongside the other registration fields to theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dev0302/nextjs-project-1/llms.txt
Use this file to discover all available pages before exploring further.
POST /api/sign-up endpoint to complete account creation.
Method and URL
Authentication
None required. This endpoint is publicly accessible.Request Body
The email address to send the OTP to. Must be a valid email address that has not already been registered.
Example Request
Responses
200 — OTP Sent Successfully
The OTP was generated and dispatched to the provided email address. The user should check their inbox and submit the OTP toPOST /api/sign-up within 5 minutes.
409 — User Already Registered
An account with this email address already exists in the database. Sign in instead.500 — Internal Server Error
The OTP could not be generated or sent. This may be caused by a database connection failure or a Brevo API error.curl Example
Notes
The OTP is generated using the
otp-generator library with upperCaseAlphabets, lowerCaseAlphabets, and specialChars all set to false. The result is always a 6-digit numeric string (e.g., "482910").Uniqueness of each OTP is enforced at the database level by a MongoDB unique index on the
otp field of the OTP collection. If a collision is detected (error code 11000), the server automatically retries the generation loop until a unique OTP is produced before sending.