Log In Visitor
Signs a visitor in with email and password and returns an access token and a refresh token. Use the access token to call the visitor endpoints.
POST
/v1/auth/loginAuthentication
Public key
?key=pk_…Public key in the key query parameter. No OAuth, no secret.
Edge cache: no-store
Query Parameters
keystringThe site's public key (pk_…). It selects the account. Safe to ship to the browser.
Body Parameters
emailstringThe email the visitor registered with.
passwordstringThe visitor's password (up to 20 characters).
Responses
200Success
application/jsontitlestringhideToastbooleantypestringvariantstringmessagestringaccessTokenstringrefreshTokenstringexpiresInnumberErrors
401Wrong email or password (message: "Invalid credentials", the same answer for an unknown email), a body that fails validation, or a missing or invalid public key. Error bodies have type: "error", message and an inner status.403The Panda account is not active. The body also carries code: "TENANT_INACTIVE".Notes
- Visitors only sign in to the site whose key you send; an account on another Panda site does not work here.
- A successful login is added to the contact's activity feed in the owner's CRM.
- Tokens:
accessTokenlasts 1 hour (expiresInis in seconds).refreshTokenlasts 60 days and renews every time you refresh. Send the access token asAuthorization: Bearer, never as a cookie.
Request
curl --request POST \--url "https://api.pandaidx.com/v1/auth/login?key={{public_key}}" \--header "Content-Type: application/json" \--data '{"email":"alex.example@example.com","password":"ChangeMe-Example-1"}'
Response200 OK
{"title": "User Logged In","hideToast": false,"type": "success","variant": "default","message": "User Logged In","accessToken": "v1.example-access-token","refreshToken": "example-refresh-token","expiresIn": 3600}