Log in with username and password
POST
/auth/login
const url = 'https://your-server.example/api/auth/login';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"username":"example","password":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://your-server.example/api/auth/login \ --header 'Content-Type: application/json' \ --data '{ "username": "example", "password": "example" }'Validates credentials and sets the session cookie. Subject to per-IP
rate limiting and per-user/per-IP lockout.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
username
required
string
password
required
string
Example generated
{ "username": "example", "password": "example"}Responses
Section titled “Responses”Login succeeded; session cookie set.
Media typeapplication/json
object
username
string
role
string
Example generated
{ "username": "example", "role": "example"}Headers
Section titled “Headers”Set-Cookie
string
HttpOnly session cookie.
Invalid request.
Media typetext/plain
string
Missing or invalid credentials.
Media typetext/plain
string
Rate limited or locked out.
Media typetext/plain
string