Authentication request with token and type. authType defaults to "user" if not specified.
- Authentication & Authorization
Create authentication token (Simplified)
Refresh authentication tokens
Authentication & Authoriz...
PERS-api docs (2.0.5)
Download OpenAPI description
Overview
Languages
Servers
Mock server
https://docs.pers.ninja/_mock/swagger/
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..."
- Mock serverhttps://docs.pers.ninja/_mock/swagger/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"
  }'Response
application/json
{ "accessToken": "string", "refreshToken": "string" }
Bodyapplication/jsonrequired
JWT access token this token is used to authenticate the user, by default it expires in 15 minutes, and it should be sent in the Authorization header as Bearer token.
- Mock serverhttps://docs.pers.ninja/_mock/swagger/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 '{
    "accessToken": "string",
    "refreshToken": "string"
  }'Response
application/json
{ "accessToken": "string", "refreshToken": "string" }