{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-client-credential-schema.json",
  "title": "ClientCredential",
  "description": "A credential attached to a client. Secret material (HMAC secrets, private keys) is redacted from `data`.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-clients-api-openapi.yml#/components/schemas/ClientCredential",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "client_id": {
      "type": "string",
      "format": "uuid",
      "description": "The client this credential belongs to."
    },
    "tenant_id": {
      "type": "string",
      "format": "uuid"
    },
    "kind": {
      "type": "string",
      "enum": [
        "ip",
        "mtls_thumbprint",
        "signature_hmac",
        "signature_ed25519",
        "machine_id",
        "workload_identity"
      ],
      "description": "The credential kind. Creatable in v1: `ip` and `mtls_thumbprint`."
    },
    "label": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable label."
    },
    "data": {
      "type": "object",
      "additionalProperties": true,
      "description": "Kind-specific data. Secret fields (`secret_ct`, `private_key_pem`) are stripped from responses."
    },
    "enabled": {
      "type": "boolean"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Expiry timestamp (set automatically for issued mTLS certificates)."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "last_matched_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When this credential last matched an incoming request."
    }
  }
}