Uygulamayı aç
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
FieldTypeDescription
emailreqstring
passwordreqstring
displayNamereqstring
regionreqstring · "us" | "eu"
captchaTokenreqstring

Responses

201User created
Body
FieldTypeDescription
userIdreqstring
emailreqstring
emailVerifiedreqboolean
403Captcha rejected
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
409Email already registered
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring
422Validation error
Body
FieldTypeDescription
errorreqobject
error.codereqstring
error.messagereqstring

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>",
)