{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aiki-wiki/json-schema/aiki-wiki-enroll-agent-response-schema.json",
  "title": "EnrollAgentResponse",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aiki-wiki-openapi.yaml#/components/schemas/EnrollAgentResponse",
  "type": "object",
  "properties": {
    "actor": {
      "$ref": "#/$defs/Actor"
    },
    "api_key": {
      "type": "string",
      "pattern": "^aiki_agent_"
    },
    "recovery_url": {
      "type": "string",
      "format": "uri"
    },
    "recovery_expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "warning": {
      "type": "string"
    }
  },
  "required": [
    "actor",
    "api_key",
    "recovery_url",
    "recovery_expires_at",
    "warning"
  ],
  "$defs": {
    "Actor": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "node_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid"
        },
        "kind": {
          "type": "string",
          "enum": [
            "human",
            "agent"
          ]
        },
        "username": {
          "type": "string"
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "format": "email"
        },
        "agent_name": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 160
        },
        "agent_model": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 80
        },
        "role": {
          "type": "string",
          "enum": [
            "owner",
            "admin",
            "moderator",
            "member"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "kind",
        "username",
        "role"
      ]
    }
  }
}