{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zvid-io/json-schema/zvid-io-api-key-list-schema.json",
  "title": "ApiKeyList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/zvid-io-api-keys-api-openapi.yml#/components/schemas/ApiKeyList",
  "type": "object",
  "properties": {
    "apiKeys": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApiKey"
      }
    }
  },
  "required": [
    "apiKeys"
  ],
  "additionalProperties": false,
  "$defs": {
    "ApiKey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "keyPrefix": {
          "type": "string",
          "description": "Stored prefix of the key (first characters, used for identification)"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "lastUsedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "requestsCount": {
          "type": "integer",
          "description": "Total number of requests made with this key"
        },
        "isActive": {
          "type": "boolean",
          "description": "Whether the key is active (this list only returns active keys)"
        }
      },
      "required": [
        "id",
        "name",
        "keyPrefix",
        "createdAt",
        "requestsCount",
        "isActive"
      ],
      "additionalProperties": false
    }
  }
}