Skip to main content

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

email
string
required
The email address the OTP was sent to.
token
string
required
The 6-digit OTP code received by the user.

Response

success
boolean
required
Indicates whether the request succeeded. Always true on success.
data
object

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

200
{
  "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

400
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid email address"
  }
}
401
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired OTP"
  }
}

Build docs developers (and LLMs) love