XISUITEDokumentation

Authentication

User signup, verification, and password recovery 14 Endpunkte. Basis-URL: https://xapi.ambertech.cloud/api/v1

Bootstrap session payload#

GET/auth/bootstrapToken

One-shot endpoint returning user + organization + spaces + permissions for fast dashboard initialization. Replaces 3-4 sequential calls.

Antworten

  • 200Bootstrap payload
  • 401Not authenticated
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/auth/bootstrap" \
  -H "Authorization: Bearer $XISUITE_TOKEN"

Exchange a Supabase auth code for a session#

POST/auth/exchange-codeÖffentlich

Used by the password-reset confirmation page and other flows where the user lands on the frontend with a one-time `code` from a Supabase email link. Returns tokens and writes auth cookies.

Request-Bodyapplication/jsonExchangeCodeDto

NameTypBeschreibung
codePflichtstring

One-time Supabase auth code from a recovery / invite email link or OAuth callback.

Antworten

  • 200Code exchanged — cookies set
  • 400Invalid or expired code
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/exchange-code" \
  -H "Content-Type: application/json" \
  -d '{"code":"…"}'

Request password reset#

POST/auth/forgot-passwordÖffentlich

Sends a password reset email with a secure link. Always returns success to prevent email enumeration.

Request-Bodyapplication/jsonEmailDto

NameTypBeschreibung
emailPflichtstring

User email address

Beispiel: user@example.com

Antworten

  • 200Password reset email sent (always returns success)
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/forgot-password" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com"}'

Get current user + tenant context#

GET/auth/meToken

Returns the authenticated user's profile alongside the multi-tenant context: the currently active organization (matching the active_org_id cookie) and every organization the caller is a member of. Replaces the legacy single-org `/auth/me` shape — callers that used to read `.organization_id` should now read `.activeOrganization.id`. `.user` carries the bare profile for back-compat.

Antworten

  • 200User profile + tenant context
  • 401Not authenticated
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/auth/me" \
  -H "Authorization: Bearer $XISUITE_TOKEN"

Refresh access token for browser navigation#

GET/auth/refreshÖffentlich

Reads refresh_token from the HttpOnly cookie, rotates auth cookies, and redirects back to an allowlisted frontend URL.

Antworten

  • 200OK
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/auth/refresh"

Refresh access token#

POST/auth/refreshÖffentlich

Exchanges a refresh token for a new pair. Token is read from the body OR from the refresh_token cookie (browser-friendly). New cookies are written on the response.

Request-Bodyapplication/jsonRefreshTokenDto

NameTypBeschreibung
refreshTokenstring

Refresh token. Optional when the refresh_token cookie is present.

Beispiel: pcnpngwwbrge

Antworten

  • 200Token refreshed — cookies rotated
  • 401Invalid or expired refresh token
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/refresh" \
  -H "Content-Type: application/json" \
  -d '{"refreshToken":"pcnpngwwbrge"}'

Transfer a browser session to a published site origin#

GET/auth/refresh/transfer-sessionÖffentlich

Validates backend-owned HttpOnly cookies and redirects to an allowlisted published return URL with a short-lived bearer in the URL hash. The `/auth/refresh/transfer-session` alias is used by browsers so the path-scoped refresh_token cookie can recover expired access sessions.

Antworten

  • 200OK
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/auth/refresh/transfer-session"

Resend verification OTP#

POST/auth/resend-verificationÖffentlich

Generates a new OTP for an unconfirmed user and sends it via email. Returns a generic response to prevent email enumeration.

Request-Bodyapplication/jsonEmailDto

NameTypBeschreibung
emailPflichtstring

User email address

Beispiel: user@example.com

Antworten

  • 200Verification email resent
  • 400Could not generate verification code
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/resend-verification" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com"}'

Sign in with email and password#

POST/auth/signinÖffentlich

Authenticates a user with email/password. Returns the user profile and writes `access_token` + `refresh_token` HttpOnly cookies on the response. Cookie-based clients can rely on the browser to send these on subsequent requests; header-based clients can read the body tokens.

Request-Bodyapplication/jsonSigninDto

NameTypBeschreibung
emailPflichtstring

User email address

Beispiel: prince@abjexperts.com

passwordPflichtstring

User password

Beispiel: Admin@123

Antworten

  • 200Sign-in successful — cookies set, body returns tokens + user
  • 401Invalid email or password
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/signin" \
  -H "Content-Type: application/json" \
  -d '{"email":"prince@abjexperts.com","password":"Admin@123"}'

Sign out#

POST/auth/signoutToken

Invalidates the user's current session refresh token on the server and clears auth cookies. With `?everywhere=true`, revokes ALL of this user's sessions across devices.

Parameter

NameOrtTypBeschreibung
everywherePflichtQuerystring–

Antworten

  • 200Signed out successfully
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/signout" \
  -H "Authorization: Bearer $XISUITE_TOKEN"

Register a new user#

POST/auth/signupÖffentlich

Creates a new user account via Supabase Auth and sends an OTP verification email. The database trigger `handle_new_user` automatically creates the public.users profile.

Request-Bodyapplication/jsonSignupDto

NameTypBeschreibung
firstNamePflichtstring

User first name

Beispiel: Prince

lastNamePflichtstring

User last name

Beispiel: Jadiya

emailPflichtstring

User email address

Beispiel: user@example.com

passwordPflichtstring

Password (min 6 characters)

Beispiel: SecurePass123

Antworten

  • 200Signup successful — OTP email sent
  • 400Validation error or signup failed
  • 503Verification email could not be sent (code: email_send_failed) — the account is created; retrying signup re-sends the OTP once mail delivery is fixed
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/signup" \
  -H "Content-Type: application/json" \
  -d '{"firstName":"Prince","lastName":"Jadiya","email":"user@example.com","password":"SecurePass123"}'

Transfer a browser session to a published site origin#

GET/auth/transfer-sessionÖffentlich

Validates backend-owned HttpOnly cookies and redirects to an allowlisted published return URL with a short-lived bearer in the URL hash. The `/auth/refresh/transfer-session` alias is used by browsers so the path-scoped refresh_token cookie can recover expired access sessions.

Antworten

  • 200OK
Beispiel (cURL)
curl -X GET "https://xapi.ambertech.cloud/api/v1/auth/transfer-session"

Update password#

POST/auth/update-passwordToken

Changes the password for the currently authenticated user. Token is read from the access_token cookie or the Authorization header.

Request-Bodyapplication/jsonUpdatePasswordDto

NameTypBeschreibung
passwordPflichtstring

New password (min 6 characters)

Beispiel: NewSecurePass456

Antworten

  • 200Password updated successfully
  • 400Failed to update password
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/update-password" \
  -H "Authorization: Bearer $XISUITE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"password":"NewSecurePass456"}'

Verify email with OTP#

POST/auth/verify-otpÖffentlich

Verifies the user's email using the OTP code. Returns JWT tokens and writes auth cookies.

Request-Bodyapplication/jsonVerifyOtpDto

NameTypBeschreibung
emailPflichtstring

User email

Beispiel: user@example.com

tokenPflichtstring

The 6-digit OTP received via email

Beispiel: 123456

Antworten

  • 200OTP verified — cookies set
  • 400Invalid or expired OTP
Beispiel (cURL)
curl -X POST "https://xapi.ambertech.cloud/api/v1/auth/verify-otp" \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","token":"123456"}'
Stand: 25. Oktober 2026© 2026 XISUITE · AmberTech Solutions