Login

api-docs Redoc document (api spec)

Login an existing user

post
Body
emailstring · emailRequired

Email address for the user

Example: [email protected]
passwordstringRequired

Password for the user

Example: password123
Responses
200
OK
application/json
post
POST /api/login HTTP/1.1
Host: url to be defined
Content-Type: application/json
Accept: */*
Content-Length: 53

{
  "email": "[email protected]",
  "password": "password123"
}
{
  "error": {
    "code": "040",
    "message": "Wrong email or password"
  },
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
  }
}

To use this endpoint, you will need to send an HTTP POST request to the URL /login. The request body should be in JSON format and should contain the following fields:

  • email: a string representing the user's email address, in the format "[email protected]"

  • password: a string representing the user's password

Here's an example of what the request body might look like:

{
  "email": "[email protected]",
  "password": "password123"
}

If the login is successful, the API will return a response with a status code of 200 and a JSON body containing a success message and a JSON Web Token (JWT) that can be used to authenticate the user for future requests. The JSON body will look something like this:

{
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
  }
}

Last updated