Auth

Authentication related endpoints.

User login

post
Body
emailstring · emailRequired
passwordstring · min: 8Required
Responses
200
Login successful
application/json
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..."
}

Create new account

post
Body
emailstring · emailRequired
passwordstring · min: 8Required
rolestring · enumRequiredPossible values:
Responses
201
Signup successful
application/json
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..."
}

Request password reset link

post
Body
emailstring · emailRequired
Responses
200
Reset OTP sent
post
POST /api/auth/forgot-password HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "email": "[email protected]"
}

No content

Reset user password

post
Body
emailstring · emailRequired
tokenstringRequired
newPasswordstring · min: 8Required
Responses
200
Password reset successful
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

Send verification email

post
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

Verify OTP or reset token

post
Body
emailstring · emailRequired
tokenstringRequired
Responses
200
Token verified
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