{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-api-key-schema.json",
  "title": "ApiKey",
  "description": "An API key (masked -- full key is only returned at creation time).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-api-keys-api-openapi.yml#/components/schemas/ApiKey",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Internal UUID of the key record."
    },
    "key_id": {
      "type": "string",
      "description": "Public key identifier prefix (e.g. `tk_a1b2c3`)."
    },
    "key_prefix": {
      "type": "string",
      "description": "First few characters of the key for identification."
    },
    "key_type": {
      "type": "string",
      "enum": [
        "standard",
        "test",
        "access_key"
      ],
      "description": "Type of the API key. `standard` keys work on the production API,\n`test` keys work on the sandbox API, `access_key` keys work on both.\n"
    },
    "name": {
      "type": "string",
      "description": "Human-readable name for the key."
    },
    "active": {
      "type": "boolean",
      "description": "Whether the key is active (false if revoked)."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "last_used_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Timestamp of the last time this key was used."
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When this key stops authenticating. `null` means it **never expires** — it stays\nvalid until someone revokes it by hand.\n\nExpiry is enforced on every authentication path, so a key past this instant is\n`401` everywhere, with no way to extend it: an expired key is replaced, not\nrenewed.\n\n**A key created without an explicit expiry choice gets 90 days.** That default\nis applied when the key is minted, so this field is the only place it is\nvisible — read it on every key, including ones you did not create.\n"
    },
    "rate_limit_requests": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Maximum requests allowed per rate limit window."
    },
    "rate_limit_window_sec": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Rate limit window duration in seconds."
    }
  }
}