# Create new system JWT token (Admin)

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.

Endpoint: POST /api-keys
Version: 2.0.53
Security: authJWT, projectKey

## Request fields (application/json):

  - `name` (string, required)
    name of the key

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

## Response 200 fields (application/json):

  - `id` (string, required)
    Unique identifier for the API key
    Example: f47ac10b-58cc-4372-a567-0e02b2c3d479

  - `type` (string, required)
    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", "TRANSACTION_JWT_ACCESS_TOKEN", "WEBHOOK_OUTBOUND_JWT", "ONE_TIME_TOKEN", "TENANT_ADMIN_JWT"

  - `name` (object)
    Human-readable name for the API key
    Example: JWT Token (Mainnet) - 2025-11-22

  - `createdAt` (string, required)
    Creation timestamp
    Example: 2025-11-22T10:30:00.000Z

  - `shortenedPrivateKey` (string, required)
    Token preview for dashboard identification (first 8 + last 4 characters)
    Example: eyJhbGci...xMjM

  - `expiresAt` (object)
    Expiration timestamp (null = no expiry)
    Example: 2026-11-22T10:30:00.000Z

  - `isRevoked` (boolean, required)
    Indicates if the API key has been revoked
    Example: false

  - `lastUsedAt` (object)
    Last time the API key was used for authentication
    Example: 2025-11-24T14:30:00.000Z

  - `entityId` (object)
    Entity ID this key is scoped to (e.g. businessId for BUSINESS_SYSTEM_JWT)
    Example: biz_abc123

  - `privateKey` (string, required)
    Full private key/token - STORE SECURELY! Only returned once during creation
    Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

## Response 201 fields (application/json):

  - `id` (string, required)
    Unique identifier for the API key
    Example: f47ac10b-58cc-4372-a567-0e02b2c3d479

  - `type` (string, required)
    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", "TRANSACTION_JWT_ACCESS_TOKEN", "WEBHOOK_OUTBOUND_JWT", "ONE_TIME_TOKEN", "TENANT_ADMIN_JWT"

  - `name` (object)
    Human-readable name for the API key
    Example: JWT Token (Mainnet) - 2025-11-22

  - `createdAt` (string, required)
    Creation timestamp
    Example: 2025-11-22T10:30:00.000Z

  - `shortenedPrivateKey` (string, required)
    Token preview for dashboard identification (first 8 + last 4 characters)
    Example: eyJhbGci...xMjM

  - `expiresAt` (object)
    Expiration timestamp (null = no expiry)
    Example: 2026-11-22T10:30:00.000Z

  - `isRevoked` (boolean, required)
    Indicates if the API key has been revoked
    Example: false

  - `lastUsedAt` (object)
    Last time the API key was used for authentication
    Example: 2025-11-24T14:30:00.000Z

  - `entityId` (object)
    Entity ID this key is scoped to (e.g. businessId for BUSINESS_SYSTEM_JWT)
    Example: biz_abc123

  - `privateKey` (string, required)
    Full private key/token - STORE SECURELY! Only returned once during creation
    Example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

