ℹ️
Base URL

All endpoints are relative to https://api.oasisomniverse.one/api (production) or http://localhost:4000/api (local ONODE).

Response Envelope

Every OASIS API response wraps its payload in a standard envelope:

json
{
  "result":    "…",          // the returned payload (object, array, or null)
  "isError":   false,       // true when a hard error occurred
  "isWarning": false,       // true for soft warnings (non-fatal)
  "message":   "Success",   // human-readable status or error message
  "detailedMessage": ""    // extended diagnostic detail (may be empty)
}

Always check isError first. A 200 OK HTTP status does not guarantee success — OASIS returns isError: true inside the envelope for business-logic failures (e.g. username already taken).

Register

POST /avatar/register

Creates a new avatar. Sends a verification email to the supplied address.

Request body

FieldTypeDescription
usernamerequiredstringUnique username (3–32 chars, alphanumeric + underscores)
emailrequiredstringUnique email address — used for login and verification
passwordrequiredstringMin 8 characters
titlestringDisplay name / avatar title
providerTypestringStorage provider override (default: configured ONODE default)
javascript
const res = await fetch('/api/avatar/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    username: 'david',
    email:    'david@example.com',
    password: 's3cur3pass!',
    title:    'David'
  })
});
const { result, isError, message } = await res.json();
if (isError) throw new Error(message);

Authenticate

POST /avatar/authenticate

Authenticates an avatar by username/email + password. Returns a JWT token valid for 7 days.

Request body

FieldTypeDescription
usernamestringUsername or email (one required)
emailstringEmail or username (one required)
passwordrequiredstringAccount password

Response result

FieldTypeDescription
jwtTokenstringBearer token — include in Authorization header for all authenticated requests
idguidAvatar unique identifier
usernamestringCanonical username
emailstringVerified email address
karmaTotalnumberTotal karma score at login time
⚠️
Email verification required

Avatars with unverified email addresses will receive isError: true on authenticate until the verification link is clicked.

Get Avatar

GET /avatar/{id}

Returns the full avatar profile for the given ID. Requires a valid JWT in the Authorization: Bearer <token> header.

Get All Avatars

GET /avatar

Returns all avatars. Admin-only — requires an avatar with AvatarType: Admin.

Update Avatar

PUT /avatar/{id}

Updates avatar fields. Only the authenticated avatar owner or an Admin may update a profile.

Updatable fields

FieldTypeNotes
titlestringDisplay name
descriptionstringBio / about text
usernamestringUniqueness enforced — returns isError on conflict
emailstringTriggers re-verification email
imagestringURL or base64 avatar image
dobstring (ISO 8601)Date of birth

Delete Avatar

DELETE /avatar/{id}

Soft-deletes the avatar. The record is retained in storage but marked inactive. Admin-only.

Email Verification

GET /avatar/verify-email

Called automatically when the user clicks the link in their verification email. Query param: token.

POST /avatar/resend-verification-email/{email}

Re-sends the verification email. Rate-limited to 3 per hour per email address.

Password Reset

POST /avatar/forgot-password

Sends a password-reset email. Body: { "email": "…" }.

POST /avatar/reset-password

Resets the password using the token from the email. Body: { "token": "…", "password": "…", "confirmPassword": "…" }.