Skip to content

Create new system JWT token (Admin)

Request

Create a new long-lived system JWT for app integration (M2M). Provide businessId to create a business-scoped token (BUSINESS_SYSTEM_JWT) for server-to-server integrations. Omit businessId to create a tenant-scoped token (TENANT_SYSTEM_JWT). Store the returned token securely - it cannot be retrieved again.

Security
authJWT or projectKey
Bodyapplication/jsonrequired
namestringrequired

name of the key

businessIdstring

Business ID to generate a business-scoped system JWT for app integration (M2M). If omitted, generates a tenant-scoped system JWT.

curl -i -X POST \
  https://docs.pers.ninja/_mock/swagger/api-keys \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "businessId": "string"
  }'

Responses

JWT token created successfully

Bodyapplication/json
idstringrequired

Unique identifier for the API key

Example:"f47ac10b-58cc-4372-a567-0e02b2c3d479"
typestringrequired

Type of API key

Enum:"TENANT_SYSTEM_JWT""ADMIN_JWT_ACCESS_TOKEN""ADMIN_JWT_REFRESH_TOKEN""USER_JWT_ACCESS_TOKEN""USER_JWT_REFRESH_TOKEN""BUSINESS_JWT_ACCESS_TOKEN""BUSINESS_JWT_REFRESH_TOKEN""BUSINESS_SYSTEM_JWT""BLOCKCHAIN_WRITER_JWT""BLOCKCHAIN_READER_JWT"
Example:"TENANT_SYSTEM_JWT"
nameobject or null

Human-readable name for the API key

Example:"JWT Token (Mainnet) - 2025-11-22"
createdAtstring, (date-time)required

Creation timestamp

Example:"2025-11-22T10:30:00.000Z"
shortenedPrivateKeystring, <= 20 charactersrequired

Token preview for dashboard identification (first 8 + last 4 characters)

Example:"eyJhbGci...xMjM"
expiresAtobject or null

Expiration timestamp (null = no expiry)

Example:"2026-11-22T10:30:00.000Z"
isRevokedbooleanrequired

Indicates if the API key has been revoked

Example:false
lastUsedAtobject or null

Last time the API key was used for authentication

Example:"2025-11-24T14:30:00.000Z"
entityIdobject or null

Entity ID this key is scoped to (e.g. businessId for BUSINESS_SYSTEM_JWT)

Example:"biz_abc123"
privateKeystringrequired

Full private key/token - STORE SECURELY! Only returned once during creation

Example:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_ad
Response
{ "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "type": "TENANT_SYSTEM_JWT", "name": "JWT Token (Mainnet) - 2025-11-22", "createdAt": "2025-11-22T10:30:00.000Z", "shortenedPrivateKey": "eyJhbGci...xMjM", "expiresAt": "2026-11-22T10:30:00.000Z", "isRevoked": false, "lastUsedAt": "2025-11-24T14:30:00.000Z", "entityId": "biz_abc123", "privateKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c" }