Authentication

The API uses OAuth 2.0 Bearer tokens by our OAuth 2.0 authorization server (RS256-signed JWTs).

The API uses OAuth 2.0 Bearer tokens by our OAuth 2.0 authorization server (RS256-signed JWTs). Every protected endpoint expects an Authorization: Bearer <bearer-token> header.

Ways to obtain a token

  1. Password loginPOST /login with a JSON body of email, password and rememberMe. Returns token (a Passport access token) plus the user company context, location count and branding theme. (Login)
  2. SSO — JumpCloud (OIDC) — browser flow: Authorize redirect, then JumpCloud, then callback, then GET /auth/sso/exchange redeems the one-time code for a token. (SSO — Review Management login (OAuth 2.0) / SSO — JumpCloud handoff)
  3. Discover (optional, pre-login)POST /auth/discover with an email returns whether that account supports password login, SSO, or both — without revealing whether the email exists (no account enumeration). (Discover auth methods)

Using the token

Send it on every protected call:

Authorization: Bearer <bearer-token>

Protected route groups (all behind the authentication Passport guard):

PrefixWhoToken context
/admin/*Platform super-adminadmin user
/partner/*Partner-admin (hipages service / sales teams)agency / partner-level access_token
/account/*Account / location users + current-user self-service (the dashboards/widgets formerly under /brand/*, renamed to /account/*)account-level access_token, scoped to its partner
/sso/*OAuth client managementsuper-admin

Account-owner impersonation token

A partner can mint a Passport personal access token issued AS an account owner via POST /partner/account-owner/token (formerly /partner/brand-owner/token). The collection stores it in the impersonation token for requests that must run in the account's own context.

Token lifecycle

  • Access tokens and personal access tokens expire 1 day after issue.
  • Refresh tokens are valid for 30 days.
  • Verify: GET /verify-token (Verify token) echoes the authenticated user when the token is still valid.
  • Revoke / logout: GET /logout (Logout) deletes the current token server-side.

Public vs protected

Only a small set of endpoints are public (No Auth): login, email-OTP verify/resend, the signup wizard, auth discovery, SSO redirect/callback/exchange, pre-login branding and reference lookups (plans, feature-options, countries/states/cities, white-label resolver), campaign tracking + QR landing pages, and provider webhooks (Mandrill, Bandwidth, ReviewData — each verified by its own signature or token). Every state-changing (write) endpoint requires a valid OAuth bearer token.

Prerequisites

  • A bearer token in the Authorization header. Any endpoint that needs no token says so on its own page.
  • The id of each record the call targets. Every endpoint page lists the ids it needs.

Errors

StatusMeaning
401The bearer token is missing, expired or invalid
403The token is valid but the record sits outside your account
422The request failed validation — the response names the fields
500Unexpected server error

Individual endpoints may return more; each page lists its own.

Sections

SectionDescription
SSO — Review Management login (OAuth 2.0)Standard OAuth Authorization Code grant.
SSO — JumpCloud handoffHandoff flow: you redirect the user, Review Management handles the JumpCloud round-trip, and the user lands signed-in on the frontend.

Endpoints

MethodEndpointDescription
POSTLoginAuthenticates an email/password credential and, on success, issues a Passport bearer token plus the user, company, theme, white-label and (for account companies) plan context.
GETVerify tokenValidate the supplied Passport bearer token and restores the SPA session: returns the authenticated user, their company, theme, white-label and (for account companies) plan context.
GETLogoutRevoke the caller's current Passport access token and records the logout: deletes the active token, stamps logout_time on the latest RsAuthEvent for the user, and writes an AUTH_LOGOUT audit log.
POSTVerify email OTPVerify the email OTP previously sent for a forgot-password / change-password / signup flow.
POSTResend email OTPResend an email OTP for a change-password / forgot-password / signup flow.
POSTReset passwordReset the authenticated user's password to the supplied value, revokes all of their existing tokens, and returns a fresh access token.
POSTChange passwordStart an authenticated password change: verifies the current password, then emails a change_password OTP rather than changing the password directly.