Skip to content

Dashboard Authentication

Request access, log in, manage sessions, configure MFA, and manage account security.

All routes in this page live under https://app.pacspace.io/dashboard/auth.

http
POST https://app.pacspace.io/dashboard/auth/request-access

Public routes do not require authentication. Protected routes require a valid dashboard session cookie (-b pacspace-dashboard-cookies.txt).

Unsafe cookie-authenticated methods (POST, PUT, PATCH, DELETE) also include X-Pacspace-CSRF: 1.


Request Access

PacSpace accounts are approved before a tenant is created. Start with a request-access call. It always returns the same public response, even if the email already has a request.

bash
curl -X POST https://app.pacspace.io/dashboard/auth/request-access \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "jane@company.com",
    "organization": "Acme Inc",
    "buyerMode": "DIRECT_INFERENCE_VENDOR",
    "useCase": "Record usage before monthly invoices go out."
  }'

After approval, PacSpace sends a single-use approval token. Use that token to create the account.

bash
curl -X POST https://app.pacspace.io/dashboard/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "jane@company.com",
    "password": "SecurePass1",
    "organization": "Acme Inc",
    "buyerMode": "DIRECT_INFERENCE_VENDOR",
    "approvalToken": "APPROVAL_TOKEN"
  }'

Without an approved token, registration returns REGISTRATION_REQUIRES_APPROVAL and no tenant is created.


Login

Authenticate with email/password and establish an httpOnly dashboard session.

bash
curl -X POST https://app.pacspace.io/dashboard/auth/login \
  -c pacspace-dashboard-cookies.txt \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@company.com",
    "password": "SecurePass1"
  }'

If MFA is enabled and no MFA code is supplied, login returns:

json
{
  "success": true,
  "data": {
    "requiresMfa": true,
    "mfaTicket": "..."
  },
  "message": "MFA verification required"
}

Complete MFA Login

bash
curl -X POST https://app.pacspace.io/dashboard/auth/login/mfa-verify \
  -c pacspace-dashboard-cookies.txt \
  -H "Content-Type: application/json" \
  -d '{
    "mfaTicket": "MFA_TICKET_FROM_LOGIN",
    "code": "123456"
  }'

Refresh Access Token

Rotate the httpOnly refresh cookie and issue a new httpOnly access cookie.

bash
curl -X POST https://app.pacspace.io/dashboard/auth/refresh-token \
  -b pacspace-dashboard-cookies.txt \
  -c pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1"

Logout

Revoke the current httpOnly refresh cookie and clear the browser session.

bash
curl -X POST https://app.pacspace.io/dashboard/auth/logout \
  -b pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1"

The refresh token is read from the httpOnly cookie, not from JSON.


Verify Email

bash
curl "https://app.pacspace.io/dashboard/auth/verify?token=VERIFICATION_TOKEN"

Resend Verification Email

bash
curl -X POST https://app.pacspace.io/dashboard/auth/resend-verification-email \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@company.com"
  }'

Password Recovery

Request Password Reset

bash
curl -X POST https://app.pacspace.io/dashboard/auth/request-password-reset \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@company.com"
  }'

Reset Password

bash
curl -X POST https://app.pacspace.io/dashboard/auth/reset-password \
  -H "Content-Type: application/json" \
  -d '{
    "token": "RESET_TOKEN",
    "password": "NewSecurePass1"
  }'

Change Password (Authenticated)

bash
curl -X POST https://app.pacspace.io/dashboard/auth/change-password \
  -b pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "currentPassword": "SecurePass1",
    "newPassword": "EvenStronger2"
  }'

Change Email

Request an email change (verification sent to the new address):

bash
curl -X POST https://app.pacspace.io/dashboard/auth/change-email \
  -b pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "newEmail": "new@company.com",
    "currentPassword": "SecurePass1"
  }'

Confirm the change:

bash
curl "https://app.pacspace.io/dashboard/auth/verify-email-change?token=EMAIL_CHANGE_TOKEN"

Multi-Factor Authentication (MFA)

1) Generate Setup Secret

bash
curl -X POST https://app.pacspace.io/dashboard/auth/mfa/setup \
  -b pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1"

Returns setup material (shown once), including secret, otpauthUrl, and recoveryCodes.

2) Enable MFA

bash
curl -X POST https://app.pacspace.io/dashboard/auth/mfa/enable \
  -b pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "code": "123456"
  }'

3) Disable MFA

bash
curl -X POST https://app.pacspace.io/dashboard/auth/mfa/disable \
  -b pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "currentPassword": "SecurePass1",
    "code": "123456"
  }'

User Profile And Preferences

Get Profile

bash
curl https://app.pacspace.io/dashboard/auth/profile \
  -b pacspace-dashboard-cookies.txt

Update Preferred Environment

bash
curl -X PATCH https://app.pacspace.io/dashboard/auth/preferences \
  -b pacspace-dashboard-cookies.txt \
  -H "X-Pacspace-CSRF: 1" \
  -H "Content-Type: application/json" \
  -d '{
    "preferredEnvironment": "sandbox"
  }'

Endpoints Summary

EndpointMethodAuth
/dashboard/auth/registerPOSTPublic
/dashboard/auth/loginPOSTPublic
/dashboard/auth/login/mfa-verifyPOSTPublic
/dashboard/auth/refresh-tokenPOSTPublic
/dashboard/auth/logoutPOSTSession cookie
/dashboard/auth/verifyGETPublic
/dashboard/auth/resend-verification-emailPOSTPublic
/dashboard/auth/request-password-resetPOSTPublic
/dashboard/auth/reset-passwordPOSTPublic
/dashboard/auth/change-passwordPOSTSession cookie
/dashboard/auth/change-emailPOSTSession cookie
/dashboard/auth/verify-email-changeGETPublic
/dashboard/auth/mfa/setupPOSTSession cookie
/dashboard/auth/mfa/enablePOSTSession cookie
/dashboard/auth/mfa/disablePOSTSession cookie
/dashboard/auth/profileGETSession cookie
/dashboard/auth/preferencesPATCHSession cookie