{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/harness/main/json-schema/harness-cluster-unlink-request-schema.json",
  "title": "ClusterUnlinkRequest",
  "description": "Batch Request to unlink clusters to the environment in a batch",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/harness-clusters-api-openapi.yml#/components/schemas/ClusterUnlinkRequest",
  "required": [
    "envRef"
  ],
  "type": "object",
  "properties": {
    "orgIdentifier": {
      "type": "string",
      "description": "Organization identifier of the environment"
    },
    "projectIdentifier": {
      "type": "string",
      "description": "Project identifier of the environment"
    },
    "envRef": {
      "type": "string",
      "description": "Environment identifier for the cluster"
    },
    "clusters": {
      "maxItems": 1000,
      "minItems": 0,
      "type": "array",
      "description": "List of cluster identifiers and names",
      "items": {
        "$ref": "#/$defs/ClusterBasicDTO"
      }
    },
    "unlinkAllClusters": {
      "type": "boolean",
      "description": "Unlink all clusters from the environment. Warning: Setting this to true will unlink ALL clusters linked to provided environment"
    }
  },
  "$defs": {
    "ClusterBasicDTO": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "identifier of the cluster"
        },
        "agentIdentifier": {
          "type": "string",
          "description": "agent identifier of the cluster"
        },
        "name": {
          "type": "string",
          "description": "name of the cluster"
        },
        "scope": {
          "type": "string",
          "description": "scope at which the cluster exists in harness gitops, project vs org vs account",
          "enum": [
            "ACCOUNT",
            "ORGANIZATION",
            "PROJECT"
          ]
        }
      },
      "description": "List of cluster identifiers and names"
    }
  }
}