POST /business-user/login

Authenticate a user using their email and password.

application/json

Body Required

  • email string(email) Required
  • password string(password) Required

Responses

  • 200 application/json

    Successful login

    Hide response attributes Show response attributes object
    • message string
    • response object
      Hide response attributes Show response attributes object
      • _id string
      • firstName string
      • lastName string
      • email string
      • designation string
      • isActive boolean
      • createdAt string
      • updatedAt string
      • __v number
      • businessId string
      • token string
      • refreshToken string
  • 400 application/json

    We're sorry, but it seems there's a data validation error.

    Hide response attribute Show response attribute object
    • message string
POST /business-user/login
curl \
 --request POST 'https://beta.api.sustainology.life/business-user/login' \
 --header "Content-Type: application/json" \
 --data '{"email":"hello@example.com","password":"string"}'
Request examples
{
  "email": "hello@example.com",
  "password": "string"
}
Response examples (200)
{
  "message": "User logged in successfully!",
  "response": {
    "__v": 0,
    "_id": "664375f42c7ab6569a69a3bb",
    "email": "john.doe@example.com",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NjQ....",
    "isActive": true,
    "lastName": "Doe",
    "createdAt": "2024-05-14T14:32:20.297Z",
    "firstName": "John",
    "updatedAt": "2024-06-01T13:17:35.208Z",
    "businessId": "Fsda333798T5",
    "designation": "admin",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQi...."
  }
}
Response examples (400)
{
  "message": "Invalid Credentials"
}