{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/klokin-io/json-schema/klokin-io-api-key-schema.json",
  "title": "ApiKey",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/klokin-io-openapi.yml#/components/schemas/ApiKey",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "keyPrefix": {
      "type": "string",
      "description": "First characters of the key, e.g. klkn_ab12"
    },
    "permissions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "authSource": {
      "type": "string",
      "enum": [
        "manual",
        "mcp"
      ]
    },
    "lastUsedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "isActive": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}