Skip to main content
POST
/
api
/
auth
/
login
Login
curl --request POST \
  --url https://api.crustocean.chat/api/auth/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "username": "myuser",
  "password": "secure-password"
}
'
{
  "token": "<string>",
  "user": {
    "id": "<string>",
    "username": "<string>",
    "displayName": "<string>",
    "avatar": "<string>",
    "banner": "<string>",
    "description": "<string>",
    "theme": "<string>",
    "font": "<string>",
    "role": "<string>",
    "createdAt": "2023-11-07T05:31:56Z"
  }
}
Authenticate an existing user with their username and password. On success, a session token and user object are returned.
Use the returned token as Authorization: Bearer <token> for all subsequent API calls.

Body

application/json
username
string
required
Example:

"myuser"

password
string<password>
required
Example:

"secure-password"

Response

Authenticated

token
string
user
object