{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/factiq-com/json-schema/factiq-com-user-profile-schema.json",
  "title": "UserProfile",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/factiq-com-auth-api-openapi.yml#/components/schemas/UserProfile",
  "properties": {
    "user": {
      "$ref": "#/$defs/User"
    },
    "monthly_usage": {
      "anyOf": [
        {
          "$ref": "#/$defs/UsageQuota"
        },
        {
          "type": "null"
        }
      ]
    },
    "is_admin": {
      "type": "boolean",
      "title": "Is Admin",
      "default": false
    },
    "mcp_connections": {
      "items": {
        "$ref": "#/$defs/McpConnection"
      },
      "type": "array",
      "title": "Mcp Connections"
    }
  },
  "type": "object",
  "required": [
    "user"
  ],
  "$defs": {
    "McpConnection": {
      "properties": {
        "client": {
          "type": "string",
          "title": "Client"
        },
        "connected_at": {
          "type": "string",
          "format": "date-time",
          "title": "Connected At"
        },
        "last_connected_at": {
          "type": "string",
          "format": "date-time",
          "title": "Last Connected At"
        }
      },
      "type": "object",
      "required": [
        "client",
        "connected_at",
        "last_connected_at"
      ],
      "title": "McpConnection",
      "description": "One AI assistant the user has connected to FactIQ.\n\nclient is the assistant's display name (\"Claude\", \"Claude Code\", \"Codex\",\n\"ChatGPT\", or \"API key\" for raw fiq_ keys). connected_at is the first time\nit connected; last_connected_at the most recent sign-in from it."
    },
    "UsageQuota": {
      "properties": {
        "usage_month": {
          "type": "string",
          "format": "date",
          "title": "Usage Month"
        },
        "request_count": {
          "type": "integer",
          "title": "Request Count"
        },
        "request_limit": {
          "type": "integer",
          "title": "Request Limit"
        }
      },
      "type": "object",
      "required": [
        "usage_month",
        "request_count",
        "request_limit"
      ],
      "title": "UsageQuota"
    },
    "User": {
      "properties": {
        "id": {
          "type": "integer",
          "title": "Id"
        },
        "email": {
          "type": "string",
          "title": "Email"
        },
        "full_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Full Name"
        },
        "picture_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Picture Url"
        },
        "plan_type": {
          "type": "string",
          "title": "Plan Type"
        },
        "personal_plan_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Personal Plan Type"
        },
        "plan_expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Plan Expires At"
        },
        "personal_plan_expires_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Personal Plan Expires At"
        },
        "entitlement_source": {
          "type": "string",
          "title": "Entitlement Source",
          "default": "personal"
        },
        "workspace_id": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ],
          "title": "Workspace Id"
        },
        "email_verified": {
          "type": "boolean",
          "title": "Email Verified",
          "default": false
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "blocked_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Blocked At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "email",
        "plan_type"
      ],
      "title": "User"
    }
  }
}