Skip to content

Dashboard Authentication

Register, log in, verify email, and reset passwords for your PacSpace account.

All dashboard endpoints live under https://balance-api.pacspace.io/dashboard/auth. These routes handle account creation, login, email verification, and password resets.


Register

Create a new PacSpace account. New accounts start on the Free plan (10 verified deltas/month) with an automatically activated Sandbox environment. This is a public endpoint — no authentication required.

bash
curl -X POST https://balance-api.pacspace.io/dashboard/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@company.com",
    "password": "your-secure-password",
    "firstName": "Jane",
    "lastName": "Doe",
    "companyName": "Acme Inc"
  }'

Response 201 Created

json
{
  "statusCode": 201,
  "message": "Registration successful. Please check your email to verify your account.",
  "data": {
    "id": "usr_abc123",
    "email": "you@company.com",
    "name": "Jane Doe",
    "isVerified": false
  }
}

A verification email is sent automatically. The account is inactive until the email is verified.


Login

Authenticate with your email and password. Returns a JWT access token.

bash
curl -X POST https://balance-api.pacspace.io/dashboard/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@company.com",
    "password": "your-secure-password"
  }'

Response 200 OK

json
{
  "statusCode": 200,
  "data": {
    "id": "usr_abc123",
    "email": "you@company.com",
    "name": "Jane Doe",
    "role": "owner",
    "isVerified": true,
    "token": "eyJhbGciOiJIUzI1NiIs..."
  }
}

Use the token in subsequent dashboard requests:

bash
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

Verify Email

Confirm your email address using the token from the verification email. This is a GET request — typically triggered by clicking the link in the email.

bash
curl https://balance-api.pacspace.io/dashboard/auth/verify?token=VERIFICATION_TOKEN

Response 200 OK

json
{
  "statusCode": 200,
  "message": "Email verified successfully."
}

Resend Verification Email

Request a new verification email if the original expired or was not received.

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

Response 200 OK

json
{
  "statusCode": 200,
  "message": "Verification email sent."
}

Request Password Reset

Send a password reset link to the account email.

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

Response 200 OK

json
{
  "statusCode": 200,
  "message": "If that email exists, a reset link has been sent."
}

The response is intentionally vague to prevent email enumeration.


Reset Password

Set a new password using the token from the reset email.

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

Response 200 OK

json
{
  "statusCode": 200,
  "message": "Password has been reset successfully."
}

Change Password

Change the currently authenticated user's password. Requires a valid JWT.

bash
curl -X POST https://balance-api.pacspace.io/dashboard/auth/change-password \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "currentPassword": "your-current-password",
    "newPassword": "your-new-secure-password"
  }'

Response 200 OK

json
{
  "statusCode": 200,
  "message": "Password changed successfully."
}

Password Requirements:

  • 8–32 characters
  • At least one uppercase letter, one lowercase letter, and one number
  • Must be different from your current password

Get Profile

Retrieve the currently authenticated user's profile. Requires a valid JWT.

bash
curl https://balance-api.pacspace.io/dashboard/auth/profile \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Response 200 OK

json
{
  "statusCode": 200,
  "data": {
    "id": "usr_abc123",
    "email": "you@company.com",
    "firstName": "Jane",
    "lastName": "Doe",
    "tenantId": "tnt_xyz789",
    "emailVerified": true,
    "createdAt": "2025-01-15T10:30:00.000Z"
  }
}

Authentication Summary

EndpointMethodAuth Required
/dashboard/auth/registerPOSTNo
/dashboard/auth/loginPOSTNo
/dashboard/auth/verifyGETNo (token in query)
/dashboard/auth/resend-verification-emailPOSTNo
/dashboard/auth/request-password-resetPOSTNo
/dashboard/auth/reset-passwordPOSTNo (token in body)
/dashboard/auth/change-passwordPOSTJWT
/dashboard/auth/profileGETJWT