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
POST /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
POST /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
404
Email not registered
post
POST /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
400
Invalid or expired token
post
POST /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
post
POST /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
400
Invalid or expired token
post
POST /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