{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/agentrux-com/json-schema/agentrux-com-kratos-webhook-payload-schema.json",
  "title": "KratosWebhookPayload",
  "description": "Kratos の body template で AgenTrux に送られる JSON 形 (Phase 1.3 拡張).",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/agentrux-com-openapi.json#/components/schemas/KratosWebhookPayload",
  "properties": {
    "flow": {
      "type": "string",
      "enum": [
        "registration",
        "login",
        "settings",
        "verification"
      ],
      "title": "Flow",
      "description": "webhook の種別 (registration|login)"
    },
    "identity_id": {
      "type": "string",
      "maxLength": 128,
      "minLength": 8,
      "title": "Identity Id"
    },
    "flow_id": {
      "type": "string",
      "maxLength": 128,
      "minLength": 8,
      "title": "Flow Id"
    },
    "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
    },
    "schema_id": {
      "type": "string",
      "maxLength": 64,
      "minLength": 1,
      "title": "Schema Id"
    },
    "idp": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "google",
            "entraid",
            "apple",
            "github"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Idp"
    },
    "subject": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Subject"
    },
    "email_verified": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Email Verified"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Name"
    },
    "phone": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 32,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Phone"
    }
  },
  "type": "object",
  "required": [
    "flow",
    "identity_id",
    "flow_id",
    "email",
    "schema_id"
  ]
}