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
- Password login —
POST /loginwith a JSON body of email, password and rememberMe. Returnstoken(a Passport access token) plus the user company context, location count and branding theme. (Login) - SSO — JumpCloud (OIDC) — browser flow: Authorize redirect, then JumpCloud, then callback, then
GET /auth/sso/exchangeredeems the one-time code for a token. (SSO — Review Management login (OAuth 2.0) / SSO — JumpCloud handoff) - Discover (optional, pre-login) —
POST /auth/discoverwith 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):
| Prefix | Who | Token context |
|---|---|---|
/admin/* | Platform super-admin | admin 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 management | super-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
Authorizationheader. 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
| Status | Meaning |
|---|---|
401 | The bearer token is missing, expired or invalid |
403 | The token is valid but the record sits outside your account |
422 | The request failed validation — the response names the fields |
500 | Unexpected server error |
Individual endpoints may return more; each page lists its own.
Sections
| Section | Description |
|---|---|
| SSO — Review Management login (OAuth 2.0) | Standard OAuth Authorization Code grant. |
| SSO — JumpCloud handoff | Handoff flow: you redirect the user, Review Management handles the JumpCloud round-trip, and the user lands signed-in on the frontend. |
Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST | Login | Authenticates 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. |
GET | Verify token | Validate 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. |
GET | Logout | Revoke 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. |
POST | Verify email OTP | Verify the email OTP previously sent for a forgot-password / change-password / signup flow. |
POST | Resend email OTP | Resend an email OTP for a change-password / forgot-password / signup flow. |
POST | Reset password | Reset the authenticated user's password to the supplied value, revokes all of their existing tokens, and returns a fresh access token. |
POST | Change password | Start an authenticated password change: verifies the current password, then emails a change_password OTP rather than changing the password directly. |
