{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cubi-estate/json-schema/cubi-estate-admin-agent-consent-request-schema.json",
  "title": "AdminAgentConsentRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cubi-estate-admin-api-openapi.yml#/components/schemas/AdminAgentConsentRequest",
  "properties": {
    "phone_e164": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Phone E164",
      "description": "Agent phone in E.164 (+CCXXXXXX). At least one of phone_e164/email required."
    },
    "email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Email",
      "description": "Agent email. Will be lowercased server-side."
    },
    "source_notes": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Notes",
      "description": "Free-text audit trail (e.g. 'agreed via phone call 2026-05-12')."
    },
    "wa_optin": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Wa Optin",
      "description": "Set true to record the agent's opt-in to WhatsApp lead handoff (mig 155). Stamps wa_optin_at + wa_id.",
      "default": false
    },
    "wa_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Wa Id",
      "description": "Reachable WhatsApp id (digits, no '+'). Defaults to phone_e164 digits when wa_optin is set and this is omitted."
    }
  },
  "type": "object"
}