{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aidelly-ai/json-schema/aidelly-ai-white-label-config-envelope-schema.json",
  "title": "WhiteLabelConfigEnvelope",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aidelly-ai-white-label-api-openapi.yml#/components/schemas/WhiteLabelConfigEnvelope",
  "type": "object",
  "required": [
    "success",
    "data",
    "request_id"
  ],
  "properties": {
    "success": {
      "type": "boolean",
      "const": true
    },
    "data": {
      "$ref": "#/$defs/WhiteLabelConfig"
    },
    "request_id": {
      "type": "string",
      "format": "uuid"
    }
  },
  "$defs": {
    "WhiteLabelConfig": {
      "type": "object",
      "required": [
        "brand_name",
        "primary_color",
        "button_text_color",
        "sidebar_logo_mode",
        "agency_staff_uses_custom_domain",
        "show_oauth_interstitial",
        "hide_earn",
        "hide_rewards",
        "hide_feature_requests",
        "hide_tier_badge",
        "hide_leaderboards",
        "watermark_enabled_by_default"
      ],
      "properties": {
        "brand_name": {
          "type": "string",
          "description": "Agency brand name displayed to white-label clients."
        },
        "primary_color": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$",
          "description": "Hex color for primary brand elements."
        },
        "button_text_color": {
          "type": "string",
          "enum": [
            "auto",
            "light",
            "dark"
          ],
          "description": "Text/icon color override for brand-colored buttons."
        },
        "logo_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Light-mode square logo URL."
        },
        "dark_logo_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Dark-mode square logo URL."
        },
        "sidebar_logo_mode": {
          "type": "string",
          "enum": [
            "mark_text",
            "full_logo"
          ],
          "description": "Sidebar rendering mode for logo."
        },
        "sidebar_full_logo_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Light-mode full sidebar logo URL."
        },
        "sidebar_dark_full_logo_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Dark-mode full sidebar logo URL."
        },
        "logo_text_font_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Custom font URL for logo text (mark_text mode)."
        },
        "logo_text_font_family": {
          "type": [
            "string",
            "null"
          ],
          "description": "Font family name for logo text."
        },
        "logo_text_font_format": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "woff2",
            "woff",
            "ttf",
            "otf"
          ],
          "description": "Font file format."
        },
        "logo_text_font_storage_path": {
          "type": [
            "string",
            "null"
          ],
          "description": "Internal storage path for uploaded font."
        },
        "logo_text_font_license_attested_at": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO timestamp when font license was attested."
        },
        "favicon_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Favicon URL for branded pages."
        },
        "og_image_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Open Graph image for social shares."
        },
        "support_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Agency support/help page URL."
        },
        "help_menu_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "In-app help menu link URL."
        },
        "privacy_policy_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Privacy policy URL."
        },
        "terms_of_service_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Terms of service URL."
        },
        "support_email": {
          "type": [
            "string",
            "null"
          ],
          "format": "email",
          "description": "Agency inbox email for support submissions."
        },
        "email_from_name": {
          "type": [
            "string",
            "null"
          ],
          "description": "From name for branded emails."
        },
        "email_from_address": {
          "type": [
            "string",
            "null"
          ],
          "description": "From email address for branded emails."
        },
        "agency_staff_uses_custom_domain": {
          "type": "boolean",
          "description": "Whether agency staff access Aidelly at a custom domain."
        },
        "show_oauth_interstitial": {
          "type": "boolean",
          "description": "Whether to show OAuth interstitial before redirects."
        },
        "hide_earn": {
          "type": "boolean",
          "description": "Hide earnings/monetization from white-label clients."
        },
        "hide_rewards": {
          "type": "boolean",
          "description": "Hide rewards and gamification surfaces."
        },
        "hide_feature_requests": {
          "type": "boolean",
          "description": "Hide feature request UI."
        },
        "hide_tier_badge": {
          "type": "boolean",
          "description": "Hide tier/plan badges."
        },
        "hide_leaderboards": {
          "type": "boolean",
          "description": "Hide leaderboard surfaces."
        },
        "suppress_member_welcome_email": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Tri-state override for member welcome emails."
        },
        "watermark_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Watermark image URL for reports."
        },
        "watermark_settings": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": true,
          "description": "Watermark configuration object."
        },
        "watermark_enabled_by_default": {
          "type": "boolean",
          "description": "Whether watermark appears on newly generated reports."
        },
        "domain": {
          "$ref": "#/$defs/WhiteLabelDomain",
          "nullable": true,
          "description": "Current custom domain status and DNS instructions (read-only)."
        }
      }
    },
    "WhiteLabelDomain": {
      "type": "object",
      "properties": {
        "hostname": {
          "type": [
            "string",
            "null"
          ],
          "description": "Custom domain hostname."
        },
        "status": {
          "type": "string",
          "enum": [
            "pending_dns",
            "verifying",
            "verified",
            "live",
            "failed"
          ],
          "description": "Domain verification status."
        },
        "verified_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "ISO timestamp when domain was verified."
        },
        "dns_instructions": {
          "type": [
            "object",
            "null"
          ],
          "description": "DNS records required for domain verification.",
          "properties": {
            "provider": {
              "type": "string",
              "description": "DNS provider (e.g., 'vercel')."
            },
            "hostname": {
              "type": "string",
              "description": "Hostname to configure."
            },
            "records": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "DNS record type (CNAME, A, TXT, MX)."
                  },
                  "name": {
                    "type": "string",
                    "description": "Record name or @ for root."
                  },
                  "value": {
                    "type": "string",
                    "description": "Record value."
                  },
                  "ttl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Time to live."
                  },
                  "priority": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Priority for MX records."
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Why this record is needed."
                  }
                }
              }
            },
            "fallbackRecords": {
              "type": "array",
              "items": {
                "type": "object"
              },
              "description": "Alternative DNS records if primary fails."
            }
          }
        }
      }
    }
  }
}