Complete Reference
REST API Reference
Comprehensive directory of all endpoints, authentication headers, request payloads, response structures, and rate limits exposed by MBKAuthe.
POST
Rate Limit: 8 / min
/mbkauthe/api/login
Authenticates user credentials, sets encrypted session cookie, or prompts 2FA challenge.
Request Body (JSON)
{
"username": "john.doe",
"password": "SecurePass123!"
}
"username": "john.doe",
"password": "SecurePass123!"
}
Success Response (200 OK)
{
"success": true,
"message": "Login successful",
"redirect_url": "/dashboard"
}
"success": true,
"message": "Login successful",
"redirect_url": "/dashboard"
}
POST
Rate Limit: 5 / min
/mbkauthe/api/verify-2fa
Verifies 6-digit TOTP token to complete 2FA login challenge.
Request Body (JSON)
{
"token": "123456",
"_csrf": "csrf_token"
}
"token": "123456",
"_csrf": "csrf_token"
}
Success Response (200 OK)
{
"success": true,
"message": "Login successful"
}
"success": true,
"message": "Login successful"
}
POST
Auth: Session
/api/token
Generates a scoped API token with SHA-256 storage hashing.
Request Body (JSON)
{
"name": "CI Bot",
"scope": "read-only",
"expiresDays": 30
}
"name": "CI Bot",
"scope": "read-only",
"expiresDays": 30
}
Success Response (201 Created)
{
"success": true,
"token": "mbk_a1b2c3...",
"id": 42
}
"success": true,
"token": "mbk_a1b2c3...",
"id": 42
}
POST
Public
/api/tokens/verify
Validates an API token and returns assigned username, permissions, and expiration.
Request Body (JSON)
{ "token": "mbk_a1b2c3d4..." }
Success Response (200 OK)
{
"tokenValid": true,
"username": "jane"
}
"tokenValid": true,
"username": "jane"
}
POST
Rate Limit: 20 / min
/api/cli/device
Initiates RFC 8628 CLI device flow and generates a verification link and user code.
Request Body (JSON)
{
"client_name": "my-cli",
"profile_key": "1362403658a3"
}
"client_name": "my-cli",
"profile_key": "1362403658a3"
}
Success Response (201 Created)
{
"verification_url": "https://.../XXXX-XXXX",
"user_code": "XXXX-XXXX",
"interval": 5
}
"verification_url": "https://.../XXXX-XXXX",
"user_code": "XXXX-XXXX",
"interval": 5
}
GET
Auth: Cookie
/mbkauthe/api/checkSession
Checks current cookie session validity and returns expiration timestamp.
Success Response (200 OK)
{ "session_valid": true, "expiry": "2026-09-14T12:00:00.000Z" }