Moonborn — API · auth
Authenticate with email + password (+ optional TOTP)
POST/v1/auth/loginscope · Public (no auth)
Request body
| Field | Type | Description |
|---|---|---|
| emailreq | string | |
| passwordreq | string | |
| totpCode | string | |
| captchaToken | string |
Responses
200OK
Body
| Field | Type | Description |
|---|---|---|
| sessionIdreq | string | |
| userIdreq | string | |
| expiresAtreq | string | |
| mfaRequiredreq | boolean |
401Invalid credentials
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
423Account locked (rate limit)
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
428MFA required
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/auth/login \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "<string>",
"password": "<string>"
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.auth.loginUser({
email: "<string>",
password: "<string>",
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.auth.login_user(
email="<string>",
password="<string>",
)