{
  "openapi": "3.1.0",
  "info": {
    "title": "Harper Fabric API",
    "version": "1.0.0",
    "description": "API documentation for Harper Fabric"
  },
  "paths": {
    "/Cluster/": {
      "post": {
        "summary": "Create a cluster.",
        "description": "Create a cluster.\n\nDeploys a new cluster. Each entry in `regionPlans` adds that region's `instanceCount` instances\n(from **List regions**), all on the plan you choose.\n\nThe request returns as soon as deployment starts. Poll **Get a cluster** until `status` is `RUNNING`, or\n`FAILED` with a `failureReason`. Only organization admins can read a new cluster until its admin password is set,\nso other callers should watch its `status` in **Get an organization**. That lists the cluster only if the\ncaller's role can view it: creating a cluster does not add it to a role that grants view on selected clusters.\n\nSelf-hosted plans take extra region-plan fields that are not covered here.\n\n**Authentication:** API token or session\n\n**Authorization:** Permission to create clusters in the organization",
        "tags": [
          "Cluster"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "The new cluster: the request's fields, plus `id` and `instanceIds`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The new cluster's ID. Use it with **Get a cluster**."
                    },
                    "organizationId": {
                      "type": "string",
                      "description": "Your organization's ID."
                    },
                    "name": {
                      "type": "string",
                      "description": "The display name."
                    },
                    "abbreviatedName": {
                      "type": "string",
                      "description": "The short name."
                    },
                    "version": {
                      "type": "string",
                      "description": "The Harper version, if you sent one."
                    },
                    "autoRenew": {
                      "type": "boolean",
                      "description": "The renewal setting, if you sent one."
                    },
                    "preset": {
                      "type": "string",
                      "description": "The Studio preset, if you sent one."
                    },
                    "recordLocks": {
                      "type": "boolean",
                      "description": "Whether record locks are on. Present when you sent it or it was turned on by default."
                    },
                    "sharding": {
                      "type": "object",
                      "description": "The `{ shards, minOwners }` the cluster was created with, plus `spares` if sent. Present when you sent `sharding`.",
                      "properties": {
                        "shards": {
                          "type": "number",
                          "description": "Number of shards."
                        },
                        "minOwners": {
                          "type": "number",
                          "description": "Owners each shard keeps."
                        },
                        "spares": {
                          "type": "integer",
                          "description": "Spare shard IDs reserved for replica instances, if sent."
                        }
                      }
                    },
                    "regionPlans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "regionId": {
                            "type": "string",
                            "description": "Region `id`."
                          },
                          "region": {
                            "type": "string",
                            "description": "Region display name."
                          },
                          "planId": {
                            "type": "string",
                            "description": "Plan `id`."
                          },
                          "plan": {
                            "type": "object",
                            "description": "The full plan, as in **List plans**."
                          },
                          "replicas": {
                            "type": "integer",
                            "description": "How many of the region's instances are replicas, if sent."
                          }
                        }
                      },
                      "description": "The region plans as sent."
                    },
                    "instanceIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of the instances being deployed."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is missing or invalid, the plan, region or version is not available to your organization, or the version is older than the oldest supported build for its major."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You may not create clusters in this organization, or the body sets a field reserved for Harper staff."
          },
          "409": {
            "description": "The name or abbreviated name is already in use."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "description": "Your organization's ID."
                  },
                  "name": {
                    "type": "string",
                    "description": "Display name, unique in your organization. Up to 255 letters, digits, spaces, `_`, `-` or `.`; must start and end with a letter or digit."
                  },
                  "abbreviatedName": {
                    "type": "string",
                    "description": "Short name used in the cluster's hostname, unique in your organization. Up to 20 lowercase letters, digits or `-`; must start and end with a letter or digit."
                  },
                  "regionPlans": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "planId": {
                          "type": "string",
                          "description": "A plan `id` from **List plans**."
                        },
                        "regionId": {
                          "type": "string",
                          "description": "A region `id` from **List regions**."
                        },
                        "replicas": {
                          "type": "integer",
                          "description": "How many of the region's instances are replicas, default 0. A replica joins a spare shard, owns no slots and never counts toward `minOwners`. Needs `sharding.spares`; at most 10 per cluster, and only owners count toward `shards * minOwners`."
                        }
                      },
                      "required": [
                        "planId",
                        "regionId"
                      ]
                    },
                    "description": "One entry per region the cluster runs in."
                  },
                  "version": {
                    "type": "string",
                    "description": "A `version` from **List Harper versions**. Defaults to the `stable` version. A version the list does not offer your organization is refused, unless your organization already runs it or, for now, Harper released that build to your organization alone without listing it; so is one older than the oldest build Harper still supports for that major, unless your organization already runs that version."
                  },
                  "autoRenew": {
                    "type": "boolean",
                    "description": "Renew the cluster's plans automatically when they expire."
                  },
                  "recordLocks": {
                    "type": "boolean",
                    "description": "Turn cluster-wide record locks on or off. `true` needs Harper 5.3.0 or later and a hosted plan. If omitted, hosted clusters on Harper 5.4 or later get record locks on; send `false` to keep them off."
                  },
                  "sharding": {
                    "type": "object",
                    "description": "Create the cluster for schema-defined sharding: `{ shards, minOwners, spares }`. `shards` is 2 to 256 and `minOwners` defaults to 2. Needs Harper 5.4.0-beta.3 or later, a hosted plan, and region plans giving at least `shards * minOwners` owner instances. Each instance gets a fixed shard. It cannot change after creation, and a scale-in that would leave a shard with fewer than `minOwners` running owners is refused with 400. `spares` (1 or more, with `shards + spares` at most 256) adds spare shard IDs after the owning ones, so the cluster can hold replicas; with spares, `shards` may be 1. Spares need Harper 5.4.0 or later, or the request is refused with 400. Sharding and spares each need hosts that support them: with too few, the request is refused with 404, or on dedicated hosts the cluster ends `FAILED` after the request is accepted."
                  },
                  "preset": {
                    "type": "string",
                    "description": "The Studio preset to create the cluster from. Omit for a blank cluster."
                  }
                },
                "required": [
                  "organizationId",
                  "name",
                  "abbreviatedName",
                  "regionPlans"
                ]
              }
            }
          }
        }
      }
    },
    "/Cluster/{id}": {
      "delete": {
        "summary": "Delete a cluster.",
        "description": "Delete a cluster.\n\nDeletes the cluster and all of its instances. This cannot be undone.\n\nThe request returns as soon as the delete starts. The cluster's `status` is `TERMINATING` until the delete\nfinishes, then `TERMINATED`; poll **Get a cluster** to follow it. Sending the delete again while it runs returns\nthe delete already in progress.\n\n**Authentication:** API token or session\n\n**Authorization:** Permission to delete the cluster",
        "tags": [
          "Cluster"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The cluster's ID."
          }
        ],
        "responses": {
          "200": {
            "description": "The delete has started.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The cluster's ID."
                    },
                    "workflowId": {
                      "type": "string",
                      "description": "ID of the background job deleting the cluster."
                    },
                    "status": {
                      "type": "string",
                      "description": "`TERMINATING`."
                    }
                  }
                }
              }
            }
          },
          "204": {
            "description": "The cluster was already deleted."
          },
          "400": {
            "description": "The cluster is still being created or updated."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You may not delete the cluster, or your account is inactive."
          },
          "404": {
            "description": "The cluster does not exist, or you cannot view it."
          },
          "409": {
            "description": "Another change is running on the cluster, such as a version update or a restart."
          },
          "503": {
            "description": "The cluster is briefly busy with another request. Retry."
          }
        }
      },
      "get": {
        "summary": "Get a cluster.",
        "description": "Get a cluster.\n\nReturns the cluster, its region plans and its instances. Use it to follow a create, update, action or delete\nthrough `status` and `workflowId`, and to find each instance's hostname.\n\nEach instance's operations API is at `https://<instanceFqdn>:<operationsApiPort>` (`http` when\n`operationsApiSecure` is `false`). The cluster as a whole is served at `fqdn`.\n\nUntil an organization admin sets a new cluster's admin password, only organization admins can read it. Other\ncallers can follow its `status` in **Get an organization** if their role can view it.\n\n**Authentication:** API token or session\n\n**Authorization:** Permission to view the cluster",
        "tags": [
          "Cluster"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The cluster's ID."
          },
          {
            "name": "instanceState",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`active` returns instances that are deploying, running, being updated, copying data, or held out of service for maintenance (`DRAINING`). `inactive` returns the rest: mid-action (`STOPPING`, `STARTING`, `RESTARTING`), stopped, failed, and removed or being removed."
          }
        ],
        "responses": {
          "200": {
            "description": "The cluster.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The cluster's ID."
                    },
                    "organizationId": {
                      "type": "string",
                      "description": "The organization the cluster belongs to."
                    },
                    "name": {
                      "type": "string",
                      "description": "Display name."
                    },
                    "abbreviatedName": {
                      "type": "string",
                      "description": "Short name, used in `fqdn`."
                    },
                    "status": {
                      "type": "string",
                      "description": "`PROVISIONING` while it deploys, then `RUNNING`. `UPDATING` during an update. `STOPPING`, `STOPPED`, `STARTING` or `RESTARTING` during an action. `PARTIAL` when the instances are neither all running nor all stopped (an instance held out of service for maintenance counts as running), such as after an action failed or halted partway, or after one instance was stopped. `FAILED` when a deploy, region-plan change or action failed. A failed `version` or `recordLocks` rollout leaves the cluster `RUNNING`; see **Update a cluster**. `TERMINATING` while it is deleted, then `TERMINATED`."
                    },
                    "failureReason": {
                      "type": "string",
                      "description": "Why the cluster failed. Present when `status` is `FAILED`."
                    },
                    "workflowId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "ID of the background change holding the cluster, such as a version update, a rolling restart or Fabric moving an instance to another host, or `null` when none is running."
                    },
                    "fqdn": {
                      "type": "string",
                      "description": "The cluster's load-balanced hostname."
                    },
                    "plans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "regionId": {
                            "type": "string",
                            "description": "Region `id`, as in **List regions**."
                          },
                          "region": {
                            "type": "string",
                            "description": "Region display name."
                          },
                          "planId": {
                            "type": "string",
                            "description": "Plan `id`, as in **List plans**."
                          },
                          "autoRenew": {
                            "type": "boolean",
                            "description": "Whether the plan renews automatically."
                          },
                          "replicas": {
                            "type": "integer",
                            "description": "How many of the region's instances are replicas, when any are."
                          }
                        }
                      },
                      "description": "Region plans, one per region the cluster runs in."
                    },
                    "sharding": {
                      "type": "object",
                      "description": "The `{ shards, minOwners }` the cluster was created with, plus `spares` if set. Present on a sharded cluster.",
                      "properties": {
                        "shards": {
                          "type": "number",
                          "description": "Number of shards."
                        },
                        "minOwners": {
                          "type": "number",
                          "description": "Owners each shard keeps."
                        },
                        "spares": {
                          "type": "integer",
                          "description": "Spare shard IDs reserved for replica instances, if set."
                        }
                      }
                    },
                    "instances": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Instance ID. Use it with **Stop, start or restart an instance**."
                          },
                          "name": {
                            "type": "string",
                            "description": "Instance name."
                          },
                          "status": {
                            "type": "string",
                            "description": "`PROVISIONING` while it deploys, then `RUNNING`. `UPDATING` while it changes version or plan. `STOPPING`, `STOPPED`, `STARTING` or `RESTARTING` during an action. `FAILED` or `ERROR` when it failed. `TERMINATING`, then `TERMINATED`, while it is removed. `DRAINING` while Fabric holds it out of service for maintenance, and `CLONING` while it copies data from another instance; both can last a while. Other values appear briefly during setup."
                          },
                          "instanceFqdn": {
                            "type": "string",
                            "description": "The instance's own hostname."
                          },
                          "clusterFqdn": {
                            "type": "string",
                            "description": "The cluster's hostname, the same as `fqdn`."
                          },
                          "operationsApiPort": {
                            "type": "integer",
                            "description": "Port of the instance's Harper operations API."
                          },
                          "operationsApiSecure": {
                            "type": "boolean",
                            "description": "Whether the operations API uses HTTPS."
                          },
                          "regionId": {
                            "type": "string",
                            "description": "Region `id` the instance runs in."
                          },
                          "region": {
                            "type": "string",
                            "description": "Region display name."
                          },
                          "planId": {
                            "type": "string",
                            "description": "Plan `id` the instance runs on."
                          },
                          "role": {
                            "type": "string",
                            "description": "`replica` for a replica instance; absent for an owner."
                          },
                          "shard": {
                            "type": "integer",
                            "description": "The instance's shard ID on a sharded cluster. It never changes. An owner owns that shard; a replica's is a spare ID, which owns no slots."
                          },
                          "shardCount": {
                            "type": "integer",
                            "description": "The cluster's shard IDs, `shards` plus `spares`, on a sharded cluster."
                          },
                          "spareShardCount": {
                            "type": "integer",
                            "description": "The cluster's `sharding.spares`, on a cluster with spares."
                          },
                          "version": {
                            "type": "string",
                            "description": "The Harper version the instance should run. During a version update this is the new version, before the instance has switched to it."
                          },
                          "reportedVersion": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The Harper version the instance last reported running. Absent until the instance first reports one; `null` during a version update, until the instance reports the new version."
                          },
                          "recordLocks": {
                            "type": [
                              "boolean",
                              "null"
                            ],
                            "description": "`true` when the instance runs with record locks; `null` or absent when it does not."
                          },
                          "storageGb": {
                            "type": "integer",
                            "description": "Disk allocated to the instance, in GB."
                          },
                          "usedStorageGb": {
                            "type": "number",
                            "description": "Disk the instance is using, in GB. Absent on self-hosted plans and until the instance first reports it."
                          },
                          "cpuCores": {
                            "type": "number",
                            "description": "CPU cores allocated to the instance."
                          },
                          "memoryMb": {
                            "type": "integer",
                            "description": "Memory allocated to the instance, in MB."
                          },
                          "threads": {
                            "type": "integer",
                            "description": "Harper worker threads the instance runs."
                          },
                          "safeMode": {
                            "type": "boolean",
                            "description": "Whether the instance was last started in safe mode."
                          },
                          "lastContainerAction": {
                            "type": "string",
                            "description": "The last `stop`, `start` or `restart` run on the instance."
                          },
                          "lastContainerActionAt": {
                            "type": "string",
                            "description": "When that action ran."
                          },
                          "lastContainerActionError": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Why that action failed, or `null`."
                          },
                          "drainPhase": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "`applying`, `applied` or `releasing` while the instance is taken out of service for maintenance, otherwise `null`."
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "When the instance was created."
                          }
                        }
                      },
                      "description": "The cluster's instances."
                    },
                    "domainIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of the custom domains the cluster serves, from **List custom domains**."
                    },
                    "generateDomainCerts": {
                      "type": "boolean",
                      "description": "Whether Fabric issues TLS certificates for the custom domains."
                    },
                    "recordLocks": {
                      "type": "boolean",
                      "description": "The cluster's record-lock setting. Absent if never set. Instances a failed rollout did not update keep their previous setting."
                    },
                    "preset": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The Studio preset the cluster was created from. Absent or `null` for a blank cluster."
                    },
                    "purchasedBlocks": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "description": "The plan purchases behind the cluster, each with `planId`, `regionId`, `createdAt` and `expiresAt`. **Get cluster usage** summarizes them."
                    },
                    "lastContainerAction": {
                      "type": "string",
                      "description": "The last `stop`, `start` or `restart` run on the whole cluster."
                    },
                    "lastContainerActionAt": {
                      "type": "string",
                      "description": "When that action ran."
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the cluster was created."
                    },
                    "updatedAt": {
                      "type": "string",
                      "description": "When the cluster was last changed."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "Your account is inactive, or the cluster's admin password has not been set yet and you are not an organization admin."
          },
          "404": {
            "description": "The cluster does not exist, or you cannot view it."
          }
        }
      },
      "put": {
        "summary": "Update a cluster.",
        "description": "Update a cluster.\n\nSend one kind of change per request. `name` sent with `regionPlans`, `version` or `domainIds` is ignored.\n\n- `name` and/or `preset`: rename the cluster or change its Studio preset. Nothing restarts.\n- `regionPlans`: add or remove regions, or change a region's plan.\n- `version`: change the Harper version. Instances are updated one at a time.\n- `domainIds`, optionally with `generateDomainCerts`: set the custom domains the cluster serves.\n- `recordLocks`: turn cluster-wide record locks on or off. Instances restart one at a time.\n\nThe cluster must be `RUNNING`, and no instance can be mid-change or `FAILED`. A `version` update is also accepted\nwhen it would upgrade instances left `FAILED` by an earlier one.\n\nChanges to instances run in the background, so the response lists what will change rather than what has changed.\nFor `regionPlans`, poll **Get a cluster** until `status` is `RUNNING` again, or `FAILED`. For `version` and\n`recordLocks`, the cluster's `status` is not enough: a rollout that fails still returns the cluster to `RUNNING`.\nWait until the cluster's `workflowId` is `null`, then check every instance except those `TERMINATING`,\n`TERMINATED` or `REMOVED`. Each should be `RUNNING`, with `reportedVersion` (where present) equal to the version\nyou sent, or `recordLocks` `true` after enabling and not `true` after disabling. Instances the rollout failed on are `FAILED`;\ninstances it never reached stay `RUNNING` on their previous value. (`version` shows the version requested, not\nthe one running.)\n\nA `domainIds` change keeps the cluster `RUNNING` while instances pick up the domains and certificates are\nissued, so `status` does not show when it finishes.\n\n**Region plans.** Send the complete list. Any region you leave out is removed, along with its instances. With\nrecord locks on, Fabric can refuse to remove an instance. If the update only removed instances, the cluster\nthen returns to `RUNNING` unchanged. If it also added instances or changed a region's plan, it ends `FAILED`.\n\n**Record locks.** `true` needs Harper 5.3.0 or later and a hosted (not self-hosted) plan. If you never set it,\nFabric turns record locks on automatically once every instance runs Harper 5.4.1 or later on RocksDB. Send `false`\nto keep them off.\n\n**Sharded clusters.** `sharding` is set when the cluster is created and cannot change; sending it returns 400.\nWhen `regionPlans` removes instances, Fabric chooses which ones go so that every shard keeps `minOwners` running\nowners. If it cannot, the request fails with 400 naming the shard and its owner count. A `version` below\n5.4.0-beta.3 is refused. An owner lost after that check refuses the removal like a record-lock refusal does.\nDon't remove instances while another instance of the same shard is failing: an owner whose host failed in the\nlast few seconds can still be counted, and so can an instance removed moments before Fabric recovered from a\nfailure.\n\n**Replicas.** On a cluster with spare shards, `regionPlans[].replicas` sets how many of a region's instances are\nreplicas; omit it to keep the count. A replica's role is fixed, so owners and replicas change together. A\nreplica change at the same instance count, owners and replicas moving in opposite directions, or a plan change\nfor a region holding replicas returns 400. Removing a replica returns 400 until a Harper release supports it. If\nbuilding new instances fails, the update keeps every replica that started, rolls back its new owners and leaves\nthe cluster `FAILED`.\n\n**Authentication:** API token or session\n\n**Authorization:** Permission to update the cluster",
        "tags": [
          "Cluster"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The cluster's ID."
          }
        ],
        "responses": {
          "200": {
            "description": "The change. Which fields are present depends on what you sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The cluster's ID."
                    },
                    "name": {
                      "type": "string",
                      "description": "The new name. Present when the rename was applied (`name` sent without `regionPlans`, `version` or `domainIds`)."
                    },
                    "preset": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The new preset. Present when you sent `preset`."
                    },
                    "regionPlans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "regionId": {
                            "type": "string",
                            "description": "Region `id`."
                          },
                          "region": {
                            "type": "string",
                            "description": "Region display name."
                          },
                          "planId": {
                            "type": "string",
                            "description": "Plan `id`."
                          },
                          "replicas": {
                            "type": "integer",
                            "description": "How many of the region's instances are replicas, when above 0."
                          }
                        }
                      },
                      "description": "The new region plans. Present when you sent `regionPlans`."
                    },
                    "instancesAdded": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of instances being deployed. Present when you sent `regionPlans`."
                    },
                    "instancesDeleted": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of instances being removed. Present when you sent `regionPlans`."
                    },
                    "instancesUpdated": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of instances being changed in place. Present for every change except `name` and `preset`. For `recordLocks` it lists every instance, including any already at the requested setting."
                    },
                    "version": {
                      "type": "string",
                      "description": "The version being rolled out. Present when you sent `version`."
                    },
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The hostnames the cluster will serve. Present when you sent `domainIds`."
                    },
                    "recordLocks": {
                      "type": "boolean",
                      "description": "The new record-lock setting. Present when you sent `recordLocks`."
                    },
                    "workflowId": {
                      "type": "string",
                      "description": "ID of the background job rolling out `version` or `recordLocks`."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is invalid, or sends `recordLocks` with another change, `preset` with anything but `name`, or any two of `version`, `regionPlans` and `domainIds`. The cluster is not `RUNNING`, or an instance is mid-change or `FAILED`. The cluster cannot use record locks. A domain in `domainIds` is not `ACTIVE`, belongs to another organization, or already serves another cluster. The `version` is not available to your organization, or is older than the oldest supported build for its major."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You may not update the cluster, your account is inactive, or the body sets a field reserved for Harper staff."
          },
          "404": {
            "description": "The cluster does not exist or you cannot view it, or a domain in `domainIds` does not exist."
          },
          "409": {
            "description": "Another change is already running on the cluster, an instance is out of service for maintenance, or the new `name` is already in use. For `domainIds`: the cluster was deleted during the request, a domain was released during the request (retry), or a domain name is held by another registration or bound to another cluster. For `regionPlans`: another operation took the cluster while this update ran (its plans were not changed); on a sharded cluster, another update changed the region plans after this one read them (retry), or the update adds instances or replicas while no owner instance is running, since new instances copy a running owner."
          },
          "503": {
            "description": "For `domainIds`, or a scale-in of a sharded cluster: a cluster or custom domain was briefly busy and nothing changed. Retry."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "New display name. Same rules as on **Create a cluster**."
                  },
                  "regionPlans": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "planId": {
                          "type": "string",
                          "description": "A plan `id` from **List plans**."
                        },
                        "regionId": {
                          "type": "string",
                          "description": "A region `id` from **List regions**."
                        },
                        "replicas": {
                          "type": "integer",
                          "description": "On a cluster with spare shards, how many of the region's instances are replicas. Omit it to keep the region's count."
                        }
                      },
                      "required": [
                        "planId",
                        "regionId"
                      ]
                    },
                    "description": "Every region the cluster should run in. Regions left out are removed."
                  },
                  "version": {
                    "type": "string",
                    "description": "A `version` from **List Harper versions**. A version the list does not offer your organization is refused, unless your organization already runs it or, for now, Harper released that build to your organization alone without listing it; so is one older than the oldest build Harper still supports for that major, unless your organization already runs that version."
                  },
                  "domainIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Every custom domain the cluster should serve: IDs of `ACTIVE` domains from **List custom domains**. Not available on self-hosted clusters."
                  },
                  "generateDomainCerts": {
                    "type": "boolean",
                    "description": "With `domainIds`: have Fabric issue TLS certificates for the domains."
                  },
                  "recordLocks": {
                    "type": "boolean",
                    "description": "Turn cluster-wide record locks on or off."
                  },
                  "preset": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "New Studio preset (1–40 lowercase letters, digits or `-`), or `null` to clear it."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Cluster/{id}/container/{action}": {
      "post": {
        "summary": "Stop, start or restart a cluster.",
        "description": "Stop, start or restart a cluster.\n\nRuns the action on every instance that is `RUNNING`, `STOPPED`, `ERROR` or `FAILED`, and skips the rest. An\ninstance with its own action in progress or under maintenance refuses the whole request instead (409).\n\nThe request returns as soon as the action is accepted; poll **Get a cluster** to follow it. No other change can\nbe made to the cluster until it finishes.\n\nWhen it finishes, the cluster's `status` is:\n\n- `RUNNING` or `STOPPED` if it finished on every instance it targeted\n- `FAILED` if it reached every instance it targeted and failed on all of them\n- `PARTIAL` if it failed on some instances, was refused by them, or never reached them\n\nA `rolling` action pauses at the first instance that fails and leaves the rest untouched. While it is paused,\n`status` stays `STOPPING`, `STARTING` or `RESTARTING` and `workflowId` stays set, until Harper support resumes or\ncancels it. A cancelled action is settled from what it reached: `PARTIAL` or `FAILED` as above, or, if it\nreached no instance, whatever the unchanged instances add up to.\n\n**Authentication:** API token or session\n\n**Authorization:** Organization admin",
        "tags": [
          "Cluster"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The cluster's ID."
          },
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "stop",
                "start",
                "restart"
              ]
            },
            "description": "The action to run."
          }
        ],
        "responses": {
          "200": {
            "description": "The accepted action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clusterId": {
                      "type": "string",
                      "description": "The cluster's ID."
                    },
                    "action": {
                      "type": "string",
                      "description": "The action being run."
                    },
                    "strategy": {
                      "type": "string",
                      "description": "The strategy being used."
                    },
                    "status": {
                      "type": "string",
                      "description": "The cluster's status while the action runs, such as `RESTARTING`."
                    },
                    "instanceIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "IDs of the instances the action runs on."
                    },
                    "message": {
                      "type": "string",
                      "description": "A human-readable summary."
                    },
                    "workflowId": {
                      "type": "string",
                      "description": "ID of the background job running the action."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unknown action or strategy, `safeMode` with `rolling`, no instance is in a state the action can run from (or, with `adoptSeccompProfile`, every instance is stopped), or the cluster has too many instances for one action."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You are not an admin of the organization, or your account is inactive."
          },
          "404": {
            "description": "The cluster does not exist, or you cannot view it."
          },
          "409": {
            "description": "The cluster's status does not allow this action, another change is in progress on the cluster, an instance has its own stop, start or restart in progress, or an instance is out of service for maintenance."
          },
          "503": {
            "description": "The cluster is briefly busy with another request. Retry."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string",
                    "enum": [
                      "parallel",
                      "rolling"
                    ],
                    "description": "`parallel` acts on every instance at once (the default for `stop` and `start`). `rolling` acts on one instance at a time (the default for `restart`)."
                  },
                  "safeMode": {
                    "type": "boolean",
                    "description": "Start or restart in safe mode. Only with the `parallel` strategy."
                  },
                  "adoptSeccompProfile": {
                    "type": "boolean",
                    "description": "On `start` or `restart`, recreate running containers that were created under an older seccomp profile. Stopped instances are skipped. Only with the `rolling` strategy."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/Cluster/{id}/usage": {
      "get": {
        "summary": "Get cluster usage.",
        "description": "Get cluster usage.\n\nReturns how much of its plan allowances the cluster has used in the current term, for each region and in total.\nSelf-hosted clusters report no usage: `selfManaged` is `true`, `regions` is empty and the other fields are `null`.\n\nEach metric in `regions[].metrics` is `{ used, limit, unlimited, limitKnown }`. `limit` is `null` when the plan\nhas no limit for it (`unlimited` is `true`) or the limit is not known (`limitKnown` is `false`). Metrics are\n`reads`, `readBytes`, `writes`, `writeBytes`, `realTimeMessages`, `realTimeBytes`, `cpuTimeHours` and\n`storageBytes`. `storageBytes` reports the region's fullest instance against that instance's disk.\n\n**Authentication:** API token or session\n\n**Authorization:** Permission to view the cluster",
        "tags": [
          "Cluster"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The cluster's ID."
          }
        ],
        "responses": {
          "200": {
            "description": "The usage summary.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "clusterId": {
                      "type": "string",
                      "description": "The cluster's ID."
                    },
                    "selfManaged": {
                      "type": "boolean",
                      "description": "`true` for a self-hosted cluster, which has no usage to report."
                    },
                    "renewsAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "When the current term ends, or `null` if the cluster has no active plan."
                    },
                    "totals": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "Usage summed across regions, by metric, each as `{ used }`."
                    },
                    "mostConstrained": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "description": "The metric and region closest to its limit, or `null`. Has `metric`, `region`, `regionIds`, `used`, `limit` and `utilization` (`used` / `limit`, above 1 when over the limit). Storage is not considered."
                    },
                    "regions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "region": {
                            "type": "string",
                            "description": "Region display name."
                          },
                          "regionIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "Region IDs grouped under this name. Several tiers of one region, such as `us-1` and `us-2`, share a display name."
                          },
                          "activeBlockCount": {
                            "type": "integer",
                            "description": "How many plan purchases are current in this region."
                          },
                          "planId": {
                            "type": "string",
                            "description": "The region's plan `id`."
                          },
                          "planName": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The plan's display name."
                          },
                          "planLevel": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "The plan's tier, as in **List plans**."
                          },
                          "status": {
                            "type": "string",
                            "description": "`active` while the region has a current plan term. Otherwise `exhausted` if a limit was used up, or `lapsed` if the term ended."
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "When the region's plan term ends, or `null` if it does not expire."
                          },
                          "metrics": {
                            "type": "object",
                            "description": "Usage by metric, each as `{ used, limit, unlimited, limitKnown }`."
                          },
                          "rateLimits": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "Per-minute limits for the region: `readsPerMinute`, `readsPerMinuteBytes`, `writesPerMinute`, `writesPerMinuteBytes`, `realTimeDeliveriesPerMinute`, `realTimeDeliveryBytesPerMinute` and `tlsHandshakes`. Each is `{ limit, unlimited, limitKnown }`, or `null` when the plan sets no such limit. The whole field is `null` if the region has no plan."
                          },
                          "resourcesPerInstance": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "description": "What each instance in the region gets, as in **List plans**."
                          }
                        }
                      },
                      "description": "Usage per region, grouped by display name."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "Your account is inactive."
          },
          "404": {
            "description": "The cluster does not exist, or you cannot view it."
          }
        }
      }
    },
    "/Domain/": {
      "get": {
        "summary": "List custom domains.",
        "description": "List custom domains.\n\nLists every domain registered to your organization, validated or not.\n\n**Authentication:** API token or session\n\n**Authorization:** Member of the organization",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your organization's ID."
          }
        ],
        "responses": {
          "200": {
            "description": "The domains.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Domain ID."
                      },
                      "organizationId": {
                        "type": "string",
                        "description": "Your organization's ID."
                      },
                      "domain": {
                        "type": "string",
                        "description": "The hostname."
                      },
                      "status": {
                        "type": "string",
                        "description": "`PENDING_VALIDATION` until validated, then `ACTIVE`."
                      },
                      "clusterId": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "description": "The cluster serving the domain, or `null`/absent if none."
                      },
                      "challengeTxtRecord": {
                        "type": "string",
                        "description": "Name of the TXT record that proves you control the domain."
                      },
                      "challengeToken": {
                        "type": "string",
                        "description": "Value that TXT record must hold."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`organizationId` is missing."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You are not a member of the organization."
          }
        }
      },
      "post": {
        "summary": "Register a custom domain.",
        "description": "Register a custom domain.\n\nRegisters a hostname, such as `shop.example.com`, so a cluster can serve it. The name is trimmed and stored in lowercase.\n\nTo use a custom domain:\n\n1. Register it here.\n2. Create a DNS TXT record named `challengeTxtRecord` with the value `challengeToken`.\n3. Call **Validate a custom domain**.\n4. Add the domain's `id` to the cluster's `domainIds` with **Update a cluster**.\n5. Create a DNS CNAME record pointing the domain at the cluster's `fqdn`.\n\nMore than one organization can register the same name. The first to validate it owns it.\n\n**Authentication:** API token or session\n\n**Authorization:** Organization admin",
        "tags": [
          "Domain"
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "The registered domain.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Domain ID. Use it with **Validate a custom domain** and in a cluster's `domainIds`."
                    },
                    "status": {
                      "type": "string",
                      "description": "`PENDING_VALIDATION` until the domain is validated."
                    },
                    "challengeTxtRecord": {
                      "type": "string",
                      "description": "Name of the TXT record to create: `_fabric.<domain>`."
                    },
                    "challengeToken": {
                      "type": "string",
                      "description": "Value the TXT record must hold."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The domain is not a valid hostname, is a Fabric cluster's hostname or a name under it, or the organization is not active."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You are not an admin of the organization."
          },
          "409": {
            "description": "The name has already been validated, by your organization or another."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string",
                    "description": "Your organization's ID."
                  },
                  "domain": {
                    "type": "string",
                    "description": "The hostname to register, such as `shop.example.com`."
                  }
                },
                "required": [
                  "organizationId",
                  "domain"
                ]
              }
            }
          }
        }
      }
    },
    "/Domain/{id}": {
      "delete": {
        "summary": "Delete a custom domain.",
        "description": "Delete a custom domain.\n\nA domain a cluster still serves cannot be deleted. Remove it from the cluster's `domainIds` with **Update a\ncluster** first.\n\n**Authentication:** API token or session\n\n**Authorization:** Organization admin",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The domain's ID."
          }
        ],
        "responses": {
          "204": {
            "description": "The domain is deleted."
          },
          "400": {
            "description": "A cluster still serves the domain."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You are not an admin of the organization."
          },
          "404": {
            "description": "The domain does not exist."
          },
          "503": {
            "description": "The domain was briefly busy and nothing changed. Retry."
          }
        }
      }
    },
    "/Domain/{id}/validate": {
      "post": {
        "summary": "Validate a custom domain.",
        "description": "Validate a custom domain.\n\nChecks DNS for a TXT record at `challengeTxtRecord` holding `challengeToken`. If found, the domain becomes\n`ACTIVE` and can be added to a cluster with **Update a cluster**. DNS changes can take a few minutes to\npropagate, so retry if the record is not found yet.\n\n**Authentication:** API token or session\n\n**Authorization:** Organization admin",
        "tags": [
          "Domain"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The domain's ID."
          }
        ],
        "responses": {
          "200": {
            "description": "The domain is active.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A human-readable confirmation."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The TXT record is missing or does not hold the token, the domain is already active, or the organization is not active."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You are not an admin of the organization."
          },
          "404": {
            "description": "The domain does not exist."
          },
          "409": {
            "description": "Another registration of this name, in your organization or another, was validated first."
          },
          "503": {
            "description": "The domain was briefly busy and nothing changed. Retry."
          }
        }
      }
    },
    "/HDBInstance/{id}/container/{action}": {
      "post": {
        "summary": "Stop, start or restart an instance.",
        "description": "Stop, start or restart an instance.\n\nRuns the action on one instance of a cluster. The request returns as soon as the action is accepted. Poll **Get\na cluster** and read the instance's `status` to follow it.\n\n**Authentication:** API token or session\n\n**Authorization:** Organization admin",
        "tags": [
          "HDBInstance"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The instance's ID, from `instances` in **Get a cluster**."
          },
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "stop",
                "start",
                "restart"
              ]
            },
            "description": "The action to run."
          }
        ],
        "responses": {
          "200": {
            "description": "The accepted action.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "instanceId": {
                      "type": "string",
                      "description": "The instance's ID."
                    },
                    "action": {
                      "type": "string",
                      "description": "The action being run."
                    },
                    "status": {
                      "type": "string",
                      "description": "The instance's status while the action runs, such as `RESTARTING`."
                    },
                    "message": {
                      "type": "string",
                      "description": "A human-readable summary."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Unknown action, or the instance's status does not allow this action."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You are not an admin of the organization, or your account is inactive."
          },
          "404": {
            "description": "The instance does not exist."
          },
          "409": {
            "description": "The instance is already mid-action, a change is running on its cluster, a `stop` or `restart` would leave no instance serving while another is out of service (`force` overrides this one), or it is being taken out of or returned to service (wait and retry). Also returned for `adoptSeccompProfile` on a stopped instance, which adopts the profile on its next plain start."
          },
          "503": {
            "description": "The instance or its cluster is briefly busy with another request. Retry."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "safeMode": {
                    "type": "boolean",
                    "description": "Start or restart in safe mode."
                  },
                  "adoptSeccompProfile": {
                    "type": "boolean",
                    "description": "On `start` or `restart`, recreate the running container if it was created under an older seccomp profile. Refused with 409 on a stopped instance, which adopts the profile at its next plain start."
                  },
                  "force": {
                    "type": "boolean",
                    "description": "Run a `stop` or `restart` even though it would leave no instance serving while another is out of service for maintenance."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/HarperVersions/": {
      "get": {
        "summary": "List Harper versions.",
        "description": "List Harper versions.\n\nLists the Harper versions you can deploy. Pass a `version` from this list as `version` on **Create a cluster**\nor **Update a cluster**; a version your organization is not offered is refused, unless one of its clusters already\nruns it or, for now, Harper released that build to your organization alone without listing it.\n\nWith `organizationId`, the list also includes versions Harper released to your organization alone (`scoped: true`),\nsuch as an early-access build or an older build your organization stays on.\nEnterprise organizations also see the versions their clusters already run, labelled `deployed on <cluster>`.\nBuilds Harper has paused are not listed.\n\n**Authentication:** API token or session\n\n**Authorization:** Read access to the organization",
        "tags": [
          "HarperVersions"
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Your organization's ID. Required with an API token."
          }
        ],
        "responses": {
          "200": {
            "description": "The versions, under `value`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "value": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Label. `stable` is the recommended version and the default for new clusters."
                          },
                          "version": {
                            "type": "string",
                            "description": "The Harper version, such as `5.3.2`."
                          },
                          "scoped": {
                            "type": "boolean",
                            "description": "`true` for a version released to your organization alone. Absent otherwise."
                          }
                        }
                      },
                      "description": "The versions."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You may not read the organization, or you used an API token without `organizationId`."
          }
        }
      }
    },
    "/Location/": {
      "get": {
        "summary": "List locations.",
        "description": "List locations.\n\nLists the cloud data centers Fabric runs in, and the regions each one serves. A region spreads its instances\nacross one or more locations.\n\n**Authentication:** API token or session\n\n**Authorization:** Read access to the organization",
        "tags": [
          "Location"
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Your organization's ID. Required with an API token."
          },
          {
            "name": "availableHosts",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`true` to return only locations that have a host dedicated to your organization (with `organizationId`), or a shared host (without it)."
          }
        ],
        "responses": {
          "200": {
            "description": "The locations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Location ID, such as `gcp-us-east1-b`."
                      },
                      "cloudProvider": {
                        "type": "string",
                        "description": "Cloud provider, such as `gcp` or `linode`."
                      },
                      "location": {
                        "type": "string",
                        "description": "The provider's name for the location, such as `us-east1-b`."
                      },
                      "locationName": {
                        "type": "string",
                        "description": "City and country, for display."
                      },
                      "regions": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Display names of the regions this location serves, as `region` in **List regions**."
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You may not read the organization, or you used an API token without `organizationId`."
          }
        }
      }
    },
    "/Login/": {
      "post": {
        "summary": "Log in.",
        "description": "Log in.\n\nSigns in with an email and password. The response sets a session cookie (`Set-Cookie`); send it on later\nrequests instead of an API token.\n\n**Authentication:** None",
        "tags": [
          "Login"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The signed-in user.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "User ID."
                    },
                    "email": {
                      "type": "string",
                      "description": "Email address."
                    },
                    "firstname": {
                      "type": "string",
                      "description": "First name."
                    },
                    "lastname": {
                      "type": "string",
                      "description": "Last name."
                    },
                    "status": {
                      "type": "string",
                      "description": "`ACTIVE` for a user who can sign in."
                    },
                    "roles": {
                      "type": "object",
                      "description": "Your role in each organization, keyed by organization ID, as in **Get the current user**."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is invalid."
          },
          "401": {
            "description": "Wrong email or password."
          },
          "403": {
            "description": "The email is not verified, the account is deactivated, or it must sign in with single sign-on."
          },
          "409": {
            "description": "More than one account matches the email."
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Your email address."
                  },
                  "password": {
                    "type": "string",
                    "description": "Your password."
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        }
      }
    },
    "/Logout/": {
      "post": {
        "summary": "Log out.",
        "description": "Log out.\n\nEnds the current session. Its cookie stops working.\n\n**Authentication:** Session",
        "tags": [
          "Logout"
        ],
        "parameters": [],
        "responses": {
          "204": {
            "description": "Logged out."
          },
          "401": {
            "description": "No active session."
          }
        }
      }
    },
    "/Organization/{id}": {
      "get": {
        "summary": "Get an organization.",
        "description": "Get an organization.\n\nReturns the organization and the clusters your role can view. This is how you list your clusters. A role that\ngrants view on selected clusters lists only those.\n\nCluster entries carry the cluster-level fields listed below, but not instances or plan purchases. Call **Get a\ncluster** for those.\n\n**Authentication:** API token or session\n\n**Authorization:** Member of the organization; `clusters` lists only the clusters the role can view",
        "tags": [
          "Organization"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Your organization's ID."
          }
        ],
        "responses": {
          "200": {
            "description": "The organization.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The organization's ID."
                    },
                    "name": {
                      "type": "string",
                      "description": "Display name."
                    },
                    "subdomain": {
                      "type": "string",
                      "description": "The organization's part of its clusters' hostnames."
                    },
                    "status": {
                      "type": "string",
                      "description": "`ACTIVE` for an organization in good standing."
                    },
                    "type": {
                      "type": "string",
                      "description": "`SELF_SERVICE` or `ENTERPRISE`."
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the organization was created."
                    },
                    "clusters": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "Cluster ID. Use it with **Get a cluster**."
                          },
                          "organizationId": {
                            "type": "string",
                            "description": "Your organization's ID."
                          },
                          "name": {
                            "type": "string",
                            "description": "Display name."
                          },
                          "abbreviatedName": {
                            "type": "string",
                            "description": "Short name, used in `fqdn`."
                          },
                          "status": {
                            "type": "string",
                            "description": "Status, as in **Get a cluster**."
                          },
                          "failureReason": {
                            "type": "string",
                            "description": "Why the cluster failed. Present when `status` is `FAILED`."
                          },
                          "workflowId": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ID of the background change holding the cluster, or `null`, as in **Get a cluster**."
                          },
                          "fqdn": {
                            "type": "string",
                            "description": "The cluster's hostname."
                          },
                          "plans": {
                            "type": "array",
                            "items": {
                              "type": "object"
                            },
                            "description": "Region plans: `regionId`, `region`, `planId` and `autoRenew`."
                          },
                          "domainIds": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "IDs of the custom domains the cluster serves."
                          },
                          "generateDomainCerts": {
                            "type": "boolean",
                            "description": "Whether Fabric issues TLS certificates for the custom domains."
                          },
                          "recordLocks": {
                            "type": "boolean",
                            "description": "The cluster's record-lock setting. Absent if never set."
                          },
                          "sharding": {
                            "type": "object",
                            "description": "Shard settings on a sharded cluster, as in **Get a cluster**."
                          },
                          "preset": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The Studio preset the cluster was created from. Absent or `null` for a blank cluster."
                          },
                          "lastContainerAction": {
                            "type": "string",
                            "description": "The last `stop`, `start` or `restart` run on the whole cluster."
                          },
                          "lastContainerActionAt": {
                            "type": "string",
                            "description": "When that action ran."
                          },
                          "createdAt": {
                            "type": "string",
                            "description": "When the cluster was created."
                          },
                          "updatedAt": {
                            "type": "string",
                            "description": "When the cluster was last changed."
                          },
                          "terminatedAt": {
                            "type": "string",
                            "description": "When the cluster was deleted. Absent for a live cluster."
                          }
                        }
                      },
                      "description": "The organization's clusters that your role can view, including deleted ones (`status` `TERMINATED`, or `FAILED` with `terminatedAt` set)."
                    },
                    "settings": {
                      "type": "object",
                      "description": "Organization settings.",
                      "properties": {
                        "apiTokensEnabled": {
                          "type": "boolean",
                          "description": "Whether organization API tokens are allowed."
                        },
                        "oauthConfigs": {
                          "type": "array",
                          "items": {
                            "type": "object"
                          },
                          "description": "Single sign-on providers, each with `provider`, `domain`, `enabled` and `required`. Client credentials are masked."
                        }
                      }
                    },
                    "billing": {
                      "type": "object",
                      "description": "Payment method summary (`paymentMethod` with `brand`, `last4`, `expMonth`, `expYear`), billing address, and any billing `alerts`."
                    },
                    "clusterSyncSummaries": {
                      "type": "object",
                      "description": "Keyed by cluster ID, for listed clusters with an instance still copying its data from another instance: `{ syncing, progress }`. `syncing` is how many instances are copying; `progress` is the slowest one's fraction copied (0 to 1), absent when not yet known. Empty when nothing is copying."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You are not a member of the organization, or your account is inactive."
          },
          "404": {
            "description": "The organization does not exist."
          }
        }
      }
    },
    "/Plan/": {
      "get": {
        "summary": "List plans.",
        "description": "List plans.\n\nLists the plans you can deploy a cluster on. Pass a plan's `id` as `planId` in `regionPlans` on **Create a\ncluster** or **Update a cluster**. Without `organizationId`, only the plans offered to every organization are\nreturned.\n\n**Authentication:** API token or session\n\n**Authorization:** Read access to the organization",
        "tags": [
          "Plan"
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Your organization's ID. Required with an API token."
          }
        ],
        "responses": {
          "200": {
            "description": "The plans.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Plan ID, such as `fabric-block-level-0`."
                      },
                      "name": {
                        "type": "string",
                        "description": "Display name."
                      },
                      "status": {
                        "type": "string",
                        "description": "`ACTIVE` for a plan you can deploy."
                      },
                      "planLevel": {
                        "type": "integer",
                        "description": "Tier. 0 is the free tier; higher levels have higher limits."
                      },
                      "deploymentType": {
                        "type": "string",
                        "description": "`colocated` (shares hosts with other clusters), `dedicated` (hosts of its own) or `self-hosted` (runs on your own servers)."
                      },
                      "deploymentDescription": {
                        "type": "string",
                        "description": "`deploymentType` for display."
                      },
                      "performanceDescription": {
                        "type": "string",
                        "description": "Throughput, for display."
                      },
                      "priceUsd": {
                        "type": "number",
                        "description": "Price in US dollars. 0 for a free plan."
                      },
                      "resourcesPerInstance": {
                        "type": "object",
                        "description": "What each instance gets: `storageGb`, `memoryMb`, `cpuCores`, `threads`, `readIopsLimit` and `writeIopsLimit`. Absent on dedicated and self-hosted plans, whose instances use the whole host."
                      },
                      "planLimits": {
                        "type": "object",
                        "description": "Usage allowed per term: totals such as `totalReadCount`, `totalWriteCount` and `storageBytes`, per-minute rates such as `readsPerMinuteCount`, and the term length in `expirationMonths`. **Get cluster usage** reports usage against these."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A `select` or `sort` names a field the response does not include."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You may not read the organization, or you used an API token without `organizationId`."
          }
        }
      }
    },
    "/Region/": {
      "get": {
        "summary": "List regions.",
        "description": "List regions.\n\nLists the regions you can deploy a cluster to, including any reserved for your organization. Pass a region's\n`id` as `regionId` in `regionPlans` on **Create a cluster** or **Update a cluster**.\n\n**Authentication:** API token or session\n\n**Authorization:** Read access to the organization",
        "tags": [
          "Region"
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Your organization's ID. Required with an API token."
          },
          {
            "name": "availableHosts",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "`true` to return only regions with capacity available now."
          }
        ],
        "responses": {
          "200": {
            "description": "The regions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Region ID, such as `us-1`."
                      },
                      "region": {
                        "type": "string",
                        "description": "Display name."
                      },
                      "latencyDescription": {
                        "type": "string",
                        "description": "Expected latency and how widely the region spreads its instances, for display."
                      },
                      "instanceCount": {
                        "type": "integer",
                        "description": "How many instances a cluster gets in this region."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A `select` or `sort` names a field the response does not include."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "You may not read the organization, or you used an API token without `organizationId`."
          }
        }
      }
    },
    "/SecretsPublicKey/{id}": {
      "get": {
        "summary": "Get a cluster's secrets key.",
        "description": "Get a cluster's secrets key.\n\nReturns the public key for encrypting secret values for a cluster. Encrypt each value with it, then store the\nresult with the `set_secret` operation on the cluster's operations API. Fabric never sees the plain value.\n\nClusters created before secrets keys existed have no key yet. The first call by someone allowed to update the\ncluster creates one, which restarts the cluster's instances so they pick it up.\n\n**Authentication:** API token or session\n\n**Authorization:** Permission to view the cluster; permission to update it to create the key on first use",
        "tags": [
          "SecretsPublicKey"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The cluster's ID."
          }
        ],
        "responses": {
          "200": {
            "description": "The public key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publicKey": {
                      "type": "string",
                      "description": "The public key, PEM-encoded."
                    },
                    "fingerprint": {
                      "type": "string",
                      "description": "SHA-256 fingerprint of the key, in hex."
                    },
                    "scheme": {
                      "type": "string",
                      "description": "Format of encrypted values: `enc:v1`."
                    },
                    "algorithm": {
                      "type": "string",
                      "description": "Encryption used: `RSA-OAEP-SHA256 + AES-256-GCM`."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The cluster is self-hosted. Its instances hold their own key."
          },
          "401": {
            "description": "Missing or invalid credentials."
          },
          "403": {
            "description": "Your account is inactive, or you are not a member of the cluster's organization."
          },
          "404": {
            "description": "The cluster does not exist or you cannot view it, or it has no key yet and you may not create one."
          }
        }
      }
    },
    "/User/current": {
      "get": {
        "summary": "Get the current user.",
        "description": "Get the current user.\n\nReturns the signed-in user and their role in each organization they belong to. Use it to find your\norganization IDs. Organization API tokens cannot call it.\n\n**Authentication:** Session",
        "tags": [
          "User"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The user.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "User ID."
                    },
                    "email": {
                      "type": "string",
                      "description": "Email address."
                    },
                    "firstname": {
                      "type": "string",
                      "description": "First name."
                    },
                    "lastname": {
                      "type": "string",
                      "description": "Last name."
                    },
                    "status": {
                      "type": "string",
                      "description": "`ACTIVE` for a user who can sign in."
                    },
                    "createdAt": {
                      "type": "string",
                      "description": "When the account was created."
                    },
                    "lastLoginDate": {
                      "type": "string",
                      "description": "When the user last signed in."
                    },
                    "roles": {
                      "type": "object",
                      "description": "Your role in each organization, keyed by organization ID. Each entry has `organizationName`, the role name as `role`, and what the role allows under `organization`, including cluster permissions. If an organization requires single sign-on and this session did not use it, the entry has only `organizationName` and the sign-in providers to use, as `oauthProviders`."
                    },
                    "oauthConfigId": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The organization single sign-on configuration this session used, or `null` for a password or a global provider."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "No session, or an invalid one."
          },
          "403": {
            "description": "You used an organization API token, or your account is inactive."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {}
  }
}