Skip to main content
POST
/
v1
/
auth
/
session
Login
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({email: 'jsmith@example.com', password: '<string>', rememberMe: true})
};

fetch('http://localhost:8000/v1/auth/session', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "success": true,
  "data": {
    "user": {
      "id": "<string>",
      "email": "jsmith@example.com",
      "name": "<string>",
      "image": "<string>",
      "emailVerified": true,
      "createdAt": "2023-11-07T05:31:56Z",
      "role": "<string>"
    },
    "session": {
      "token": "<string>",
      "expiresAt": "2023-11-07T05:31:56Z"
    }
  },
  "meta": {
    "requestId": "<string>",
    "timestamp": "<string>"
  }
}

Body

application/json
email
string<email>
required
password
string
required
Minimum string length: 1
rememberMe
boolean

Response

Login successful

success
enum<boolean>
required
Available options:
true
data
object
required
meta
object
required