Skip to main content
POST
User login
Deprecated — This endpoint requires partners to integrate the Privy SDK directly in their frontend or mobile app, which is not the recommended integration path.Use Send login code and Verify login code instead — a backend-only email OTP login with no SDK dependency, entirely from your own servers.
Requires X-Api-Key and X-Api-Secret headers. See Authentication for details.
Call this endpoint after the user authenticates in your app via Privy (email OTP, wallet, etc.). Pass the resulting privyToken to Qash to receive a QASH accessToken and refreshToken.
  • If the user was pre-registered with POST /users, their Privy account is automatically linked on first login.
  • The accessToken expires in ~24 hours (configurable server-side via JWT_EXPIRES_IN). Use refreshToken (valid 30 days) to obtain a new one.
  • The businessId in the response is derived server-side from your API key — never send it from the client.
  • isNewUser: true indicates this is the user’s first login.

Authorizations

X-Api-Key
string
header
required

Partner API key. Generated from Qash Dashboard → Settings → API Keys.

X-Api-Secret
string
header
required

Partner API secret. Shown once at creation — store it securely.

Body

application/json

Privy token from the user's authentication session.

privyToken
string
required

JWT issued by Privy after the user authenticates in your app.

Minimum string length: 1
Example:

"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9..."

Response

User authenticated successfully.

success
boolean
required
Example:

true

user
object
required
accessToken
string
required

Short-lived JWT (~1 hour) for authenticated user requests.

refreshToken
string
required

Long-lived JWT (30 days) to obtain new access tokens.

isNewUser
boolean
required

true if this is the user's first login.

businessId
string<uuid>
required

Business profile ID of the partner, derived server-side from the API key.