Skip to content

Verify JWT token

Request

Verify JWT tokens with automatic issuer detection:

  • Decodes JWT to extract issuer claim
  • PERS tokens: Verified internally
  • External tokens: Future support planned
  • Standards-compliant JWT verification
Security
projectKey
Bodyapplication/jsonrequired

Token verification request

authTokenstringrequired

JWT token to verify (any issuer)

Example:"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
curl -i -X POST \
  https://docs.pers.ninja/_mock/swagger/auth/verify \
  -H 'Content-Type: application/json' \
  -H 'x-project-key: YOUR_API_KEY_HERE' \
  -d '{
    "authToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
  }'

Responses

Token verification completed (check valid field for result)

Bodyapplication/json
validbooleanrequired

Whether the token verification was successful

Example:true
payloadobject

Decoded payload from the token if verification is successful

Example:null
tenantIdobjectrequired

Error message if token verification fails

Example:"Invalid token"
identifierEmailobject

Universal identifier email for the authenticated entity

Example:"user-c8e619a4f7f8419d94320d403213ef49@id.pers.ninja"
errorMessagestring

Error message if token verification fails

Example:"Invalid token"
errorCodestring

Structured error code for programmatic handling

Enum:"TOKEN_EXPIRED""REFRESH_TOKEN_EXPIRED""REFRESH_TOKEN_REVOKED""INVALID_TOKEN""TOKEN_REVOKED"
Example:"REFRESH_TOKEN_EXPIRED"
Response
{ "valid": true, "payload": null, "tenantId": "Invalid token", "identifierEmail": "user-c8e619a4f7f8419d94320d403213ef49@id.pers.ninja", "errorMessage": "Invalid token", "errorCode": "REFRESH_TOKEN_EXPIRED" }