Skip to main content
POST
/
auth
/
login
Login
curl --request POST \
  --url https://api.example.com/auth/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>"
}
'
{
  "user": {
    "id": "<string>",
    "email": "<string>",
    "displayName": "<string>",
    "avatarUrl": {},
    "createdAt": "<string>"
  },
  "accessToken": "<string>"
}
Authenticate a user and receive a JWT access token.

Request Body

email
string
required
User’s email address. Must be a valid email format.
password
string
required
User’s password.

Response

user
object
The authenticated user object.
id
string
Unique identifier for the user.
email
string
User’s email address.
displayName
string
User’s display name.
avatarUrl
string | null
URL to user’s avatar image, if set.
createdAt
string
ISO 8601 timestamp of when the user was created.
accessToken
string
JWT access token for authenticating subsequent requests. Valid for 7 days.

Example Request

curl -X POST https://api.neuronmeet.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securePassword123"
  }'

Example Response

{
  "user": {
    "id": "clx1234567890abcdef",
    "email": "[email protected]",
    "displayName": "John Doe",
    "avatarUrl": null,
    "createdAt": "2024-03-15T10:30:00.000Z"
  },
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Error Responses

401 Unauthorized

Returned when the email or password is incorrect.
{
  "statusCode": 401,
  "message": "Invalid credentials",
  "error": "Unauthorized"
}

400 Bad Request

Returned when validation fails for any field.
{
  "statusCode": 400,
  "message": [
    "email must be an email",
    "password must be a string"
  ],
  "error": "Bad Request"
}

Build docs developers (and LLMs) love