Auth
Authentication related endpoints.
Body
emailstring · emailRequired
passwordstring · min: 8Required
Responses
200
Login successful
application/json
401
Invalid credentials
429
Too many login attempts
post
/api/auth/loginPOST /api/auth/login HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 44
{
  "email": "[email protected]",
  "password": "text"
}{
  "message": "Login successful",
  "user": {
    "uid": "text",
    "email": "[email protected]",
    "role": "text",
    "emailVerified": true,
    "walletAddress": "text"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Body
emailstring · emailRequired
passwordstring · min: 8Required
rolestring · enumRequiredPossible values: 
Responses
201
Signup successful
application/json
409
Email already in use
post
/api/auth/signupPOST /api/auth/signup HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 65
{
  "email": "[email protected]",
  "password": "text",
  "role": "contributor"
}{
  "message": "Login successful",
  "user": {
    "uid": "text",
    "email": "[email protected]",
    "role": "text",
    "emailVerified": true,
    "walletAddress": "text"
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Body
emailstring · emailRequired
Responses
200
Reset OTP sent
No content
404
Email not registered
post
/api/auth/forgot-passwordPOST /api/auth/forgot-password HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 26
{
  "email": "[email protected]"
}No content
Body
emailstring · emailRequired
tokenstringRequired
newPasswordstring · min: 8Required
Responses
200
Password reset successful
No content
400
Invalid or expired token
post
/api/auth/reset-passwordPOST /api/auth/reset-password HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 62
{
  "email": "[email protected]",
  "token": "text",
  "newPassword": "text"
}No content
Body
emailstring · emailRequired
Responses
200
Verification OTP sent
No content
post
/api/auth/verify-emailPOST /api/auth/verify-email HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 26
{
  "email": "[email protected]"
}200
Verification OTP sent
No content
Body
emailstring · emailRequired
tokenstringRequired
Responses
200
Token verified
No content
400
Invalid or expired token
post
/api/auth/verify-tokenPOST /api/auth/verify-token HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 41
{
  "email": "[email protected]",
  "token": "text"
}No content
Last updated