Moonborn — API · auth
Register a new user with email + password (Auth.js self-hosted)
Creates the user with Argon2id-hashed password, emits a verification email, enforces breach-list check (HIBP), and requires a Cloudflare Turnstile captcha token.
POST/v1/auth/registerscope · Public (no auth)
Request body
| Field | Type | Description |
|---|---|---|
| emailreq | string | |
| passwordreq | string | |
| displayNamereq | string | |
| regionreq | string · "us" | "eu" | |
| captchaTokenreq | string |
Responses
201User created
Body
| Field | Type | Description |
|---|---|---|
| userIdreq | string | |
| emailreq | string | |
| emailVerifiedreq | boolean |
403Captcha rejected
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
409Email already registered
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
422Validation error
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X POST https://api.moonborn.co/v1/auth/register \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "<string>",
"password": "<string>",
"displayName": "<string>",
"region": "us",
"captchaToken": "<string>"
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.auth.registerUser({
email: "<string>",
password: "<string>",
displayName: "<string>",
region: "us",
captchaToken: "<string>",
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.auth.register_user(
email="<string>",
password="<string>",
display_name="<string>",
region="us",
captcha_token="<string>",
)