{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/karma-domains/main/json-schema/karma-domains-public-user-profile-schema-schema.json",
  "title": "PublicUserProfileSchema",
  "description": "Current user profile for Public API (sanitized subset of UserInfo).",
  "x-generated": "2026-10-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/karma-domains-openapi.json#/components/schemas/PublicUserProfileSchema",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "email": {
      "type": "string",
      "format": "email",
      "title": "Email"
    },
    "joined": {
      "type": "integer",
      "title": "Joined",
      "default": 0
    },
    "balance": {
      "type": "integer",
      "title": "Balance",
      "description": "Total spendable credits (Pro + Unlimited plan pools + purchased)",
      "default": 0
    },
    "pro_task_credits": {
      "type": "integer",
      "title": "Pro Task Credits",
      "default": 0
    },
    "unlimited_plan": {
      "type": "integer",
      "title": "Unlimited Plan",
      "default": 0
    },
    "pro_plan": {
      "type": "integer",
      "title": "Pro Plan",
      "default": 0
    },
    "unlimited_subscription_info": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicSubscriptionInfoSchema"
        },
        {
          "type": "null"
        }
      ]
    },
    "pro_subscription_info": {
      "anyOf": [
        {
          "$ref": "#/$defs/PublicSubscriptionInfoSchema"
        },
        {
          "type": "null"
        }
      ]
    },
    "lang": {
      "type": "string",
      "title": "Lang",
      "default": "en"
    },
    "country": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Country"
    },
    "timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Timezone"
    },
    "home": {
      "type": "string",
      "title": "Home",
      "default": "auctions"
    },
    "theme": {
      "type": "string",
      "title": "Theme",
      "default": "system"
    },
    "referral_counter": {
      "type": "integer",
      "title": "Referral Counter",
      "default": 0
    },
    "news": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/UserNews"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "News"
    }
  },
  "type": "object",
  "required": [
    "id",
    "email"
  ],
  "$defs": {
    "PublicSubscriptionInfoSchema": {
      "properties": {
        "product_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Product Id"
        },
        "payment_frequency_interval": {
          "type": "string",
          "title": "Payment Frequency Interval"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "created_at": {
          "type": "integer",
          "title": "Created At"
        },
        "next_billing_date": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Billing Date"
        },
        "previous_billing_date": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Previous Billing Date"
        },
        "cancelled_at": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cancelled At"
        },
        "cancel_at_next_billing_date": {
          "type": "boolean",
          "title": "Cancel At Next Billing Date"
        }
      },
      "type": "object",
      "required": [
        "payment_frequency_interval",
        "status",
        "created_at",
        "cancel_at_next_billing_date"
      ],
      "title": "PublicSubscriptionInfoSchema",
      "description": "Subscription details exposed via Public API (no internal billing ids)."
    },
    "UserNews": {
      "properties": {
        "type": {
          "type": "string",
          "pattern": "^(info|warning|success|error)$",
          "title": "Type",
          "default": "info"
        },
        "expires_at": {
          "type": "integer",
          "title": "Expires At"
        },
        "text": {
          "type": "string",
          "title": "Text"
        },
        "link": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Link"
        }
      },
      "type": "object",
      "required": [
        "expires_at",
        "text"
      ],
      "title": "UserNews"
    }
  }
}