{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/namiq-io/json-schema/namiq-io-agent-key-request-schema.json",
  "title": "AgentKeyRequest",
  "x-generated": "2026-11-19",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/namiq-io-openapi.yml#/components/schemas/AgentKeyRequest",
  "type": "object",
  "required": [
    "terms",
    "agent",
    "principal",
    "purpose",
    "consent"
  ],
  "additionalProperties": true,
  "properties": {
    "terms": {
      "type": "object",
      "required": [
        "version",
        "accepted"
      ],
      "properties": {
        "version": {
          "type": "string",
          "description": "The current terms version, exactly as published.",
          "const": "lattice-beta-2026-11-09.1"
        },
        "accepted": {
          "type": "boolean",
          "const": true,
          "description": "Explicit acceptance of the beta terms on the principal's behalf."
        }
      }
    },
    "agent": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "Who is calling.",
          "minLength": 2,
          "maxLength": 100
        },
        "version": {
          "type": "string",
          "description": "The agent's version.",
          "maxLength": 64
        },
        "operator": {
          "type": "string",
          "description": "The organisation that runs the agent.",
          "maxLength": 140
        }
      }
    },
    "principal": {
      "type": "object",
      "required": [
        "name",
        "position",
        "company",
        "email"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The person the key is for.",
          "minLength": 2,
          "maxLength": 140
        },
        "position": {
          "type": "string",
          "description": "Their position.",
          "minLength": 2,
          "maxLength": 140
        },
        "company": {
          "type": "string",
          "description": "Their company.",
          "minLength": 2,
          "maxLength": 140
        },
        "email": {
          "type": "string",
          "description": "A mailbox they read. The key, a confirmation link and any delivery failure go here.",
          "format": "email",
          "maxLength": 254
        }
      }
    },
    "purpose": {
      "type": "string",
      "description": "What the key will be used for, in a sentence or two.",
      "minLength": 20,
      "maxLength": 1500
    },
    "consent": {
      "type": "boolean",
      "const": true,
      "description": "The principal agrees to one confirmation email at principal.email."
    }
  }
}