Skip to main content

Overview

The authentication API uses NextAuth.js for session management and provides endpoints for user registration, email verification, password recovery, and session handling. All authentication endpoints use JWT tokens for session management.

Send verification email

curl -X POST https://api.solbid.com/api/auth/verify-email \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com"
  }'
Sends a 6-digit OTP verification code to the user’s email address. This is used during the signup process to verify email ownership.

Request body

email
string
required
User’s email address. Must be a valid email format.

Response

message
string
Success message indicating OTP was sent
{
  "message": "OTP verification email send"
}
The OTP expires after 5 minutes and is stored in the database for verification.

Verify email OTP

curl "https://api.solbid.com/api/auth/verify-email?email=user@example.com&otp=123456"
Verifies the OTP code sent to the user’s email address.

Query parameters

email
string
required
User’s email address
otp
string
required
6-digit OTP code sent to the email

Response

message
string
Verification status message
{
  "message": "OTP verified successfully"
}
OTP codes are valid for 5 minutes from creation time.

Authenticate user

curl -X POST https://api.solbid.com/api/auth/callback/credentials \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securePassword123"
  }'
Authenticates a user using NextAuth.js credentials provider. Supports both email/password and OAuth providers.

Request body

email
string
required
User’s email address
password
string
required
User’s password (minimum 3 characters)

Response

user
object
Authenticated user information
token
string
JWT session token
This endpoint is managed by NextAuth.js and supports both GET and POST methods for various authentication flows.

Request password reset

curl -X POST https://api.solbid.com/api/auth/forgot-password \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com"
  }'
Sends a password reset OTP to the user’s registered email address.

Request body

email
string
required
User’s registered email address

Response

message
string
Status message
{
  "message": "OTP sent to your email"
}

Reset password

curl -X POST https://api.solbid.com/api/auth/reset-password \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "newSecurePassword123"
  }'
Resets the user’s password after OTP verification.

Request body

email
string
required
User’s email address
password
string
required
New password (minimum 3 characters)

Response

message
string
Status message
{
  "message": "Password reset successfully"
}
Passwords are hashed using bcrypt with a salt round of 10 before storage.

Build docs developers (and LLMs) love