{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/rivery/main/json-schema/rivery-user-model-schema.json",
  "title": "UserModel",
  "description": "User model",
  "x-generated": "2026-10-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rivery-openapi.json#/components/schemas/UserModel",
  "properties": {
    "user_id": {
      "type": "string",
      "title": "User Id",
      "description": "The user id"
    },
    "user_email": {
      "type": "string",
      "title": "User Email",
      "description": "The email of the user"
    },
    "user_name": {
      "type": "string",
      "title": "User Name",
      "description": "The user name"
    },
    "environments": {
      "type": "object",
      "title": "Environments",
      "description": "The user environments and permission"
    },
    "is_admin": {
      "type": "boolean",
      "title": "Is Admin",
      "description": "A flag that indicates whether the flag is admin"
    },
    "is_global_operator": {
      "type": "boolean",
      "title": "Is Global Operator",
      "description": "Indicates if the user is a global operator (read-only cross-account)",
      "default": false
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "The user status"
    },
    "created_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Created At",
      "description": "The user creation date"
    },
    "last_login": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Login",
      "description": "The user's last login date"
    },
    "updated_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updated At",
      "description": "The user last update date"
    },
    "groups": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Groups",
      "description": "The user's groups",
      "default": []
    },
    "source": {
      "type": "string",
      "title": "Source",
      "description": "The user source"
    },
    "invited_by": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Invited By",
      "description": "The user who invited this user"
    },
    "is_active": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "title": "Is Active",
      "description": "Indicates if the user is active",
      "default": true
    },
    "onboarding": {
      "anyOf": [
        {
          "$ref": "#/$defs/UserOnboardingModel"
        },
        {
          "type": "null"
        }
      ]
    },
    "is_super_admin": {
      "type": "boolean",
      "title": "Is Super Admin",
      "description": "Indicates if the user is a super admin"
    },
    "is_super_admin_creator": {
      "type": "boolean",
      "title": "Is Super Admin Creator",
      "description": "Indicates if the user is a super admin creator"
    },
    "allow_login_password": {
      "type": "boolean",
      "title": "Allow Login Password",
      "description": "Indicates if the user is allowed to login with password"
    },
    "allow_login_google": {
      "type": "boolean",
      "title": "Allow Login Google",
      "description": "Indicates if the user is allowed to login with google"
    },
    "allow_login_sso": {
      "type": "boolean",
      "title": "Allow Login Sso",
      "description": "Indicates if the user is allowed to login with SSO"
    }
  },
  "type": "object",
  "required": [
    "user_id",
    "user_email",
    "user_name",
    "environments",
    "is_admin",
    "status",
    "source",
    "is_super_admin",
    "is_super_admin_creator",
    "allow_login_password",
    "allow_login_google",
    "allow_login_sso"
  ],
  "$defs": {
    "UserOnboardingModel": {
      "properties": {
        "know_rivery_step": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Know Rivery Step",
          "description": "User finished first step"
        },
        "data_connections_step": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Connections Step",
          "description": "User finished second step"
        },
        "data_pipeline_step": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Data Pipeline Step",
          "description": "User finished third step"
        },
        "transform_and_orchestrate_step": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Transform And Orchestrate Step",
          "description": "User finished fourth step"
        },
        "pre_built_solutions_step": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Pre Built Solutions Step",
          "description": "User finished fifth step"
        },
        "invite_member_step": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Invite Member Step",
          "description": "User finished sixth step"
        }
      },
      "type": "object",
      "title": "UserOnboardingModel",
      "description": "Onboarding steps model"
    }
  }
}