{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rightmoney-com/json-schema/rightmoney-com-confirm-body-schema.json",
  "title": "ConfirmBody",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rightmoney-com-openapi.json#/components/schemas/ConfirmBody",
  "type": "object",
  "required": [
    "userId"
  ],
  "properties": {
    "userId": {
      "type": "string",
      "format": "uuid",
      "description": "The user's unique identifier"
    },
    "classifications": {
      "type": "array",
      "description": "Full agent-side classifications. Use this when the agent classified merchants from GET /api/onboarding/agent/transactions.",
      "items": {
        "type": "object",
        "required": [
          "pattern",
          "bucket"
        ],
        "properties": {
          "pattern": {
            "type": "string",
            "description": "Merchant pattern (exact match)"
          },
          "bucket": {
            "type": "string",
            "enum": [
              "bills",
              "lifestyle",
              "income",
              "ignore"
            ]
          },
          "is_recurring": {
            "type": "boolean"
          },
          "estimated_frequency": {
            "type": "string",
            "enum": [
              "monthly",
              "biweekly",
              "weekly",
              "quarterly",
              "semi-annual",
              "annual",
              "one-time"
            ]
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "bill_group": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "housing",
              "utilities",
              "insurance",
              "subscriptions",
              "transportation",
              "debt",
              "medical",
              "childcare",
              "education",
              null
            ]
          }
        }
      }
    },
    "changes": {
      "type": "array",
      "description": "Optional adjustments to existing backend classifications. Omit to confirm all as-is.",
      "items": {
        "type": "object",
        "required": [
          "merchant_pattern",
          "new_bucket"
        ],
        "properties": {
          "merchant_pattern": {
            "type": "string",
            "description": "The merchant pattern to reclassify (e.g. \"SPOTIFY\")"
          },
          "new_bucket": {
            "type": "string",
            "enum": [
              "bills",
              "lifestyle",
              "income",
              "ignore"
            ],
            "description": "The new bucket to assign"
          }
        }
      }
    },
    "auto_confirm": {
      "type": "boolean",
      "default": false,
      "description": "Confirm only classifications with confidence >= 0.85 plus merchants named in changes; the rest stay unconfirmed and are returned as needs_review (lowest confidence first, up to 15). Default false confirms everything."
    }
  }
}