Authentication request with token and type. authType defaults to "user" if not specified.
/
Verify JWT token
PERS-api docs (2.0.7)
Download OpenAPI description
Overview
Languages
Servers
Mock server
https://docs.pers.ninja/_mock/swagger/
https://explorins-loyalty.ngrok.io/
https://api.pers.ninja/v2/
Request
Universal token creation with consistent token-in-body pattern:
USER AUTHENTICATION:
- Header: X-API-Key (tenant identification)
- Body: { authToken: "jwt_from_provider", authType?: "user" }
- Returns: User session with PERS JWT tokens
ADMIN AUTHENTICATION:
- Header: X-API-Key (tenant identification)
- Body: { authToken: "firebase_jwt", authType: "tenant" }
- Returns: Admin session with PERS JWT tokens
All authentication now uses consistent API key + token-in-body pattern.
Security
projectKey
Authentication token from WebAuthn provider (e.g., PERS Signer API)
Example: "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9..."
Authentication context type - explicitly declares intent for admin vs user auth
Enum"user""business""tenant""system""external"
if Tenant settings allowJWTForUnauthenticatedUsers is true, this field contains data to create user and setup unauthenticated user session instead of token verification. Useful for sandbox or trial modes. For now it is only used to create unauthenticated users.
Example: {"someKey":"someValue"}
- Mock serverhttps://docs.pers.ninja/_mock/swagger/auth/token
- https://explorins-loyalty.ngrok.io/auth/token
- https://api.pers.ninja/v2/auth/token
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.pers.ninja/_mock/swagger/auth/token \
-H 'Content-Type: application/json' \
-H 'x-project-key: YOUR_API_KEY_HERE' \
-d '{
"authToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFZERTQSJ9...",
"authType": "user",
"rawLoginData": {
"someKey": "someValue"
}
}'Response
application/json
{ "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRJZCI6IjEiLCJpYXQiOjE2MjYxNzUwNzksImV4cCI6MTYyNjE3NTI3OX0.5w8A6t7b5lBx8D3FmLwJQgJ9z1D9c9Vz7A3f7BvzH2A", "accessToken": "string" }
- Mock serverhttps://docs.pers.ninja/_mock/swagger/auth/refresh
- https://explorins-loyalty.ngrok.io/auth/refresh
- https://api.pers.ninja/v2/auth/refresh
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.pers.ninja/_mock/swagger/auth/refresh \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-H 'x-project-key: YOUR_API_KEY_HERE' \
-d '{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRJZCI6IjEiLCJpYXQiOjE2MjYxNzUwNzksImV4cCI6MTYyNjE3NTI3OX0.5w8A6t7b5lBx8D3FmLwJQgJ9z1D9c9Vz7A3f7BvzH2A"
}'Response
application/json
{ "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnRJZCI6IjEiLCJpYXQiOjE2MjYxNzUwNzksImV4cCI6MTYyNjE3NTI3OX0.5w8A6t7b5lBx8D3FmLwJQgJ9z1D9c9Vz7A3f7BvzH2A", "accessToken": "string" }
- Mock serverhttps://docs.pers.ninja/_mock/swagger/auth/verify
- https://explorins-loyalty.ngrok.io/auth/verify
- https://api.pers.ninja/v2/auth/verify
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.pers.ninja/_mock/swagger/auth/verify \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-H 'x-project-key: YOUR_API_KEY_HERE' \
-d '{
"authToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
}'Response
application/json
{ "valid": true, "payload": null, "errorMessage": "Invalid token" }