{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/acronis/main/json-schema/acronis-user-me-schema.json",
  "title": "User me schema (lod=me)",
  "description": "User object returned for /users/me endpoint. Includes all full fields plus terms_accepted, login_totp_time, tenant_kind, tenant_pricing_model, brand_id.",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acronis-users-api-openapi.yml#/components/schemas/userMe",
  "allOf": [
    {
      "$ref": "#/$defs/item0"
    },
    {
      "type": "object",
      "required": [
        "terms_accepted",
        "tenant_kind",
        "tenant_pricing_model",
        "brand_id"
      ],
      "properties": {
        "terms_accepted": {
          "description": "Flag that defines if this user has accepted EULA.",
          "type": "boolean"
        },
        "login_totp_time": {
          "description": "Timestamp of last TOTP login.",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "tenant_kind": {
          "$ref": "#/$defs/tenantKind"
        },
        "tenant_pricing_model": {
          "$ref": "#/$defs/pricingMode"
        },
        "brand_id": {
          "$ref": "#/$defs/uuid"
        }
      }
    }
  ],
  "$defs": {
    "business_types": {
      "description": "Business types.",
      "type": "array",
      "items": {
        "enum": [
          "buyer"
        ],
        "type": "string"
      }
    },
    "email": {
      "type": "string",
      "pattern": "^$|\\S+@\\S+"
    },
    "item0": {
      "title": "User full schema (lod=full)",
      "description": "User object with all fields returned when lod=full is specified (default).",
      "type": "object",
      "additionalProperties": true,
      "required": [
        "id",
        "version",
        "tenant_id",
        "created_at",
        "updated_at",
        "deleted_at",
        "access_policies",
        "origin_id",
        "origin_external_id",
        "disable_after",
        "personal_tenant_id",
        "login",
        "enabled",
        "contact",
        "activated",
        "language",
        "business_types",
        "notifications"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "version": {
          "description": "Auto-incremented entity version.",
          "type": "integer"
        },
        "tenant_id": {
          "$ref": "#/$defs/uuid"
        },
        "created_at": {
          "$ref": "#/$defs/item1"
        },
        "updated_at": {
          "$ref": "#/$defs/item1"
        },
        "deleted_at": {
          "description": "Soft deletion timestamp.",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "access_policies": {
          "description": "Will be returned with all user access policies if query param `with_access_policies` is provided.",
          "type": "array",
          "minItems": 0,
          "items": {
            "$ref": "#/$defs/items_1"
          }
        },
        "origin_id": {
          "description": "User's origin ID, for example, ID of a Cyber Application responsible for creating this user.",
          "type": [
            "string",
            "null"
          ]
        },
        "origin_external_id": {
          "description": "User's external origin ID.",
          "type": [
            "string",
            "null"
          ]
        },
        "disable_after": {
          "description": "Timestamp indicating when the user will be disabled.",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "personal_tenant_id": {
          "description": "UUID of user's personal tenant. This field can have a null value.",
          "allOf": [
            {
              "$ref": "#/$defs/uuid"
            }
          ]
        },
        "login": {
          "description": "User's login.",
          "type": "string"
        },
        "enabled": {
          "description": "Flag, indicates whether the user is enabled or disabled.",
          "type": "boolean"
        },
        "contact": {
          "$ref": "#/$defs/items"
        },
        "activated": {
          "description": "Flag, indicates whether the user has been activated or not.",
          "type": "boolean"
        },
        "language": {
          "description": "Preferred locale.",
          "type": "string"
        },
        "business_types": {
          "$ref": "#/$defs/business_types"
        },
        "notifications": {
          "$ref": "#/$defs/userNotifications"
        },
        "idp_id": {
          "$ref": "#/$defs/uuid"
        },
        "external_id": {
          "description": "User's ID in external identity provider (e.g. SID in AD).",
          "type": "string"
        },
        "mfa_status": {
          "description": "Multi-factor authentication status of the user.",
          "enum": [
            "disabled",
            "forcibly_disabled",
            "setup_required",
            "enabled"
          ],
          "type": "string"
        },
        "external_operation_status": {
          "description": "Indicates if some external operation in progress for this user (his personal tenant).",
          "enum": [
            "deleting",
            "recovering"
          ],
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "item1": {
      "description": "RFC3339 Formatted date.",
      "type": "string",
      "pattern": "\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?([\\+\\-]\\d{2}\\:\\d{2})?",
      "minLength": 19,
      "maxLength": 32
    },
    "items": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "created_at": {
          "description": "Date and time when contact was created.",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "updated_at": {
          "description": "Last update timestamp, if contact has just been created - then is equal to `created_at`.",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "types": {
          "type": "array",
          "minItems": 0,
          "uniqueItems": true,
          "items": {
            "enum": [
              "legal",
              "primary",
              "billing",
              "technical",
              "management",
              "company_billing"
            ],
            "type": "string"
          }
        },
        "email": {
          "$ref": "#/$defs/email"
        },
        "address1": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "address2": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "country": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "state": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "city": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "zipcode": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "phone": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "firstname": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "lastname": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "title": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "website": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "industry": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "organization_size": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "email_confirmed": {
          "description": "This field can have a null value.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "aan": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "items_1": {
      "type": "object",
      "required": [
        "id",
        "version",
        "created_at",
        "updated_at",
        "deleted_at",
        "trustee_id",
        "trustee_type",
        "issuer_id",
        "tenant_id",
        "role_id"
      ],
      "properties": {
        "id": {
          "description": "Access policy unique identifier.",
          "type": "string"
        },
        "version": {
          "description": "Auto-incremented entity version.",
          "type": "integer"
        },
        "created_at": {
          "$ref": "#/$defs/item1"
        },
        "updated_at": {
          "$ref": "#/$defs/item1"
        },
        "deleted_at": {
          "description": "Soft deletion timestamp.",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "trustee_id": {
          "description": "Unique identifier of the Subject for whom access policy is granted.",
          "type": "string"
        },
        "trustee_type": {
          "description": "Type of the Subject for whom access policy is granted.",
          "enum": [
            "user",
            "user_group",
            "client"
          ],
          "type": "string"
        },
        "issuer_id": {
          "description": "Issuer unique identifier.",
          "type": "string"
        },
        "tenant_id": {
          "description": "Tenant unique identifier.",
          "type": "string"
        },
        "resource_server_id": {
          "description": "Tenant unique identifier.",
          "type": "string"
        },
        "resource_namespace": {
          "description": "Resource namespace.",
          "type": "string"
        },
        "resource_path": {
          "description": "Resource path.",
          "type": "string"
        },
        "role_id": {
          "$ref": "#/$defs/userRole"
        }
      }
    },
    "pricingMode": {
      "description": "Mode of tenant's pricing.",
      "enum": [
        "trial",
        "production",
        "suspended"
      ],
      "type": "string"
    },
    "tenantKind": {
      "description": "A tenant kind.",
      "enum": [
        "root",
        "partner",
        "folder",
        "customer",
        "unit"
      ],
      "type": "string"
    },
    "userNotifications": {
      "description": "User notifications.",
      "type": "array",
      "items": {
        "enum": [
          "maintenance",
          "quota",
          "reports",
          "backup_error",
          "backup_warning",
          "backup_info",
          "backup_daily_report",
          "backup_critical",
          "device_control_warning",
          "certificate_management_error",
          "certificate_management_warning",
          "certificate_management_info"
        ],
        "type": "string"
      }
    },
    "userRole": {
      "description": "Name of the user role.",
      "enum": [
        "root_admin",
        "partner_admin",
        "company_admin",
        "unit_admin",
        "readonly_admin",
        "protection_admin",
        "protection_ro_admin",
        "restore_operator",
        "backup_user",
        "sync_share_admin",
        "sync_share_user",
        "sync_share_guest",
        "pds_operator",
        "pds_support",
        "notary_admin",
        "notary_user",
        "hci_admin",
        "omnivoice_admin",
        "omnivoice_user",
        "greathorn_admin",
        "greathorn_user",
        "greathorn_analyst",
        "greathorn_client_manager"
      ],
      "type": "string"
    },
    "uuid": {
      "type": "string",
      "pattern": "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}",
      "minLength": 36,
      "maxLength": 36
    }
  }
}