{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/acronis/main/json-schema/acronis-tenant-batch-schema.json",
  "title": "tenantBatch",
  "description": "Batch response for tenants. The structure of items depends on the `lod` query parameter: stamps, basic, or full (default).",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acronis-tenants-api-openapi.yml#/components/schemas/tenantBatch",
  "type": "object",
  "required": [
    "timestamp",
    "items"
  ],
  "properties": {
    "paging": {
      "$ref": "#/$defs/paging"
    },
    "timestamp": {
      "$ref": "#/$defs/item1"
    },
    "items": {
      "description": "Array of tenant objects. The fields returned depend on the `lod` query parameter.",
      "type": "array",
      "items": {
        "oneOf": [
          {
            "title": "Tenant stamps schema (lod=stamps)",
            "description": "Tenant object with minimal fields returned when lod=stamps is specified.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "parent_id",
              "version",
              "created_at",
              "updated_at",
              "deleted_at",
              "contacts",
              "offering_items"
            ],
            "properties": {
              "id": {
                "$ref": "#/$defs/uuid"
              },
              "parent_id": {
                "description": "ID of parent tenant.",
                "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"
                  }
                ]
              },
              "contacts": {
                "description": "Empty array by default. Will be populated with all referencing contacts if query param `with_contacts` is provided.",
                "type": "array",
                "minItems": 0,
                "items": {
                  "$ref": "#/$defs/items_2"
                }
              },
              "offering_items": {
                "description": "Will be returned with all tenant offering items if query param `with_offering_items` is provided.",
                "type": "array",
                "minItems": 0,
                "items": {
                  "$ref": "#/$defs/items_3"
                }
              }
            }
          },
          {
            "title": "Tenant basic schema (lod=basic)",
            "description": "Tenant object with basic fields returned when lod=basic is specified. Includes all stamps fields plus name, kind, enabled.",
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "parent_id",
              "version",
              "created_at",
              "updated_at",
              "deleted_at",
              "contacts",
              "offering_items",
              "name",
              "kind",
              "enabled"
            ],
            "properties": {
              "id": {
                "$ref": "#/$defs/uuid"
              },
              "parent_id": {
                "description": "ID of parent tenant.",
                "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"
                  }
                ]
              },
              "contacts": {
                "description": "Empty array by default. Will be populated with all referencing contacts if query param `with_contacts` is provided.",
                "type": "array",
                "minItems": 0,
                "items": {
                  "$ref": "#/$defs/items_2"
                }
              },
              "offering_items": {
                "description": "Will be returned with all tenant offering items if query param `with_offering_items` is provided.",
                "type": "array",
                "minItems": 0,
                "items": {
                  "$ref": "#/$defs/items_3"
                }
              },
              "name": {
                "description": "Human-readable name that will be displayed to the users.",
                "type": "string"
              },
              "kind": {
                "$ref": "#/$defs/tenantKind"
              },
              "enabled": {
                "description": "Flag, indicates whether the tenant is enabled or disabled.",
                "type": "boolean"
              }
            }
          },
          {
            "title": "Tenant full schema (lod=full)",
            "description": "Tenant object with all fields returned when lod=full is specified (default).",
            "type": "object",
            "additionalProperties": true,
            "required": [
              "id",
              "parent_id",
              "version",
              "created_at",
              "updated_at",
              "deleted_at",
              "contacts",
              "offering_items",
              "name",
              "kind",
              "enabled",
              "customer_type",
              "brand_id",
              "brand_uuid",
              "brand_enabled",
              "barrier",
              "internal_tag",
              "language",
              "has_children",
              "default_idp_id",
              "update_lock",
              "ancestral_access",
              "mfa_status",
              "pricing_mode",
              "contact"
            ],
            "properties": {
              "id": {
                "$ref": "#/$defs/uuid"
              },
              "parent_id": {
                "description": "ID of parent tenant.",
                "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"
                  }
                ]
              },
              "contacts": {
                "description": "Empty array by default. Will be populated with all referencing contacts if query param `with_contacts` is provided.",
                "type": "array",
                "minItems": 0,
                "items": {
                  "$ref": "#/$defs/items_2"
                }
              },
              "offering_items": {
                "description": "Will be returned with all tenant offering items if query param `with_offering_items` is provided.",
                "type": "array",
                "minItems": 0,
                "items": {
                  "$ref": "#/$defs/items_3"
                }
              },
              "name": {
                "description": "Human-readable name that will be displayed to the users.",
                "type": "string"
              },
              "kind": {
                "$ref": "#/$defs/tenantKind"
              },
              "enabled": {
                "description": "Flag, indicates whether the tenant is enabled or disabled.",
                "type": "boolean"
              },
              "customer_type": {
                "$ref": "#/$defs/customerType"
              },
              "customer_id": {
                "description": "ID from external system; for reporting purposes. This field can have a null value.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "brand_id": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "brand_uuid": {
                "$ref": "#/$defs/uuid"
              },
              "brand_enabled": {
                "description": "Flag, indicates whether the branding is enabled or disabled on tenant.",
                "type": "boolean"
              },
              "barrier": {
                "description": "Shows the ancestor nesting level, ancestors above which will not have access to this tenant and its entities.",
                "type": "integer"
              },
              "internal_tag": {
                "description": "Internal tag. This field can have a null value.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "language": {
                "description": "Tenant's preferred language.",
                "type": "string"
              },
              "owner_id": {
                "description": "Identifier of personal tenant owner user. This field can have a null value.",
                "allOf": [
                  {
                    "$ref": "#/$defs/uuid"
                  }
                ]
              },
              "has_children": {
                "description": "Flag, indicates if tenant has children.",
                "type": "boolean"
              },
              "default_idp_id": {
                "$ref": "#/$defs/uuid"
              },
              "update_lock": {
                "type": "object",
                "required": [
                  "enabled",
                  "owner_id"
                ],
                "properties": {
                  "enabled": {
                    "description": "If true, updating the tenant via API is not allowed to anyone except for users of the tenant that owns the lock.",
                    "type": "boolean"
                  },
                  "owner_id": {
                    "description": "ID of tenant that owns the lock (only users of this tenant can update the tenant in question). This field can have a null value.",
                    "allOf": [
                      {
                        "$ref": "#/$defs/uuid"
                      }
                    ]
                  }
                }
              },
              "ancestral_access": {
                "description": "Indicates whether tenant's indirect ancestors have access to it.",
                "type": "boolean"
              },
              "mfa_status": {
                "description": "Multi-factor authentication status of the tenant.",
                "enum": [
                  "disabled",
                  "forcibly_disabled",
                  "setup_required",
                  "enabled"
                ],
                "type": "string"
              },
              "pricing_mode": {
                "$ref": "#/$defs/pricingMode"
              },
              "contact": {
                "type": "object",
                "required": [
                  "id",
                  "created_at",
                  "updated_at",
                  "types",
                  "email",
                  "firstname",
                  "lastname"
                ],
                "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"
                    ]
                  },
                  "fax": {
                    "description": "This field can have a null value.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "language": {
                    "description": "This field can have a null value.",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "external_operation_status": {
                "description": "Indicates if some external operation in progress for this tenant.",
                "enum": [
                  "deleting",
                  "recovering"
                ],
                "type": [
                  "string",
                  "null"
                ]
              },
              "production_start_date": {
                "description": "Tenant trial expiration date.",
                "allOf": [
                  {
                    "$ref": "#/$defs/item1"
                  }
                ]
              }
            }
          }
        ]
      }
    }
  },
  "$defs": {
    "customerType": {
      "description": "A type of the customer.",
      "enum": [
        "default",
        "enterprise",
        "consumer",
        "small_office",
        "ti_unified"
      ],
      "type": "string"
    },
    "email": {
      "type": "string",
      "pattern": "^$|\\S+@\\S+"
    },
    "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_2": {
      "type": "object",
      "required": [
        "id",
        "created_at",
        "updated_at",
        "types",
        "email",
        "firstname",
        "lastname"
      ],
      "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"
            }
          ]
        },
        "tenant_id": {
          "description": "ID of tenant this contact belongs to.",
          "allOf": [
            {
              "$ref": "#/$defs/uuid"
            }
          ]
        },
        "user_id": {
          "description": "ID of user this contact belongs to.",
          "allOf": [
            {
              "$ref": "#/$defs/uuid"
            }
          ]
        },
        "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"
          ]
        },
        "fax": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "language": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "deleted_at": {
          "description": "Delete timestamp, if contact deleted, null otherwise",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "email_domain_type": {
          "description": "This field can have a null value.",
          "enum": [
            "disposable",
            "public",
            "private"
          ],
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "items_3": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "application_id",
        "name",
        "edition",
        "usage_name",
        "tenant_id",
        "status",
        "type",
        "measurement_unit"
      ],
      "properties": {
        "application_id": {
          "$ref": "#/$defs/uuid"
        },
        "name": {
          "type": "string"
        },
        "edition": {
          "description": "This field can have a null value.",
          "type": [
            "string",
            "null"
          ]
        },
        "usage_name": {
          "type": "string"
        },
        "tenant_id": {
          "$ref": "#/$defs/uuid"
        },
        "updated_at": {
          "$ref": "#/$defs/item1"
        },
        "deleted_at": {
          "description": "Soft deletion timestamp.",
          "allOf": [
            {
              "$ref": "#/$defs/item1"
            }
          ]
        },
        "status": {
          "description": "Status of offering item: 1 - item turned on, 0 - off.",
          "enum": [
            0,
            1
          ],
          "type": "integer"
        },
        "locked": {
          "description": "If true, this item status cannot be changed.",
          "type": "boolean"
        },
        "quota": {
          "$ref": "#/$defs/quota"
        },
        "type": {
          "$ref": "#/$defs/offeringItemType"
        },
        "infra_id": {
          "$ref": "#/$defs/uuid"
        },
        "measurement_unit": {
          "$ref": "#/$defs/measurementUnits"
        }
      }
    },
    "measurementUnits": {
      "description": "Measurement unit in which offering item's usages are kept.",
      "enum": [
        "bytes",
        "quantity",
        "seconds",
        "n/a"
      ],
      "type": "string"
    },
    "offeringItemType": {
      "enum": [
        "count",
        "feature",
        "infra"
      ],
      "type": "string"
    },
    "paging": {
      "title": "Generic paging parameters schema",
      "type": "object",
      "properties": {
        "cursors": {
          "type": "object",
          "properties": {
            "after": {
              "type": "string"
            }
          }
        }
      }
    },
    "pricingMode": {
      "description": "Mode of tenant's pricing.",
      "enum": [
        "trial",
        "production",
        "suspended"
      ],
      "type": "string"
    },
    "quota": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "overage",
        "version"
      ],
      "properties": {
        "value": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "overage": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "version": {
          "description": "Version of the quota. Equals to 0 if `value` and `overage` are `null`. Otherwise, contains the version number.",
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "tenantKind": {
      "description": "A tenant kind.",
      "enum": [
        "root",
        "partner",
        "folder",
        "customer",
        "unit"
      ],
      "type": "string"
    },
    "uuid": {
      "type": "string",
      "pattern": "[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}",
      "minLength": 36,
      "maxLength": 36
    }
  }
}