Documentation Index
Fetch the complete documentation index at: https://mintlify.com/eggarcia98/auth-backend/llms.txt
Use this file to discover all available pages before exploring further.
Verify the 6-digit OTP code sent to a user’s email. On success, returns a user object and authentication tokens.
Request
POST /api/v1/auth/verify-otp
No authentication required.
Body
The email address the OTP was sent to.
The 6-digit OTP code received by the user.
Response
Indicates whether the request succeeded. Always true on success.
Whether the user’s email has been verified.
Authentication provider. One of: email, google, apple.
ISO 8601 timestamp of account creation.
ISO 8601 timestamp of the last account update.
JWT access token for authenticating subsequent requests.
Token used to obtain a new access token when the current one expires.
Access token lifetime in seconds.
Examples
curl --request POST \
--url https://your-api.com/api/v1/auth/verify-otp \
--header 'Content-Type: application/json' \
--data '{
"email": "user@example.com",
"token": "123456"
}'
Success response
{
"success": true,
"data": {
"user": {
"id": "usr_01h9...",
"email": "user@example.com",
"emailVerified": true,
"provider": "email",
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
},
"tokens": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expiresIn": 3600
}
}
}
Error responses
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid email address"
}
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired OTP"
}
}