{
  "openapi": "3.1.0",
  "info": {
    "title": "Cubecen API",
    "version": "1.0.0",
    "description": "Deploy and manage cubes from your own scripts, CI jobs and programs.\n\nThe base URL is `https://api.cubecen.com`. Requests and answers are JSON unless an operation says otherwise.\n\nAuthenticate every request with an API key: `Authorization: Bearer cbc_...`. A key works in one organization, and a read-only key can call only the operations marked `read`.\n\nWhat the dashboard calls a cube, the API calls an application. Paths and field names say `applications` and `application_id`; this text says cube.\n\nRequests that start work, such as a build, need an `Idempotency-Key` header, so that a retry never starts the work twice. Errors share one shape and carry a stable `code`. Retry a 5xx answer with backoff. A key may make 120 requests a minute.\n",
    "x-cubecen-error-codes": [
      {
        "code": "VALIDATION_ERROR",
        "meaning": "The request is not valid. `error.field` names the field to blame, when there is one."
      },
      {
        "code": "UNAUTHENTICATED",
        "meaning": "The API key is missing, unknown, expired or revoked."
      },
      {
        "code": "FORBIDDEN",
        "meaning": "The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's."
      },
      {
        "code": "API_KEY_NOT_ALLOWED",
        "meaning": "The operation is not available to API keys. It belongs to the dashboard."
      },
      {
        "code": "NOT_FOUND",
        "meaning": "Nothing was found at this address. Check the IDs, slugs and query values in the request."
      },
      {
        "code": "CONFLICT",
        "meaning": "The request conflicts with the current state of the resource, or it expired and needs a new `Idempotency-Key`."
      },
      {
        "code": "PLAN_LIMIT_REACHED",
        "meaning": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit."
      },
      {
        "code": "RATE_LIMITED",
        "meaning": "The key made too many requests. Wait for the seconds in `Retry-After`, then retry."
      },
      {
        "code": "INTERNAL_ERROR",
        "meaning": "Something went wrong on our side. Retry; if it keeps failing, give support the `error.requestId`."
      },
      {
        "code": "DATABASE_UNAVAILABLE",
        "meaning": "The service is temporarily unavailable. Retry the same request with backoff."
      },
      {
        "code": "MAINTENANCE",
        "meaning": "The platform is in maintenance. Builds and other changes are paused for a short while; retry after the seconds in `Retry-After`."
      },
      {
        "code": "IDEMPOTENCY_KEY_REUSED",
        "meaning": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action."
      },
      {
        "code": "BUILD_IN_PROGRESS",
        "meaning": "This commit is already queued or being built."
      },
      {
        "code": "DEPLOYMENT_IN_PROGRESS",
        "meaning": "A release of this cube is already in progress. Wait for it, or cancel it."
      },
      {
        "code": "APPLICATION_NOT_READY",
        "meaning": "The cube is still being created, or its creation failed."
      },
      {
        "code": "BUSY",
        "meaning": "Another operation on this cube is in progress. Retry in a few seconds."
      },
      {
        "code": "BUILD_NOT_DEPLOYABLE",
        "meaning": "Only a successful build can be deployed. Check the build's `release_status`. The message differs from case to case, so match on the code."
      },
      {
        "code": "SIZE_UNAVAILABLE",
        "meaning": "The size is not offered right now. Choose a smaller size."
      },
      {
        "code": "INSTALLATION_NOT_FOUND",
        "meaning": "The GitHub installation is not one of the organization's. Check `github_installation_id`."
      },
      {
        "code": "ENV_VERSION_UNAVAILABLE",
        "meaning": "The values of that environment version are no longer kept, or can no longer be read, so it cannot be restored or compared."
      },
      {
        "code": "REPOSITORY_NOT_ACCESSIBLE",
        "meaning": "Cubecen cannot read the repository: the access was removed, GitHub blocks it, or a public repository is no longer public or has moved."
      },
      {
        "code": "REVISION_NOT_FOUND",
        "meaning": "The branch, tag or commit does not exist in the repository."
      },
      {
        "code": "REPOSITORY_EMPTY",
        "meaning": "The repository has no commits yet. Push a commit, then try again with a new `Idempotency-Key`."
      },
      {
        "code": "GITHUB_INSTALLATION_REMOVED",
        "meaning": "The Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again."
      },
      {
        "code": "GITHUB_INSTALLATION_SUSPENDED",
        "meaning": "The Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub."
      },
      {
        "code": "GITHUB_PERMISSIONS_MISSING",
        "meaning": "The GitHub account has not approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub."
      },
      {
        "code": "DATABASE_NOT_READY",
        "meaning": "The database is not ready yet. Wait until its `status` is `ready`, then try again with a new `Idempotency-Key`."
      },
      {
        "code": "DATABASE_REFERENCED",
        "meaning": "Cubes refer to the database: `error.cubes` names them. Remove or change those references first."
      },
      {
        "code": "DATABASES_UNAVAILABLE",
        "meaning": "Databases are temporarily unavailable. Retry the same request with backoff."
      },
      {
        "code": "ENV_REFERENCE_BROKEN",
        "meaning": "A variable refers to a cube or database that is no longer in the project, or to a database that is being deleted. Change the variable, then try again with a new `Idempotency-Key`."
      },
      {
        "code": "GITHUB_UNAVAILABLE",
        "meaning": "GitHub is temporarily unavailable. Retry the same request."
      },
      {
        "code": "GITHUB_RATE_LIMITED",
        "meaning": "GitHub's rate limit was reached. Retry after the seconds in `Retry-After`."
      },
      {
        "code": "LOGS_UNAVAILABLE",
        "meaning": "Logs are temporarily unavailable. Retry the same request with backoff."
      },
      {
        "code": "METRICS_UNAVAILABLE",
        "meaning": "Metrics are temporarily unavailable. Retry after the seconds in `Retry-After`."
      },
      {
        "code": "ENV_CHANGED",
        "meaning": "The variables changed since you read them: `expected_version` is not the current version. Read them again, check your change and send it again."
      },
      {
        "code": "ENV_TOO_LARGE",
        "meaning": "The variables are over a limit. A cube can have 200 entries, a value can be 64 KiB, and keys and values together can be 256 KiB."
      },
      {
        "code": "ENV_KEY_RESERVED",
        "meaning": "The key is set by the platform, such as `PORT` or a name that starts with `CUBECEN_`. Choose another key."
      },
      {
        "code": "DOMAIN_TAKEN",
        "meaning": "The hostname is taken. Another cube serves it, or this cube already has it. A domain can also fail with this code in its `error`, when another cube proved the hostname first."
      },
      {
        "code": "DOMAIN_LIMIT_REACHED",
        "meaning": "The cube has as many custom domains as it can have, 10. Remove one first."
      },
      {
        "code": "REQUEST_TIMEOUT",
        "meaning": "The request took too long and was stopped. Retry the same request with backoff."
      }
    ]
  },
  "servers": [
    {
      "url": "https://api.cubecen.com"
    }
  ],
  "tags": [
    {
      "name": "organization",
      "x-displayName": "Organization",
      "description": "The organization your key belongs to, and who you are: the current user, the organization, its plan, its usage and a summary."
    },
    {
      "name": "projects",
      "x-displayName": "Projects",
      "description": "Projects group the cubes of an organization."
    },
    {
      "name": "databases",
      "x-displayName": "Databases",
      "description": "Postgres databases of a project, next to its cubes: create them, connect cubes to them, read their connection and usage, reset their password and delete them."
    },
    {
      "name": "cubes",
      "x-displayName": "Cubes",
      "description": "A cube is an application deployed from a Git repository. Create, read, change and delete cubes, and list the folders of their repository."
    },
    {
      "name": "builds",
      "x-displayName": "Builds",
      "description": "A build turns a commit of a cube's repository into an image, and can deploy it."
    },
    {
      "name": "deployments",
      "x-displayName": "Deployments",
      "description": "A deployment runs a build as the live version of a cube. Deploy a build again, or roll back to an earlier one."
    },
    {
      "name": "releases",
      "x-displayName": "Releases",
      "description": "A release is a build and the deployment that follows it. The list is a cube's history."
    },
    {
      "name": "logs",
      "x-displayName": "Logs and metrics",
      "description": "The logs of builds, deployments and running cubes, and the metrics of a cube."
    },
    {
      "name": "environment",
      "x-displayName": "Environment",
      "description": "The variables and secrets of a cube, their history, and how to compare and restore versions."
    },
    {
      "name": "domains",
      "x-displayName": "Domains",
      "description": "The custom domains of a cube."
    },
    {
      "name": "previews",
      "x-displayName": "Previews",
      "description": "A preview is a copy of a cube built from an open pull request."
    },
    {
      "name": "github",
      "x-displayName": "GitHub",
      "description": "The GitHub installations and repositories cubes can be created from."
    }
  ],
  "security": [
    {
      "APIKeyBearer": []
    }
  ],
  "paths": {
    "/v1/users/me": {
      "get": {
        "operationId": "getCurrentUser",
        "tags": [
          "organization"
        ],
        "summary": "Get the current user",
        "description": "Returns the person the API key acts as: the key's owner.\n\nUse it to check that a key works, and to see who the builds and changes made with it are credited to. The `id` is the one that `created_by` shows on builds, deployments and projects.\n\nA key acts with its owner's role in its organization. If the owner has left the organization, or can no longer read it, the request is refused.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The user the key acts as.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/User"
                },
                "example": {
                  "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "email": "ada@example.com",
                  "email_verified": true,
                  "first_name": "Ada",
                  "last_name": "Lovelace",
                  "avatar_url": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden403"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable5032"
          }
        }
      }
    },
    "/v1/organizations": {
      "get": {
        "operationId": "listOrganizations",
        "tags": [
          "organization"
        ],
        "summary": "List organizations",
        "description": "Returns the organizations the API key can act in.\n\nA key belongs to one organization, so the list holds that organization and no other, whatever others its owner belongs to. Use it to find the `id` and `slug` of the key's organization: paths take either one as `{organizationId}`.\n\nThe answer is a page, with `data` and `after`. A key lists one organization, so `after` is always `null` and the first page is the only page. `limit` and `after` are still checked, and a value that is not valid is refused with `400`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most organizations to return in a page, from 1 to 100. The default is 25.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "Where the next page starts: an opaque value of at most 512 characters. Send the `after` of the previous page as it is. A key never has a next page, so leave it out.",
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page with the key's organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPage"
                },
                "example": {
                  "data": [
                    {
                      "id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                      "name": "Acme",
                      "slug": "acme",
                      "status": "active",
                      "default_project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                      "created_at": "2026-09-14T08:25:41Z",
                      "updated_at": "2026-09-14T08:30:12Z"
                    }
                  ],
                  "after": null
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "VALIDATION_ERROR": {
                    "summary": "limit is not a number from 1 to 100, or after is too long",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden403"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable5032"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}": {
      "get": {
        "operationId": "getOrganization",
        "tags": [
          "organization"
        ],
        "summary": "Get an organization",
        "description": "Returns an organization: its name, slug, default project and dates.\n\nA key can read only its own organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.\n\n`default_project_id` is the project that new cubes go to by default. It is `null` when the organization has none.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The organization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Organization"
                },
                "example": {
                  "id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "name": "Acme",
                  "slug": "acme",
                  "status": "active",
                  "default_project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "created_at": "2026-09-14T08:25:41Z",
                  "updated_at": "2026-09-14T08:30:12Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "description": "The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "other_id": {
                    "summary": "The ID is another organization's",
                    "value": {
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Access denied",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "other_slug": {
                    "summary": "The slug is another organization's, or names no organization",
                    "value": {
                      "error": {
                        "code": "FORBIDDEN",
                        "message": "Permission denied",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "The ID matches no organization",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable5032"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/plan": {
      "get": {
        "operationId": "getOrganizationPlan",
        "tags": [
          "organization"
        ],
        "summary": "Get the plan of an organization",
        "description": "Returns the plan the organization is on, what the plan allows, and what the organization has used so far.\n\nUse it before you create a cube or start a build, to see how much room is left, or to warn when a limit is close. `plan` names the plan and the period that its build minutes and bandwidth count in. `limits` holds what the plan allows, and a limit of `null` has no ceiling. `usage` holds what the organization has used. `over_limit` lists the limits it has passed, and `near_limit` the ones that are at least 80 percent used but not yet used up. `sizes` lists the sizes a cube can have.\n\nWhen `plan.overage` is `false`, as on the Free plan, builds stop once the period's build minutes are used up, and the cubes are paused once its bandwidth is used up. `suspension` is set while they are paused. A cube is not stopped for passing the count of cubes or previews: what already runs keeps running, and no more can be made.\n\nFor the use of each day and of each cube, see `getOrganizationUsage`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The plan, its limits and what the organization has used.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPlan"
                },
                "example": {
                  "plan": {
                    "id": "free",
                    "name": "Free",
                    "overage": false,
                    "trial": false,
                    "period_start": "2026-10-01T00:00:00Z",
                    "period_end": "2026-11-01T00:00:00Z"
                  },
                  "limits": {
                    "cubes": 3,
                    "memory_mib_per_cube": 2048,
                    "previews": 0,
                    "build_minutes": 300,
                    "bandwidth_gb": 10,
                    "metrics_retention_days": 30,
                    "logs_retention_days": 7,
                    "size": "small",
                    "databases": {
                      "count": 0,
                      "max_cu": 0,
                      "storage_gb": 0,
                      "compute_hours": 0,
                      "transfer_gb": 0
                    }
                  },
                  "sizes": [
                    {
                      "size": "small",
                      "name": "Small",
                      "memory_mib": 2048,
                      "cpu": 0.5,
                      "available": true
                    },
                    {
                      "size": "medium",
                      "name": "Medium",
                      "memory_mib": 4096,
                      "cpu": 1,
                      "available": true
                    },
                    {
                      "size": "large",
                      "name": "Large",
                      "memory_mib": 8192,
                      "cpu": 2,
                      "available": false
                    },
                    {
                      "size": "xlarge",
                      "name": "XLarge",
                      "memory_mib": 16384,
                      "cpu": 4,
                      "available": false
                    }
                  ],
                  "usage": {
                    "cubes": 2,
                    "previews": 0,
                    "build_minutes": 42,
                    "bandwidth_bytes": 1834000,
                    "as_of": "2026-10-25T09:30:00Z",
                    "databases": 0
                  },
                  "over_limit": [],
                  "near_limit": [],
                  "suspension": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/usage": {
      "get": {
        "operationId": "getOrganizationUsage",
        "tags": [
          "organization"
        ],
        "summary": "Get the usage of an organization",
        "description": "Returns what the organization used over a range of days: build minutes, bandwidth, the hours its cubes ran and the requests they answered.\n\nWithout `from` and `to`, the range is the current month. The answer holds the `totals` of the range, the use of each day in `days`, and the use of each cube in `cubes`. A day without any use is left out of `days`.\n\nDays are UTC days. `to` is not counted, and the range can be at most 93 days. Usage is collected about every 15 minutes, not as it happens: `as_of` says when it was last collected, so the latest minutes can be missing.\n\nThe amounts the plan counts against its limits are in `getOrganizationPlan`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "The first day to count, as a UTC date: `YYYY-MM-DD`. The default is the first day of the current month.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "The day to stop at, as a UTC date: `YYYY-MM-DD`. This day is not counted. The default is the first day of the next month. It must be after `from`, and at most 93 days after it.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The use of the range, in total, by day and by cube.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationUsage"
                },
                "example": {
                  "from": "2026-10-01",
                  "to": "2026-11-01",
                  "as_of": "2026-10-25T09:30:00Z",
                  "totals": {
                    "build_minutes": 42,
                    "bandwidth_bytes": 1834000,
                    "instance_hours": 57.5,
                    "requests": 4810
                  },
                  "instance_hours_by_size": {
                    "small": 57.5,
                    "medium": 0,
                    "large": 0,
                    "xlarge": 0
                  },
                  "days": [
                    {
                      "day": "2026-10-23",
                      "build_minutes": 12,
                      "bandwidth_bytes": 600000,
                      "instance_hours": 24,
                      "requests": 1500
                    },
                    {
                      "day": "2026-10-24",
                      "build_minutes": 30,
                      "bandwidth_bytes": 900000,
                      "instance_hours": 24,
                      "requests": 2300
                    },
                    {
                      "day": "2026-10-25",
                      "build_minutes": 0,
                      "bandwidth_bytes": 334000,
                      "instance_hours": 9.5,
                      "requests": 1010
                    }
                  ],
                  "cubes": [
                    {
                      "application_id": "b64f2a19-0c83-4d7e-9a15-e2d83c7f5a40",
                      "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                      "name": "api",
                      "slug": "api",
                      "deleted": false,
                      "build_minutes": 12,
                      "bandwidth_bytes": 500000,
                      "instance_hours": 24,
                      "requests": 1000,
                      "previews": {
                        "build_minutes": 0,
                        "bandwidth_bytes": 0,
                        "instance_hours": 0,
                        "requests": 0
                      }
                    },
                    {
                      "application_id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                      "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                      "name": "web",
                      "slug": "web",
                      "deleted": false,
                      "build_minutes": 30,
                      "bandwidth_bytes": 1334000,
                      "instance_hours": 33.5,
                      "requests": 3810,
                      "previews": {
                        "build_minutes": 0,
                        "bandwidth_bytes": 0,
                        "instance_hours": 0,
                        "requests": 0
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "from": {
                    "summary": "from is not a date",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "from and to are UTC days (YYYY-MM-DD), from before to, at most 93 days apart",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "from"
                      }
                    }
                  },
                  "to": {
                    "summary": "to is not a date, is not after from, or is more than 93 days after it",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "from and to are UTC days (YYYY-MM-DD), from before to, at most 93 days apart",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "to"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/summary": {
      "get": {
        "operationId": "getOrganizationSummary",
        "tags": [
          "organization"
        ],
        "summary": "Get a summary of an organization",
        "description": "Returns counts for the organization: its projects, its cubes by state, the releases in progress and the connected GitHub installations.\n\nUse it for a quick look at an organization without listing everything in it. `applications` counts the cubes that still exist: `active` cubes are ready, `creating` cubes are still being set up, and `failed` cubes could not be set up. `live` counts the cubes that have a deployment serving traffic. `releases_in_progress` counts the cubes that have a build or a deployment running now.\n\n`members` and `pending_invitations` are always `null` for an API key: a key cannot see the people of an organization.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The counts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationSummary"
                },
                "example": {
                  "projects": 2,
                  "applications": {
                    "total": 5,
                    "active": 4,
                    "creating": 0,
                    "failed": 1,
                    "live": 3
                  },
                  "releases_in_progress": 1,
                  "github_installations": 1,
                  "members": null,
                  "pending_invitations": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects": {
      "get": {
        "operationId": "listProjects",
        "tags": [
          "projects"
        ],
        "summary": "List projects",
        "description": "Returns the projects of an organization, a page at a time.\n\nUse it to find the `id` or `slug` of a project: other requests take either one in their paths. Projects come oldest first. Pass `q` to keep the projects whose name or slug contains some text, and `sort` to change the order.\n\nThe answer holds up to `limit` projects in `items`. When there are more, it also holds `next_cursor`: send it back as `cursor`, with the same `q` and `sort`, to get the next page. The last page has no `next_cursor`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most projects to return in a page, from 1 to 100. The default is 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where the next page starts: an opaque value. Send the `next_cursor` of the previous page as it is, with the same `q` and `sort`. Leave it out to get the first page. A value that does not belong to this list is refused with `400`.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Keeps the projects whose name or slug contains this text, ignoring case. At most 200 bytes: a character outside plain ASCII takes more than one.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The order of the list. `name` is A to Z, `created` is newest first and `updated` is newest change first. Without `sort`, projects come oldest first.",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "created",
                "updated"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of projects, oldest first unless `sort` says otherwise.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                      "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                      "name": "Storefront",
                      "slug": "storefront",
                      "description": "The web shop and its API",
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "created_at": "2026-09-14T08:30:12Z",
                      "updated_at": "2026-10-02T16:45:03Z",
                      "application_count": 2,
                      "last_release_at": "2026-10-24T09:12:40Z"
                    },
                    {
                      "id": "e8a41f6b-3d52-4c90-b7a8-5f2c1e90d6a3",
                      "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                      "name": "Internal tools",
                      "slug": "internal-tools",
                      "description": "",
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "created_at": "2026-10-01T10:02:51Z",
                      "updated_at": "2026-10-01T10:02:51Z",
                      "application_count": 0,
                      "last_release_at": null
                    }
                  ],
                  "next_cursor": "hStrUFj7kOGKtz4Oq66cc3SuxqbPS3yN_paJdMns"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "limit": {
                    "summary": "limit is not a number from 1 to 100",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "sort": {
                    "summary": "sort is not one of the values",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "sort must be name, created or updated",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "sort"
                      }
                    }
                  },
                  "q": {
                    "summary": "q is longer than 200 characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "q is too long",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "q"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4048"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "post": {
        "operationId": "createProject",
        "tags": [
          "projects"
        ],
        "summary": "Create a project",
        "description": "Creates a project in the organization. A project groups cubes: every cube lives in one project. It needs a key with full access.\n\nSend a `name` and a `slug`. Paths can name the project by its slug, so the slug must be unique among the organization's projects. It is made of lowercase letters, digits and single hyphens, up to 80 characters, and it cannot be an ID. A few slugs are reserved and refused: `projects`, `activity`, `integrations`, `members`, `alerts`, `usage`, `settings` and `new`. `description` is optional.\n\nThe answer is `201 Created` with the project, which has no cubes yet. A slug that another project of the organization already has is refused with `409`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Sending the same request again creates no second project: the slug is taken after the first request has worked, so the repeat is refused with `409` and `CONFLICT`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourceCreate"
              },
              "example": {
                "name": "Storefront",
                "slug": "storefront",
                "description": "The web shop and its API"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The project was created. It has no cubes yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                },
                "example": {
                  "id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "name": "Storefront",
                  "slug": "storefront",
                  "description": "The web shop and its API",
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "created_at": "2026-10-25T09:12:40Z",
                  "updated_at": "2026-10-25T09:12:40Z",
                  "application_count": 0,
                  "last_release_at": null
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "values": {
                    "summary": "name, slug or description is not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "reserved": {
                    "summary": "The slug is reserved",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "This slug is reserved; choose another",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}": {
      "get": {
        "operationId": "getProject",
        "tags": [
          "projects"
        ],
        "summary": "Get a project",
        "description": "Returns one project: its name, slug and description, how many cubes it has, and when the newest release of any of them started.\n\nUse it to read a project by the `id` or `slug` that you have, or to check a project after `updateProject`. The cubes of the project are listed at `/v1/organizations/{organizationId}/projects/{projectId}/applications`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                },
                "example": {
                  "id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "name": "Storefront",
                  "slug": "storefront",
                  "description": "The web shop and its API",
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "created_at": "2026-09-14T08:30:12Z",
                  "updated_at": "2026-10-02T16:45:03Z",
                  "application_count": 2,
                  "last_release_at": "2026-10-24T09:12:40Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "patch": {
        "operationId": "updateProject",
        "tags": [
          "projects"
        ],
        "summary": "Update a project",
        "description": "Changes a project's name, slug or description. It needs a key with full access.\n\nSend only the fields to change, and at least one. A field that you leave out stays as it is. Send `\"description\": null` to clear the description. `name` and `slug` cannot be `null`. The rules for each field are those of `createProject`.\n\nChanging the slug changes the project's address: paths that name the project by its old slug stop working, so use the `id` in paths that you keep. The IDs of the project and of its cubes do not change. The old slug is free for another project afterwards.\n\nThe answer is the project as it is now.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Sending the same update again sets the same values again, so a retry is safe. If the path names the project by a slug that this update changed, the repeat is `404`: name the project by its ID.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResourcePatch"
              },
              "example": {
                "name": "Web shop",
                "description": "The web shop and its API"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The project, with the changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                },
                "example": {
                  "id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "name": "Web shop",
                  "slug": "storefront",
                  "description": "The web shop and its API",
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "created_at": "2026-09-14T08:30:12Z",
                  "updated_at": "2026-10-25T09:20:31Z",
                  "application_count": 2,
                  "last_release_at": "2026-10-24T09:12:40Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "values": {
                    "summary": "No field is sent, or name, slug or description is not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "reserved": {
                    "summary": "The slug is reserved",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "This slug is reserved; choose another",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "delete": {
        "operationId": "deleteProject",
        "tags": [
          "projects"
        ],
        "summary": "Delete a project",
        "description": "Deletes a project and every cube in it. It needs a key with full access. This cannot be undone.\n\nThe request answers `204` once the project is deleted, with no body. Its cubes are deleted with it, and the platform then takes down what they were running. The project's slug can be used again. If the project was the organization's default project, the organization has no default project afterwards.\n\nCheck what the project holds before you delete it: its cubes are listed at `/v1/organizations/{organizationId}/projects/{projectId}/applications`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Deleting the same project again is refused with `404`, because the project is already gone.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The project and its cubes were deleted. The answer has no body."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/databases": {
      "get": {
        "operationId": "listDatabases",
        "tags": [
          "databases"
        ],
        "summary": "List the databases of a project",
        "description": "Returns the Postgres databases of a project, oldest first. It needs only read access.\n\nA database is a project resource next to its cubes. The answer never holds a password: read it with `getDatabaseConnection`.\n\nThe list is paged. `limit` sets the page size, from 1 to 100, and is 20 by default. When there are more, the answer has `next_cursor`: send it as `cursor` to get the next page. The last page has no `next_cursor`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many databases to return, from 1 to 100. The default is 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The `next_cursor` of the previous page, to get the next one.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of databases.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabasePage"
                },
                "example": {
                  "items": [
                    {
                      "id": "2c7e4b19-5a03-4d8f-9e61-b04f7a3d2c58",
                      "slug": "db",
                      "name": "Main DB",
                      "status": "ready",
                      "suspended_reason": null,
                      "grace_ends_at": null,
                      "delete_after": null,
                      "region": "aws-eu-central-1",
                      "postgres_version": 17,
                      "host": "db-a1b2c3-pooler.eu-central-1.example.com",
                      "referenced_by": [
                        {
                          "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                          "slug": "api",
                          "name": "API"
                        }
                      ],
                      "limits": {
                        "max_cu": 1,
                        "storage_gb": 10,
                        "compute_hours": 100,
                        "transfer_gb": 10
                      },
                      "usage": {
                        "compute_hours": 12.4,
                        "storage_gb": 0.3,
                        "transfer_gb": 1.1,
                        "period_start": "2026-10-01T00:00:00Z",
                        "period_end": "2026-11-01T00:00:00Z",
                        "as_of": "2026-10-25T09:00:00Z"
                      },
                      "created_at": "2026-10-20T10:02:11Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4045"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "post": {
        "operationId": "createDatabase",
        "tags": [
          "databases"
        ],
        "summary": "Create a database",
        "description": "Adds a Postgres 17 database to the project. It needs a key with full access.\n\nSend a `name`, 1 to 64 characters, and a `slug`: lowercase letters, digits and single hyphens. The slug is how cubes refer to the database, so it must differ from the slug of every cube and every other database of the project. A slug that is taken is refused with `409` `CONFLICT`.\n\nThe answer is `202 Accepted` with the database in `status` `provisioning`. It becomes `ready` within a minute: read it with `getDatabase` until then.\n\nThe plan sets how many databases an organization can have and how much each can use. The Free plan has none. A database past the plan's count is refused with `402` `PLAN_LIMIT_REACHED`, with `error.limit` set to `databases`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional. A value that is unique to this creation, such as a UUID: 1 to 255 visible ASCII characters. Send the same value when you retry, and the retry returns the first answer. Without it, a retry meets its own slug and is refused with `409` `CONFLICT`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseCreate"
              },
              "example": {
                "name": "Main DB",
                "slug": "db"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The database is being created. Its status is `provisioning`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Database"
                },
                "example": {
                  "id": "2c7e4b19-5a03-4d8f-9e61-b04f7a3d2c58",
                  "slug": "db",
                  "name": "Main DB",
                  "status": "provisioning",
                  "suspended_reason": null,
                  "grace_ends_at": null,
                  "delete_after": null,
                  "region": "aws-eu-central-1",
                  "postgres_version": 17,
                  "host": null,
                  "referenced_by": [],
                  "limits": {
                    "max_cu": 1,
                    "storage_gb": 10,
                    "compute_hours": 100,
                    "transfer_gb": 10
                  },
                  "usage": {
                    "compute_hours": 0,
                    "storage_gb": 0,
                    "transfer_gb": 0,
                    "period_start": "2026-10-01T00:00:00Z",
                    "period_end": "2026-11-01T00:00:00Z",
                    "as_of": null
                  },
                  "created_at": "2026-10-25T11:05:42Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "values": {
                    "summary": "name or slug is missing or not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "The slug must be lowercase letters, digits and hyphens",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "PLAN_LIMIT_REACHED": {
                    "summary": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
                    "value": {
                      "error": {
                        "code": "PLAN_LIMIT_REACHED",
                        "message": "The plan allows no more databases",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "limit": "databases",
                        "max": 3,
                        "used": 3,
                        "plan": "launch"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4045"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "CONFLICT": {
                    "summary": "A cube or another database of the project has this slug",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "Resource already exists",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  },
                  "IDEMPOTENCY_KEY_REUSED": {
                    "summary": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action.",
                    "value": {
                      "error": {
                        "code": "IDEMPOTENCY_KEY_REUSED",
                        "message": "The Idempotency-Key was already used for a different request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/databases/{databaseId}": {
      "get": {
        "operationId": "getDatabase",
        "tags": [
          "databases"
        ],
        "summary": "Get a database",
        "description": "Returns one database: its status, the cubes that refer to it, its limits and what it used this month. It needs only read access.\n\n`status` is `provisioning` while the database is being made, then `ready`. `suspended` means it keeps its data but takes no connections: `suspended_reason` says why. `failed` means it could not be made: delete it and create it again. `deleting` means its deletion has started.\n\n`referenced_by` lists the cubes whose variables refer to the database. While any does, it cannot be deleted and its slug cannot change.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "databaseId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the database. A slug is unique among the cubes and databases of the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The database.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Database"
                },
                "example": {
                  "id": "2c7e4b19-5a03-4d8f-9e61-b04f7a3d2c58",
                  "slug": "db",
                  "name": "Main DB",
                  "status": "ready",
                  "suspended_reason": null,
                  "grace_ends_at": null,
                  "delete_after": null,
                  "region": "aws-eu-central-1",
                  "postgres_version": 17,
                  "host": "db-a1b2c3-pooler.eu-central-1.example.com",
                  "referenced_by": [
                    {
                      "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                      "slug": "api",
                      "name": "API"
                    }
                  ],
                  "limits": {
                    "max_cu": 1,
                    "storage_gb": 10,
                    "compute_hours": 100,
                    "transfer_gb": 10
                  },
                  "usage": {
                    "compute_hours": 12.4,
                    "storage_gb": 0.3,
                    "transfer_gb": 1.1,
                    "period_start": "2026-10-01T00:00:00Z",
                    "period_end": "2026-11-01T00:00:00Z",
                    "as_of": "2026-10-25T09:00:00Z"
                  },
                  "created_at": "2026-10-20T10:02:11Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4045"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "patch": {
        "operationId": "updateDatabase",
        "tags": [
          "databases"
        ],
        "summary": "Rename a database",
        "description": "Changes a database's name, its slug or both. It needs a key with full access.\n\nSend only the fields to change, and at least one. The rules for each field are those of `createDatabase`. A slug that another cube or database of the project has is refused with `409` `CONFLICT`.\n\nA slug change is refused with `409` `DATABASE_REFERENCED` while a cube's variables refer to the old slug: `error.cubes` names those cubes. Change their references first. The name can always change.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "databaseId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the database. A slug is unique among the cubes and databases of the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Sending the same change again sets the same values again, so a retry is safe. If the path names the database by a slug that this change changed, the repeat is `404`: name the database by its ID.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatabaseUpdate"
              },
              "example": {
                "name": "Primary DB"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The database, with the changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Database"
                },
                "example": {
                  "id": "2c7e4b19-5a03-4d8f-9e61-b04f7a3d2c58",
                  "slug": "db",
                  "name": "Primary DB",
                  "status": "ready",
                  "suspended_reason": null,
                  "grace_ends_at": null,
                  "delete_after": null,
                  "region": "aws-eu-central-1",
                  "postgres_version": 17,
                  "host": "db-a1b2c3-pooler.eu-central-1.example.com",
                  "referenced_by": [],
                  "limits": {
                    "max_cu": 1,
                    "storage_gb": 10,
                    "compute_hours": 100,
                    "transfer_gb": 10
                  },
                  "usage": {
                    "compute_hours": 12.4,
                    "storage_gb": 0.3,
                    "transfer_gb": 1.1,
                    "period_start": "2026-10-01T00:00:00Z",
                    "period_end": "2026-11-01T00:00:00Z",
                    "as_of": "2026-10-25T09:00:00Z"
                  },
                  "created_at": "2026-10-20T10:02:11Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "values": {
                    "summary": "No field is sent, or name or slug is not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "A name or a slug is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4045"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "CONFLICT": {
                    "summary": "A cube or another database of the project has this slug",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "Resource already exists",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  },
                  "DATABASE_REFERENCED": {
                    "summary": "Cubes refer to the old slug",
                    "value": {
                      "error": {
                        "code": "DATABASE_REFERENCED",
                        "message": "The env of api refers to this database as ${{ db.... }}; change those references before renaming it",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug",
                        "cubes": [
                          "api"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "delete": {
        "operationId": "deleteDatabase",
        "tags": [
          "databases"
        ],
        "summary": "Delete a database",
        "description": "Deletes a database and its data. It needs a key with full access. You cannot undo it. Support can recover a deleted database within 7 days.\n\nThe answer is `202 Accepted` with the database in `status` `deleting`. The deletion ends within seconds, and the database is then gone from the list and from `getDatabase`.\n\nA database is refused with `409` `DATABASE_REFERENCED` while a cube's variables refer to it: `error.cubes` names those cubes. Remove the references first.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "databaseId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the database. A slug is unique among the cubes and databases of the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Deleting the same database again while it is being deleted answers the same. Once it is gone, the repeat is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The deletion has started. The status is `deleting`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Database"
                },
                "example": {
                  "id": "2c7e4b19-5a03-4d8f-9e61-b04f7a3d2c58",
                  "slug": "db",
                  "name": "Main DB",
                  "status": "deleting",
                  "suspended_reason": null,
                  "grace_ends_at": null,
                  "delete_after": null,
                  "region": "aws-eu-central-1",
                  "postgres_version": 17,
                  "host": "db-a1b2c3-pooler.eu-central-1.example.com",
                  "referenced_by": [],
                  "limits": {
                    "max_cu": 1,
                    "storage_gb": 10,
                    "compute_hours": 100,
                    "transfer_gb": 10
                  },
                  "usage": {
                    "compute_hours": 12.4,
                    "storage_gb": 0.3,
                    "transfer_gb": 1.1,
                    "period_start": "2026-10-01T00:00:00Z",
                    "period_end": "2026-11-01T00:00:00Z",
                    "as_of": "2026-10-25T09:00:00Z"
                  },
                  "created_at": "2026-10-20T10:02:11Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4045"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "DATABASE_REFERENCED": {
                    "summary": "Cubes refer to the database: `error.cubes` names them. Remove or change those references first.",
                    "value": {
                      "error": {
                        "code": "DATABASE_REFERENCED",
                        "message": "The env of api refers to this database; remove those references before deleting it",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "cubes": [
                          "api"
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/databases/{databaseId}/connection": {
      "get": {
        "operationId": "getDatabaseConnection",
        "tags": [
          "databases"
        ],
        "summary": "Get the connection of a database",
        "description": "Returns how to connect to a database from outside Cubecen, for example with `psql` or a migration tool: the hosts, the user, the password and two connection URLs. It needs a key with full access, because it holds the password.\n\n`database_url` goes through a connection pooler: use it in applications. `database_url_unpooled` connects directly: use it for migrations, `LISTEN` and anything that keeps session state. Both require TLS (`sslmode=require`). The answer is never cached.\n\nA cube does not need this: put `${{ db.DATABASE_URL }}` or `${{ db.DATABASE_URL_UNPOOLED }}` in one of its variables, where `db` is the database's slug (see `updateEnvironment`).\n\nA database that is not `ready` yet is refused with `409` `DATABASE_NOT_READY`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "databaseId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the database. A slug is unique among the cubes and databases of the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The connection of the database. It holds the password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseConnection"
                },
                "example": {
                  "host": "db-a1b2c3.eu-central-1.example.com",
                  "pooled_host": "db-a1b2c3-pooler.eu-central-1.example.com",
                  "port": 5432,
                  "database": "app",
                  "user": "app",
                  "password": "example-password",
                  "database_url": "postgresql://app:example-password@db-a1b2c3-pooler.eu-central-1.example.com/app?sslmode=require",
                  "database_url_unpooled": "postgresql://app:example-password@db-a1b2c3.eu-central-1.example.com/app?sslmode=require"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4045"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "DATABASE_NOT_READY": {
                    "summary": "The database is not ready yet. Wait until its `status` is `ready`, then try again with a new `Idempotency-Key`.",
                    "value": {
                      "error": {
                        "code": "DATABASE_NOT_READY",
                        "message": "The database is not ready yet; try again once its status is ready",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndDatabasesUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/databases/{databaseId}/reset-password": {
      "post": {
        "operationId": "resetDatabasePassword",
        "tags": [
          "databases"
        ],
        "summary": "Reset the password of a database",
        "description": "Gives the database a new password and returns the new connection, as `getDatabaseConnection` does. It needs a key with full access.\n\nThe old password stops working at once. Every cube that refers to the database cannot connect until it is deployed again: its `getEnvironment` then has `live_env_behind` set to `true` and the database's slug in `databases_behind`. Redeploy those cubes with `createDeployment`.\n\nA database that is not `ready` yet is refused with `409` `DATABASE_NOT_READY`. A reset that is already running is refused with `409` `BUSY`: retry after the seconds in `Retry-After`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "databaseId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the database. A slug is unique among the cubes and databases of the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Each request sets a new password.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The new connection of the database. It holds the new password.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DatabaseConnection"
                },
                "example": {
                  "host": "db-a1b2c3.eu-central-1.example.com",
                  "pooled_host": "db-a1b2c3-pooler.eu-central-1.example.com",
                  "port": 5432,
                  "database": "app",
                  "user": "app",
                  "password": "example-new-password",
                  "database_url": "postgresql://app:example-new-password@db-a1b2c3-pooler.eu-central-1.example.com/app?sslmode=require",
                  "database_url_unpooled": "postgresql://app:example-new-password@db-a1b2c3.eu-central-1.example.com/app?sslmode=require"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4045"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "DATABASE_NOT_READY": {
                    "summary": "The database is not ready yet. Wait until its `status` is `ready`, then try again with a new `Idempotency-Key`.",
                    "value": {
                      "error": {
                        "code": "DATABASE_NOT_READY",
                        "message": "The database is not ready yet; try again once its status is ready",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "BUSY": {
                    "summary": "Another operation on this cube is in progress. Retry in a few seconds.",
                    "value": {
                      "error": {
                        "code": "BUSY",
                        "message": "A password reset is already running; try again shortly",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndDatabasesUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications": {
      "get": {
        "operationId": "listApplications",
        "tags": [
          "cubes"
        ],
        "summary": "List the cubes of a project",
        "description": "Returns the cubes of a project, a page at a time, oldest first.\n\nEach item is a cube with its project, its newest release and the deployment that is live now. Cubes that are still being set up (`creating`) or that could not be set up (`failed`) are listed too. To list the cubes of the whole organization, with filters, use `listOrganizationApplications`.\n\nThe answer holds up to `limit` cubes in `items`. When there are more, it also holds `next_cursor`: send it back as `cursor` to get the next page. The last page has no `next_cursor`.\n\n`last_release` and `live_deployment` are kept up to date as releases happen, so they can be a few seconds behind. `last_release` is `null` until the cube has had a build, and `live_deployment` is `null` until a deployment has succeeded.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most cubes to return in a page, from 1 to 100. The default is 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where the next page starts: an opaque value. Send the `next_cursor` of the previous page as it is. Leave it out to get the first page. A value that does not belong to this list is refused with `400`.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the project's cubes, oldest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                      "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                      "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                      "name": "Web",
                      "slug": "web",
                      "description": "The storefront",
                      "state": "active",
                      "repository": {
                        "source": "github_app",
                        "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                        "owner": "acme",
                        "name": "storefront",
                        "url": "https://github.com/acme/storefront.git",
                        "default_branch": "main"
                      },
                      "runtime": {
                        "host_label": "web-acme-3f9a2c",
                        "public_url": "https://web-acme-3f9a2c.cubecen.app",
                        "app_root": "apps/web",
                        "start_command": "",
                        "build_command": "",
                        "output_directory": "",
                        "port": null,
                        "private_url": "http://app-4c1d9e07a3b25f6810c2d7e94a5b3f60.cubecen-apps.svc.cluster.local"
                      },
                      "push_to_deploy": true,
                      "deploy_branch": null,
                      "previews_enabled": false,
                      "suspension": null,
                      "instance": {
                        "size": "small",
                        "memory_mib": 2048,
                        "cpu": 0.5,
                        "setting": "small",
                        "resizing": false,
                        "changed_at": "2026-09-14T08:40:02Z",
                        "reason": "create",
                        "previous_size": null
                      },
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "created_at": "2026-09-14T08:40:02Z",
                      "updated_at": "2026-10-25T09:14:31Z",
                      "project": {
                        "id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                        "name": "Storefront",
                        "slug": "storefront"
                      },
                      "last_release": {
                        "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                        "release_status": "DEPLOYED",
                        "terminal": true,
                        "revision": "main",
                        "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                        "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "trigger": "api",
                        "pushed_by": null,
                        "api_key": null,
                        "mcp_client": null,
                        "created_at": "2026-10-25T09:12:40Z",
                        "finished_at": "2026-10-25T09:14:31Z"
                      },
                      "live_deployment": {
                        "id": "dpl_00000002a0fdd794980f85f9c353bf",
                        "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                        "status": "SUCCEEDED",
                        "finished_at": "2026-10-25T09:14:31Z",
                        "env_version": "e3a91c2",
                        "build_env_version": "e3a91c2"
                      }
                    },
                    {
                      "id": "b64f2a19-0c83-4d7e-9a15-e2d83c7f5a40",
                      "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                      "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                      "name": "API",
                      "slug": "api",
                      "description": "",
                      "state": "creating",
                      "repository": {
                        "source": "github_app",
                        "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                        "owner": "acme",
                        "name": "storefront",
                        "url": "https://github.com/acme/storefront.git",
                        "default_branch": "main"
                      },
                      "runtime": {
                        "host_label": "api-acme-8d41b7",
                        "public_url": "",
                        "app_root": "apps/api",
                        "start_command": "",
                        "build_command": "",
                        "output_directory": "",
                        "port": null,
                        "private_url": ""
                      },
                      "push_to_deploy": true,
                      "deploy_branch": null,
                      "previews_enabled": false,
                      "suspension": null,
                      "instance": {
                        "size": "small",
                        "memory_mib": 2048,
                        "cpu": 0.5,
                        "setting": "small",
                        "resizing": false,
                        "changed_at": "2026-10-25T09:20:11Z",
                        "reason": "create",
                        "previous_size": null
                      },
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "created_at": "2026-10-25T09:20:11Z",
                      "updated_at": "2026-10-25T09:20:11Z",
                      "project": {
                        "id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                        "name": "Storefront",
                        "slug": "storefront"
                      },
                      "last_release": null,
                      "live_deployment": null
                    }
                  ],
                  "next_cursor": "q7Lw2XhTn9PcRk4VbZsE1uYdAm6JgFo3"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "limit": {
                    "summary": "limit is not a number from 1 to 100, or a parameter is repeated",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "cursor": {
                    "summary": "cursor is not one that this list gave",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "post": {
        "operationId": "createApplication",
        "tags": [
          "cubes"
        ],
        "summary": "Create a cube",
        "description": "Creates a cube in a project from a GitHub repository, and can start its first deploy. It needs a key with full access.\n\nName the repository in one of two ways, and not both. For a repository of a GitHub installation of the organization, send `github_installation_id` (the `id` of the installation) with `repository.owner` and `repository.name`. For a public repository, send its link as `repository.url`: no installation is needed, but pushes to a public repository do not deploy it.\n\n`name`, `slug` and the repository are the only required fields. The slug must be unique among the project's cubes. Cubecen chooses the cube's address: it is `https://<host_label>.cubecen.app`, and you cannot choose or change it. `app_root`, `start_command`, `build_command`, `output_directory` and `port` say how the cube is built and run. They can be changed later with `updateApplication`.\n\nAdd `\"deploy\": {}` to start the first build and deployment right away: it builds the branch the cube tracks. `deploy.revision` builds a branch, tag or commit SHA instead. Leave `deploy` out to only create the cube, and deploy later with `createBuild`.\n\nThe answer is `201 Created` with the cube, in state `active`. With `deploy`, it also holds the first `build`: follow it with `getBuild`. If the first build could not start, the cube exists all the same, and `build_error` says why.\n\nWhen Cubecen has not finished setting the cube up, the answer is `202 Accepted` instead, with the cube in state `creating` and a `Retry-After` header. Nothing is lost: Cubecen finishes the setup on its own. Read the cube with `getApplication` every few seconds until `state` is `active` or `failed`, or send the same request again with the same `Idempotency-Key`. If you asked for `deploy`, send the same request again once the cube is active: that starts the first build.\n\nA plan allows a number of cubes and a largest size. When the organization already has as many cubes as the plan allows, or `size` is above the plan's, the request is refused with `402`. A refused request leaves nothing behind.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A value that is unique to this cube, such as a UUID: 1 to 255 visible ASCII characters. Send the same value when you retry the same request, and the retry returns the cube that the first request made instead of creating a second one. The same value with a different body is refused with `IDEMPOTENCY_KEY_REUSED`. Use a new value for every new cube. If the platform refused the cube's settings after it was stored, the same value keeps getting that refusal: change the settings and use a new value.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationCreate"
              },
              "examples": {
                "connected": {
                  "summary": "A repository of a GitHub installation, built and deployed at once",
                  "value": {
                    "name": "Web",
                    "slug": "web",
                    "description": "The storefront",
                    "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                    "repository": {
                      "owner": "acme",
                      "name": "storefront"
                    },
                    "app_root": "apps/web",
                    "deploy": {}
                  }
                },
                "public": {
                  "summary": "A public repository, from its link",
                  "value": {
                    "name": "Hello World",
                    "slug": "hello-world",
                    "repository": {
                      "url": "https://github.com/octocat/Hello-World"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The cube was created and is `active`. With `deploy`, the first build is in `build`.",
            "headers": {
              "Location": {
                "description": "The path of the new cube.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationCreateResult"
                },
                "example": {
                  "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                  "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "name": "Web",
                  "slug": "web",
                  "description": "The storefront",
                  "state": "active",
                  "repository": {
                    "source": "github_app",
                    "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                    "owner": "acme",
                    "name": "storefront",
                    "url": "https://github.com/acme/storefront.git",
                    "default_branch": "main"
                  },
                  "runtime": {
                    "host_label": "web-acme-3f9a2c",
                    "public_url": "https://web-acme-3f9a2c.cubecen.app",
                    "app_root": "apps/web",
                    "start_command": "",
                    "build_command": "",
                    "output_directory": "",
                    "port": null,
                    "private_url": "http://app-4c1d9e07a3b25f6810c2d7e94a5b3f60.cubecen-apps.svc.cluster.local"
                  },
                  "push_to_deploy": true,
                  "deploy_branch": null,
                  "previews_enabled": false,
                  "suspension": null,
                  "instance": {
                    "size": "small",
                    "memory_mib": 2048,
                    "cpu": 0.5,
                    "setting": "small",
                    "resizing": false,
                    "changed_at": "2026-10-25T09:12:40Z",
                    "reason": "create",
                    "previous_size": null
                  },
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "created_at": "2026-10-25T09:12:40Z",
                  "updated_at": "2026-10-25T09:12:41Z",
                  "build": {
                    "id": "bld_00000001a0fdd794980f85f9c353bf",
                    "revision": "main",
                    "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                    "builder": null,
                    "port": null,
                    "framework": null,
                    "static": null,
                    "status": "QUEUED",
                    "release_status": "QUEUED",
                    "terminal": false,
                    "auto_deploy": "PENDING",
                    "reused": false,
                    "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                    "trigger": "api",
                    "pushed_by": null,
                    "api_key": {
                      "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                      "name": "CI"
                    },
                    "mcp_client": null,
                    "env_version": null,
                    "created_at": "2026-10-25T09:12:41Z"
                  }
                }
              }
            }
          },
          "202": {
            "description": "The cube is not set up yet. It is in state `creating`. Read it again, or send the same request again, until it is `active`.",
            "headers": {
              "Location": {
                "description": "The path of the new cube.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "The number of seconds to wait before you read the cube again.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationCreateResult"
                },
                "example": {
                  "id": "b64f2a19-0c83-4d7e-9a15-e2d83c7f5a40",
                  "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "name": "API",
                  "slug": "api",
                  "description": "",
                  "state": "creating",
                  "repository": {
                    "source": "github_app",
                    "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                    "owner": "acme",
                    "name": "storefront",
                    "url": "https://github.com/acme/storefront.git",
                    "default_branch": "main"
                  },
                  "runtime": {
                    "host_label": "api-acme-8d41b7",
                    "public_url": "",
                    "app_root": "apps/api",
                    "start_command": "",
                    "build_command": "",
                    "output_directory": "",
                    "port": null,
                    "private_url": ""
                  },
                  "push_to_deploy": true,
                  "deploy_branch": null,
                  "previews_enabled": false,
                  "suspension": null,
                  "instance": {
                    "size": "small",
                    "memory_mib": 2048,
                    "cpu": 0.5,
                    "setting": "small",
                    "resizing": false,
                    "changed_at": "2026-10-25T09:20:11Z",
                    "reason": "create",
                    "previous_size": null
                  },
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "created_at": "2026-10-25T09:20:11Z",
                  "updated_at": "2026-10-25T09:20:11Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "idempotency_key": {
                    "summary": "The Idempotency-Key header is missing, or is not 1 to 255 visible ASCII characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "An Idempotency-Key header of 1 to 255 visible ASCII characters is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "Idempotency-Key"
                      }
                    }
                  },
                  "name": {
                    "summary": "name is empty, too long, or has a space at the start or the end",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "name must be 1 to 120 printable characters",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "name"
                      }
                    }
                  },
                  "slug": {
                    "summary": "slug is not lowercase letters, digits and single hyphens, is too long, or looks like an ID",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "slug must be lowercase letters, digits and single hyphens",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  },
                  "description": {
                    "summary": "description is longer than 4000 characters, or has control characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "description is invalid",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "description"
                      }
                    }
                  },
                  "no_installation": {
                    "summary": "Neither github_installation_id nor repository.url is sent",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "github_installation_id is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "github_installation_id"
                      }
                    }
                  },
                  "no_repository": {
                    "summary": "github_installation_id is sent without a valid repository owner and name",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "repository owner and name are required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "installation_and_url": {
                    "summary": "github_installation_id is sent with repository.url",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Send either github_installation_id with the repository's owner and name, or repository.url",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "github_installation_id"
                      }
                    }
                  },
                  "owner_and_url": {
                    "summary": "The repository's owner or name is sent with repository.url",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Send either the repository's owner and name, or its url",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "link": {
                    "summary": "repository.url is not a GitHub repository link",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Paste a GitHub repository link, such as https://github.com/owner/repo or https://github.com/owner/repo/tree/branch/folder",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository.url"
                      }
                    }
                  },
                  "push_to_deploy": {
                    "summary": "push_to_deploy is true for a public repository",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Pushes deploy only repositories connected through the GitHub App; deploy a public repository's new commits with Deploy",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "push_to_deploy"
                      }
                    }
                  },
                  "app_root": {
                    "summary": "app_root is not a normalized relative path",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "app_root must be \".\" or a normalized relative path",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "app_root"
                      }
                    }
                  },
                  "start_command": {
                    "summary": "start_command is longer than 1024 characters, or has control characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "start_command must be at most 1024 characters without control characters",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "start_command"
                      }
                    }
                  },
                  "build_command": {
                    "summary": "build_command is longer than 1024 characters, or has control characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "build_command must be at most 1024 characters without control characters",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "build_command"
                      }
                    }
                  },
                  "output_directory": {
                    "summary": "output_directory is not a normalized relative path",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "output_directory must be a normalized relative path under app_root",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "output_directory"
                      }
                    }
                  },
                  "static_site_with_start_command": {
                    "summary": "output_directory is sent with start_command",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "output_directory serves a static site and cannot be combined with start_command; clear one of them",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "output_directory"
                      }
                    }
                  },
                  "port": {
                    "summary": "port is not a number from 1 to 65535",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "port must be between 1 and 65535",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "port"
                      }
                    }
                  },
                  "deploy_revision": {
                    "summary": "deploy.revision is not a valid branch, tag or commit SHA",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "deploy.revision must be a branch, tag or commit SHA",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "deploy.revision"
                      }
                    }
                  },
                  "deploy_branch": {
                    "summary": "deploy_branch is not a branch name",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "deploy_branch must be a branch name",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "deploy_branch"
                      }
                    }
                  },
                  "size": {
                    "summary": "size is not one of the values",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "size must be small, medium, large or xlarge",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "size"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "cubes": {
                    "summary": "The organization has as many cubes as its plan allows",
                    "value": {
                      "error": {
                        "code": "PLAN_LIMIT_REACHED",
                        "message": "The Free plan allows 3 cubes; delete one or change plans to add another",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "limit": "cubes",
                        "max": 3,
                        "used": 3,
                        "plan": "free"
                      }
                    }
                  },
                  "size": {
                    "summary": "size is above the largest size the plan allows",
                    "value": {
                      "error": {
                        "code": "PLAN_LIMIT_REACHED",
                        "message": "The Free plan runs cubes at up to Small (2 GiB); change plans to choose Medium",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "limit": "size",
                        "max": 2048,
                        "used": 4096,
                        "plan": "free"
                      }
                    }
                  },
                  "bandwidth_gb": {
                    "summary": "The organization's cubes are paused because its bandwidth for the period is used up",
                    "value": {
                      "error": {
                        "code": "PLAN_LIMIT_REACHED",
                        "message": "The Free plan's 10 GB of bandwidth for this month is used up, so the organization's cubes are paused until November 1; change plans to resume them",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "limit": "bandwidth_gb",
                        "max": 10,
                        "used": 10,
                        "plan": "free"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "Nothing was found at this address. Check the IDs, slugs and query values in the request.",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Resource not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "INSTALLATION_NOT_FOUND": {
                    "summary": "github_installation_id is not an installation of the organization",
                    "value": {
                      "error": {
                        "code": "INSTALLATION_NOT_FOUND",
                        "message": "The GitHub installation was not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "github_installation_id"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "CONFLICT": {
                    "summary": "Another cube of the project has this slug",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "Resource already exists",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "IDEMPOTENCY_KEY_REUSED": {
                    "summary": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action.",
                    "value": {
                      "error": {
                        "code": "IDEMPOTENCY_KEY_REUSED",
                        "message": "The Idempotency-Key was already used for a different request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "SIZE_UNAVAILABLE": {
                    "summary": "The size is not offered right now. Choose a smaller size.",
                    "value": {
                      "error": {
                        "code": "SIZE_UNAVAILABLE",
                        "message": "Large cubes are not available right now; choose a smaller size",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "size"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "422": {
            "description": "The request is well formed but cannot be carried out. `error.code` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "installation": {
                    "summary": "The installation cannot reach the repository, or does not allow it",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "The GitHub installation cannot access this repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "connection_lost": {
                    "summary": "The person who connected the installation lost the access it rests on",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "The GitHub connection lost the access it was made with: an owner must reconnect it",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "not_public": {
                    "summary": "The public repository is private, or does not exist",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "This repository is not public on GitHub, or does not exist",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository.url"
                      }
                    }
                  },
                  "moved": {
                    "summary": "The public repository was renamed or moved",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "This repository moved on GitHub; use its new link",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository.url"
                      }
                    }
                  },
                  "REVISION_NOT_FOUND": {
                    "summary": "The branch in the link does not exist",
                    "value": {
                      "error": {
                        "code": "REVISION_NOT_FOUND",
                        "message": "The branch in the link does not exist in the repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository.url"
                      }
                    }
                  },
                  "REPOSITORY_EMPTY": {
                    "summary": "The public repository has no commits yet",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_EMPTY",
                        "message": "The repository is empty: it has no commits yet. Push a commit, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_REMOVED": {
                    "summary": "The Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_REMOVED",
                        "message": "The Cubecen GitHub App is no longer installed on acme. Connect GitHub again, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_SUSPENDED": {
                    "summary": "The Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_SUSPENDED",
                        "message": "The Cubecen GitHub App is suspended on acme. Unsuspend it in acme's GitHub settings (Settings -> Applications), then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_PERMISSIONS_MISSING": {
                    "summary": "The GitHub account has not approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_PERMISSIONS_MISSING",
                        "message": "The Cubecen GitHub App on acme lacks a permission it needs (repository contents: read). An owner of acme must approve the App's requested permissions on GitHub, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAnd2More"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/applications": {
      "get": {
        "operationId": "listOrganizationApplications",
        "tags": [
          "cubes"
        ],
        "summary": "List the cubes of an organization",
        "description": "Returns the cubes of all the projects of an organization, a page at a time. Use it to see everything an organization runs at once. To list the cubes of one project, use `listApplications`.\n\nEach item is a cube with its project, its newest release and the deployment that is live now. Cubes that are still being set up (`creating`) or that could not be set up (`failed`) are listed too.\n\nCubes come in the order of their last change, newest first. Pass `sort` to change the order. Pass `q` to keep the cubes whose name, slug or repository (`owner/name`) contains some text, `project_id` to keep one project's cubes, and `state` to keep cubes in one state.\n\nThe answer holds up to `limit` cubes in `items`. When there are more, it also holds `next_cursor`: send it back as `cursor`, with the same filters and `sort`, to get the next page. The last page has no `next_cursor`.\n\n`last_release` and `live_deployment` are kept up to date as releases happen, so they can be a few seconds behind. `last_release` is `null` until the cube has had a build, and `live_deployment` is `null` until a deployment has succeeded.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most cubes to return in a page, from 1 to 100. The default is 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where the next page starts: an opaque value. Send the `next_cursor` of the previous page as it is, with the same `sort`. Leave it out to get the first page. A value that does not belong to this list, or that was made for another `sort`, is refused with `400`.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Keeps the cubes whose name, slug or repository (`owner/name`) contains this text, ignoring case. At most 200 bytes: a character outside plain ASCII takes more than one.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Keeps the cubes of this project. The project's ID. A slug does not work here.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Keeps the cubes in this state: `creating`, `active` or `failed`.",
            "schema": {
              "type": "string",
              "enum": [
                "creating",
                "active",
                "failed"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "The order of the list. `updated` is newest change first, and is the default. `name` is A to Z, ignoring case. `created` is newest first.",
            "schema": {
              "type": "string",
              "enum": [
                "updated",
                "name",
                "created"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the organization's cubes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationPage"
                },
                "example": {
                  "items": [
                    {
                      "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                      "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                      "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                      "name": "Web",
                      "slug": "web",
                      "description": "The storefront",
                      "state": "active",
                      "repository": {
                        "source": "github_app",
                        "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                        "owner": "acme",
                        "name": "storefront",
                        "url": "https://github.com/acme/storefront.git",
                        "default_branch": "main"
                      },
                      "runtime": {
                        "host_label": "web-acme-3f9a2c",
                        "public_url": "https://web-acme-3f9a2c.cubecen.app",
                        "app_root": "apps/web",
                        "start_command": "",
                        "build_command": "",
                        "output_directory": "",
                        "port": null,
                        "private_url": "http://app-4c1d9e07a3b25f6810c2d7e94a5b3f60.cubecen-apps.svc.cluster.local"
                      },
                      "push_to_deploy": true,
                      "deploy_branch": null,
                      "previews_enabled": false,
                      "suspension": null,
                      "instance": {
                        "size": "small",
                        "memory_mib": 2048,
                        "cpu": 0.5,
                        "setting": "small",
                        "resizing": false,
                        "changed_at": "2026-09-14T08:40:02Z",
                        "reason": "create",
                        "previous_size": null
                      },
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "created_at": "2026-09-14T08:40:02Z",
                      "updated_at": "2026-10-25T09:14:31Z",
                      "project": {
                        "id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                        "name": "Storefront",
                        "slug": "storefront"
                      },
                      "last_release": {
                        "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                        "release_status": "DEPLOYED",
                        "terminal": true,
                        "revision": "main",
                        "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                        "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "trigger": "api",
                        "pushed_by": null,
                        "api_key": null,
                        "mcp_client": null,
                        "created_at": "2026-10-25T09:12:40Z",
                        "finished_at": "2026-10-25T09:14:31Z"
                      },
                      "live_deployment": {
                        "id": "dpl_00000002a0fdd794980f85f9c353bf",
                        "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                        "status": "SUCCEEDED",
                        "finished_at": "2026-10-25T09:14:31Z",
                        "env_version": "e3a91c2",
                        "build_env_version": "e3a91c2"
                      }
                    }
                  ],
                  "next_cursor": "Zk3vQx9TnWl2RbYc7uHs5dPgAe8MjXo1iNtV4yLq"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "limit": {
                    "summary": "limit is not a number from 1 to 100",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "limit must be between 1 and 100",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "limit"
                      }
                    }
                  },
                  "q": {
                    "summary": "q is longer than 200 bytes",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "q is too long",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "q"
                      }
                    }
                  },
                  "state": {
                    "summary": "state is not one of the values",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "state must be creating, active or failed",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "state"
                      }
                    }
                  },
                  "sort": {
                    "summary": "sort is not one of the values",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "sort must be updated, name or created",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "sort"
                      }
                    }
                  },
                  "project_id": {
                    "summary": "project_id is not a project ID",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "project_id must be a project UUID",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "project_id"
                      }
                    }
                  },
                  "cursor": {
                    "summary": "cursor is not one that this list gave, or was made for another sort",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "cursor is invalid for this list",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "cursor"
                      }
                    }
                  },
                  "repeated": {
                    "summary": "A parameter is repeated, or the query string is not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4048"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}": {
      "get": {
        "operationId": "getApplication",
        "tags": [
          "cubes"
        ],
        "summary": "Get a cube",
        "description": "Returns one cube: its repository, how it is built and run, its address, its size and its state.\n\nUse it to follow a cube that `createApplication` answered with `202`: read it every few seconds until `state` is `active` or `failed`. Use it too to find the deployment that is live now, in `live_deployment` (the lists show a shorter form of it), and the cubes whose variables refer to this cube, in `referenced_by`, which only this answer has.\n\nFor a cube that is `active`, the build and run settings are read from the platform when you ask, so they are up to date.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The cube.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                },
                "example": {
                  "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                  "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "name": "Web",
                  "slug": "web",
                  "description": "The storefront",
                  "state": "active",
                  "repository": {
                    "source": "github_app",
                    "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                    "owner": "acme",
                    "name": "storefront",
                    "url": "https://github.com/acme/storefront.git",
                    "default_branch": "main"
                  },
                  "runtime": {
                    "host_label": "web-acme-3f9a2c",
                    "public_url": "https://web-acme-3f9a2c.cubecen.app",
                    "app_root": "apps/web",
                    "start_command": "",
                    "build_command": "",
                    "output_directory": "",
                    "port": null,
                    "private_url": "http://app-4c1d9e07a3b25f6810c2d7e94a5b3f60.cubecen-apps.svc.cluster.local"
                  },
                  "push_to_deploy": true,
                  "deploy_branch": null,
                  "previews_enabled": false,
                  "suspension": null,
                  "instance": {
                    "size": "small",
                    "memory_mib": 2048,
                    "cpu": 0.5,
                    "setting": "small",
                    "resizing": false,
                    "changed_at": "2026-09-14T08:40:02Z",
                    "reason": "create",
                    "previous_size": null
                  },
                  "live_deployment": {
                    "id": "dpl_00000002a0fdd794980f85f9c353bf",
                    "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                    "image_digest": "sha256:0b7eb1bc3e6480072dddfd667fe6003a3e729aba3f65cdc8ea01be89b01f8e3c",
                    "status": "SUCCEEDED",
                    "public_url": "https://web-acme-3f9a2c.cubecen.app",
                    "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                    "trigger": "api",
                    "pushed_by": null,
                    "api_key": {
                      "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                      "name": "CI"
                    },
                    "mcp_client": null,
                    "env_version": "e3a91c2",
                    "created_at": "2026-10-25T09:14:03Z",
                    "started_at": "2026-10-25T09:14:04Z",
                    "finished_at": "2026-10-25T09:14:31Z"
                  },
                  "referenced_by": [
                    {
                      "id": "b64f2a19-0c83-4d7e-9a15-e2d83c7f5a40",
                      "slug": "api",
                      "name": "API"
                    }
                  ],
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "created_at": "2026-09-14T08:40:02Z",
                  "updated_at": "2026-10-25T09:14:31Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "patch": {
        "operationId": "updateApplication",
        "tags": [
          "cubes"
        ],
        "summary": "Update a cube",
        "description": "Changes a cube. It needs a key with full access.\n\nSend only the fields to change, and at least one. A field that you leave out stays as it is. The rules for each field are those of `createApplication`. `name`, `slug` and `description` describe the cube. `start_command`, `app_root`, `build_command`, `output_directory` and `port` say how it is built and run. `push_to_deploy` and `deploy_branch` say which pushes deploy it. `size` chooses how big it runs.\n\nSend `null` to clear `description`, `start_command`, `build_command`, `output_directory` or `port`, and to make the cube track the repository's default branch again with `deploy_branch`. An empty string does the same for the commands, the output directory and the branch. A cube cannot have both an `output_directory` and a `start_command`: to switch from one to the other, send the new one and `null` for the old one in the same request.\n\nThe build and run settings apply from the cube's next build, so start a build with `createBuild` after you change them. Changing them, or `size`, needs an `active` cube: for a cube that is still being set up the request is refused with `409` `APPLICATION_NOT_READY`. The other fields can be changed in any state.\n\nChanging the slug changes the name that paths use for the cube, so use the `id` in paths that you keep. The cube's address does not change. A new slug is refused with `409` while the variables of another cube of the project refer to this cube by its slug: `getApplication` lists those cubes in `referenced_by`. Change the references first.\n\n`size` can be at most the largest size that the plan allows. The cube is resized at once and rolls over to the new size without downtime. The answer shows the new `instance`. If the resize has not finished, `instance.resizing` is `true` and `size` still shows the old size: read the cube until `resizing` is `false`. Send `null` to make the cube follow its plan's size again. A size above the plan's is refused with `402`, and a size that is not offered right now with `409`.\n\nThe answer is the cube as it is now.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Sending the same update again sets the same values again, so a retry is safe. If the path names the cube by a slug that this update changed, the repeat is `404`: name the cube by its ID.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplicationPatch"
              },
              "examples": {
                "settings": {
                  "summary": "Change how the cube is built and run",
                  "value": {
                    "app_root": "apps/web",
                    "build_command": "npm run build:web",
                    "port": 3000
                  }
                },
                "size": {
                  "summary": "Choose a size",
                  "value": {
                    "size": "medium"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cube, with the changes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                },
                "example": {
                  "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                  "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                  "project_id": "9b2c5d1e-7a34-4f6b-8e21-3c0d5a9f1b47",
                  "name": "Web",
                  "slug": "web",
                  "description": "The storefront",
                  "state": "active",
                  "repository": {
                    "source": "github_app",
                    "github_installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                    "owner": "acme",
                    "name": "storefront",
                    "url": "https://github.com/acme/storefront.git",
                    "default_branch": "main"
                  },
                  "runtime": {
                    "host_label": "web-acme-3f9a2c",
                    "public_url": "https://web-acme-3f9a2c.cubecen.app",
                    "app_root": "apps/web",
                    "start_command": "",
                    "build_command": "npm run build:web",
                    "output_directory": "",
                    "port": 3000,
                    "private_url": "http://app-4c1d9e07a3b25f6810c2d7e94a5b3f60.cubecen-apps.svc.cluster.local"
                  },
                  "push_to_deploy": true,
                  "deploy_branch": null,
                  "previews_enabled": false,
                  "suspension": null,
                  "instance": {
                    "size": "small",
                    "memory_mib": 2048,
                    "cpu": 0.5,
                    "setting": "small",
                    "resizing": false,
                    "changed_at": "2026-09-14T08:40:02Z",
                    "reason": "create",
                    "previous_size": null
                  },
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "created_at": "2026-09-14T08:40:02Z",
                  "updated_at": "2026-10-25T10:02:17Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported, or a field has the wrong type",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "empty": {
                    "summary": "No field is sent",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "at least one field is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "name": {
                    "summary": "name is empty, too long, has a space at the start or the end, or is null",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "name must be 1 to 120 printable characters",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "name"
                      }
                    }
                  },
                  "slug": {
                    "summary": "slug is not lowercase letters, digits and single hyphens, is too long, looks like an ID, or is null",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "slug must be lowercase letters, digits and single hyphens",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  },
                  "description": {
                    "summary": "description is longer than 4000 characters, or has control characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "description is invalid",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "description"
                      }
                    }
                  },
                  "app_root": {
                    "summary": "app_root is not a normalized relative path, or is null",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "app_root must be \".\" or a normalized relative path",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "app_root"
                      }
                    }
                  },
                  "start_command": {
                    "summary": "start_command is longer than 1024 characters, or has control characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "start_command must be at most 1024 characters without control characters",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "start_command"
                      }
                    }
                  },
                  "build_command": {
                    "summary": "build_command is longer than 1024 characters, or has control characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "build_command must be at most 1024 characters without control characters",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "build_command"
                      }
                    }
                  },
                  "output_directory": {
                    "summary": "output_directory is not a normalized relative path",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "output_directory must be a normalized relative path under app_root",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "output_directory"
                      }
                    }
                  },
                  "static_site_with_start_command": {
                    "summary": "The cube would have both an output_directory and a start_command",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "output_directory serves a static site and cannot be combined with start_command; clear one of them",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "output_directory"
                      }
                    }
                  },
                  "port": {
                    "summary": "port is not a number from 1 to 65535",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "port must be between 1 and 65535",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "port"
                      }
                    }
                  },
                  "push_to_deploy_null": {
                    "summary": "push_to_deploy is null",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "push_to_deploy must be true or false",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "push_to_deploy"
                      }
                    }
                  },
                  "push_to_deploy_public": {
                    "summary": "push_to_deploy is true for a cube made from a public repository",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Pushes deploy only repositories connected through the GitHub App; deploy a public repository's new commits with Deploy",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "push_to_deploy"
                      }
                    }
                  },
                  "deploy_branch": {
                    "summary": "deploy_branch is not a branch name",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "deploy_branch must be a branch name",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "deploy_branch"
                      }
                    }
                  },
                  "size": {
                    "summary": "size is not one of the values",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "size must be small, medium, large or xlarge",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "size"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "PLAN_LIMIT_REACHED": {
                    "summary": "size is above the largest size the plan allows",
                    "value": {
                      "error": {
                        "code": "PLAN_LIMIT_REACHED",
                        "message": "The Free plan runs cubes at up to Small (2 GiB); change plans to choose Medium",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "limit": "size",
                        "max": 2048,
                        "used": 4096,
                        "plan": "free"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "duplicate_slug": {
                    "summary": "Another cube of the project has this slug",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "Resource already exists",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "referenced_slug": {
                    "summary": "The variables of another cube refer to this cube by its slug",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "The env of api refers to this cube as ${{ web... }}; change those references before renaming it",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "slug"
                      }
                    }
                  },
                  "APPLICATION_NOT_READY": {
                    "summary": "The cube is still being created, or its creation failed.",
                    "value": {
                      "error": {
                        "code": "APPLICATION_NOT_READY",
                        "message": "The cube is not ready for this operation",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "SIZE_UNAVAILABLE": {
                    "summary": "The size is not offered right now. Choose a smaller size.",
                    "value": {
                      "error": {
                        "code": "SIZE_UNAVAILABLE",
                        "message": "Large cubes are not available right now; choose a smaller size",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "size"
                      }
                    }
                  },
                  "BUSY": {
                    "summary": "Another operation on this cube is in progress. Retry in a few seconds.",
                    "value": {
                      "error": {
                        "code": "BUSY",
                        "message": "Another operation on this cube is in progress; retry shortly",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      },
      "delete": {
        "operationId": "deleteApplication",
        "tags": [
          "cubes"
        ],
        "summary": "Delete a cube",
        "description": "Deletes a cube and takes down what it was running. It needs a key with full access. This cannot be undone.\n\nThe cube is gone from the lists and from `getApplication` at once, and its slug is free for another cube. Taking down what it ran can take a moment. When it is done, the request answers `204`, with no body. When it is still going on, the request answers `202` with the cube's `id`, a `status` of `DELETION_PENDING` and a `Retry-After` header: send the same request again after that many seconds, until it answers `204`. Cubecen finishes the deletion on its own, even if you never repeat the request.\n\nA build or deployment of another cube whose variables refer to this cube by its slug is refused with `ENV_REFERENCE_BROKEN` once this cube is gone. `getApplication` lists those cubes in `referenced_by`.\n\nTo repeat the request, name the cube by its `id`. Once the deletion has started, the cube's slug no longer names it, so a repeat by slug is `404`. A repeat by `id` after the deletion is done answers `204` again.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Deleting the same cube again by its ID answers `204`, like the first time. By slug, the repeat is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The cube is being deleted. Send the request again after `Retry-After` seconds, until it answers `204`.",
            "headers": {
              "Retry-After": {
                "description": "The number of seconds to wait before you send the request again.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletionPending"
                },
                "example": {
                  "id": "f1a83d52-6e07-4b9c-8d34-7a0c9e215b68",
                  "status": "DELETION_PENDING"
                }
              }
            }
          },
          "204": {
            "description": "The cube and what it ran are gone. The answer has no body."
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/repository-tree": {
      "get": {
        "operationId": "getApplicationRepositoryFolders",
        "tags": [
          "cubes"
        ],
        "summary": "List the folders of a cube's repository",
        "description": "Lists the folders of the repository that a cube is built from, at a branch, tag or commit. Use it to choose the `app_root` of a cube, for example in a monorepo. To list the folders of a repository before you make a cube from it, use `getRepositoryFolders`.\n\nEach folder has a `path`, where `.` is the root of the repository, and `markers`: the files in it that builders use to recognize what to build, such as a `Dockerfile`, `package.json` or `go.mod`. A folder with markers is likely to hold an app. `pnpm-workspace.yaml` marks the root of a monorepo. The folders `.git` and `node_modules` are never listed. The answer names the commit it read.\n\n`ref` picks the branch, tag or commit to read. Without it, the branch that the cube tracks is read: its `deploy_branch`, else the repository's default branch as it was when the cube was made. A repository with more than 2000 folders is cut short, and `truncated` is `true`: the root comes first, then the folders with markers and their parents, then the shallowest folders.\n\nA cube from a GitHub installation is read through that installation, which must still allow the repository, as builds do. A cube from a public repository is read without any access, so the repository must still be public. Lookups are limited to about 30 a minute for the key's owner, counting `getRepositoryFolders` too.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "description": "The branch, tag or commit SHA to read, at most 255 characters. Leave it out for the branch the cube tracks.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The folders of the repository at the commit that was read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryTree"
                },
                "example": {
                  "repository": "acme/storefront",
                  "ref": "main",
                  "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                  "directories": [
                    {
                      "path": ".",
                      "markers": [
                        "package.json",
                        "pnpm-workspace.yaml"
                      ]
                    },
                    {
                      "path": "apps",
                      "markers": []
                    },
                    {
                      "path": "apps/api",
                      "markers": [
                        "Dockerfile",
                        "package.json"
                      ]
                    },
                    {
                      "path": "apps/web",
                      "markers": [
                        "package.json"
                      ]
                    }
                  ],
                  "truncated": false
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "ref": {
                    "summary": "ref is not a valid branch, tag or commit",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "ref must be a branch, a tag or a commit SHA",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "ref"
                      }
                    }
                  },
                  "parameters": {
                    "summary": "A parameter other than ref is sent, or ref is sent twice",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "422": {
            "description": "The request is well formed but cannot be carried out. `error.code` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "installation": {
                    "summary": "The installation cannot reach the repository, or does not allow it",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "The GitHub installation cannot access this repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "not_public": {
                    "summary": "The public repository is no longer public, was moved, or no longer exists",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "The repository is no longer public on GitHub, was moved, or no longer exists",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "REVISION_NOT_FOUND": {
                    "summary": "The branch, tag or commit does not exist in the repository.",
                    "value": {
                      "error": {
                        "code": "REVISION_NOT_FOUND",
                        "message": "The branch, tag or commit was not found in the repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "ref"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_REMOVED": {
                    "summary": "The Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_REMOVED",
                        "message": "The Cubecen GitHub App is no longer installed on acme. Connect GitHub again, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_SUSPENDED": {
                    "summary": "The Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_SUSPENDED",
                        "message": "The Cubecen GitHub App is suspended on acme. Unsuspend it in acme's GitHub settings (Settings -> Applications), then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_PERMISSIONS_MISSING": {
                    "summary": "The GitHub account has not approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_PERMISSIONS_MISSING",
                        "message": "The Cubecen GitHub App on acme lacks a permission it needs (repository contents: read). An owner of acme must approve the App's requested permissions on GitHub, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited429"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/builds": {
      "get": {
        "operationId": "listBuilds",
        "tags": [
          "builds"
        ],
        "summary": "List the builds of a cube",
        "description": "Returns the builds of a cube, newest first. The list is not paged.\n\nEach build is shown as `getBuild` shows it, with its `release_status` and `terminal`: they say where its release is, counting the deployment that follows the build. A build that only built, without deploying, is `BUILT`: it can be deployed later with `createDeployment`. A cube that is still being set up has no builds.\n\nTo see builds and deployments together, as the cube's history, use `listReleases`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The builds of the cube, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildList"
                },
                "example": {
                  "data": [
                    {
                      "id": "bld_00000003a0fdd794980f85f9c353bf",
                      "revision": "feature/checkout",
                      "commit_sha": "b73a5f7f0d6cadd7602fbb6440a9434b4e1c8a90",
                      "builder": "railpack",
                      "port": null,
                      "framework": "next",
                      "static": false,
                      "status": "FAILED",
                      "release_status": "BUILD_FAILED",
                      "terminal": true,
                      "error": {
                        "code": "WORKFLOW_EXECUTION_FAILED",
                        "message": "The build step failed: the build command exited with status 1"
                      },
                      "auto_deploy": "SKIPPED",
                      "reused": false,
                      "created_by": null,
                      "trigger": "push",
                      "pushed_by": "octocat",
                      "api_key": null,
                      "mcp_client": null,
                      "env_version": "e3a91c2",
                      "created_at": "2026-10-25T10:31:08Z",
                      "started_at": "2026-10-25T10:31:12Z",
                      "finished_at": "2026-10-25T10:32:47Z"
                    },
                    {
                      "id": "bld_00000001a0fdd794980f85f9c353bf",
                      "revision": "main",
                      "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                      "builder": "railpack",
                      "port": null,
                      "framework": "next",
                      "static": false,
                      "status": "SUCCEEDED",
                      "release_status": "DEPLOYED",
                      "terminal": true,
                      "image_digest": "sha256:0b7eb1bc3e6480072dddfd667fe6003a3e729aba3f65cdc8ea01be89b01f8e3c",
                      "auto_deploy": "TRIGGERED",
                      "reused": false,
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "trigger": "api",
                      "pushed_by": null,
                      "api_key": {
                        "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                        "name": "CI"
                      },
                      "mcp_client": null,
                      "env_version": "e3a91c2",
                      "deployment_id": "dpl_00000002a0fdd794980f85f9c353bf",
                      "deployment": {
                        "id": "dpl_00000002a0fdd794980f85f9c353bf",
                        "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                        "image_digest": "sha256:0b7eb1bc3e6480072dddfd667fe6003a3e729aba3f65cdc8ea01be89b01f8e3c",
                        "status": "SUCCEEDED",
                        "public_url": "https://web-acme-3f9a2c.cubecen.app",
                        "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "trigger": "api",
                        "pushed_by": null,
                        "api_key": {
                          "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                          "name": "CI"
                        },
                        "mcp_client": null,
                        "env_version": "e3a91c2",
                        "created_at": "2026-10-25T09:14:03Z",
                        "started_at": "2026-10-25T09:14:04Z",
                        "finished_at": "2026-10-25T09:14:31Z"
                      },
                      "public_url": "https://web-acme-3f9a2c.cubecen.app",
                      "created_at": "2026-10-25T09:12:40Z",
                      "started_at": "2026-10-25T09:12:44Z",
                      "finished_at": "2026-10-25T09:14:02Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "post": {
        "operationId": "createBuild",
        "tags": [
          "builds"
        ],
        "summary": "Start a build",
        "description": "Builds a branch, tag or commit of the cube's repository and, if you ask for it, deploys the result. This is how a CI job deploys a cube. It needs a key with full access.\n\nSend `{\"deploy\": true}` to build and deploy. Send `{\"deploy\": false}` to build only and deploy the build later. `deploy` is `false` when you leave it out, so send `true` to deploy. `revision` is a branch, tag or commit SHA. Without it, the build uses the branch the cube deploys from, or the repository's default branch.\n\nThe answer is `202 Accepted` with the build, usually `QUEUED`. The `Location` header gives its path. Follow the build with `getBuild` until `terminal` is `true`.\n\nSend an `Idempotency-Key` header with a new value for each action. If a request fails on the way, send it again with the same key. You get the first answer, and no second build starts.\n\nAdd `\"reuse\": true` to a deploy to skip a build that is not needed. Cubecen looks at the three newest successful builds of the same commit that were made since the cube's build settings last changed. It deploys the newest of them that was built with the same values for every variable the build reads. If there is none, it builds as usual.\n\nWhen a build is reused, the answer is that earlier build, with `reused` set to `true`. `deployment_id` and the `Location` header name the new deployment. Follow that deployment, not the build. A reused build costs no build minutes. Leave `reuse` out to build again anyway.\n\nThese refusals are worth handling:\n\n- `409` `BUILD_IN_PROGRESS`: a build of this commit is already queued or running.\n- `409` `DEPLOYMENT_IN_PROGRESS`: the request deploys, and a build of this commit is still being deployed.\n- `409` `APPLICATION_NOT_READY`: the cube is not active. A cube is active once its creation has finished, so this answer means its `state` is `creating` or `failed`.\n- `402` `PLAN_LIMIT_REACHED`: the plan has no build minutes left for the period. This happens on a plan that does not bill for more, such as Free. A reused build still works.\n\n`BUILD_IN_PROGRESS`, `DEPLOYMENT_IN_PROGRESS` and `PLAN_LIMIT_REACHED` stick to the `Idempotency-Key` of the request they refused: to try again, send a new key. After a `409` for a release in progress, wait for that release to finish, or cancel it, first. After a `402`, try again when the plan has build minutes again, or change the plan.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A value that is unique to this action, such as a UUID: 1 to 255 visible ASCII characters. Send the same value when you retry the same request, and the retry returns the first answer instead of doing the work again; once the first request has finished, the answer carries `Idempotent-Replayed: true`. Use a new value for every new action. The same value with a different body is refused with `IDEMPOTENCY_KEY_REUSED`. Once an action has been refused for what it asks, for example with `BUILD_IN_PROGRESS` or `PLAN_LIMIT_REACHED`, the same key keeps getting that answer: use a new key to try again.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BuildCreate"
              },
              "example": {
                "revision": "main",
                "deploy": true
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The build was accepted. It is usually `QUEUED`; follow it until `terminal` is `true`. With `reuse`, the answer can be an earlier build that is deployed again.",
            "headers": {
              "Location": {
                "description": "The path of the new build. When `reused` is `true`, the path of the new deployment.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the answer to a retry of a request that had already finished. Absent otherwise.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Build"
                },
                "example": {
                  "id": "bld_00000001a0fdd794980f85f9c353bf",
                  "revision": "main",
                  "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                  "builder": null,
                  "port": null,
                  "framework": null,
                  "static": null,
                  "status": "QUEUED",
                  "release_status": "QUEUED",
                  "terminal": false,
                  "auto_deploy": "PENDING",
                  "reused": false,
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "trigger": "api",
                  "pushed_by": null,
                  "api_key": {
                    "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                    "name": "CI"
                  },
                  "mcp_client": null,
                  "env_version": "e3a91c2",
                  "created_at": "2026-10-25T09:12:40Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "VALIDATION_ERROR": {
                    "summary": "The request is not valid. `error.field` names the field to blame, when there is one.",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "revision must be a branch, tag or commit SHA",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "revision"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "PLAN_LIMIT_REACHED": {
                    "summary": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
                    "value": {
                      "error": {
                        "code": "PLAN_LIMIT_REACHED",
                        "message": "The Free plan's 300 build minutes for this month are used up; builds resume on November 1, or change plans",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "limit": "build_minutes",
                        "max": 300,
                        "used": 300,
                        "plan": "free"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "APPLICATION_NOT_READY": {
                    "summary": "The cube is still being created, or its creation failed.",
                    "value": {
                      "error": {
                        "code": "APPLICATION_NOT_READY",
                        "message": "The cube is not ready for this operation",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "BUILD_IN_PROGRESS": {
                    "summary": "This commit is already queued or being built.",
                    "value": {
                      "error": {
                        "code": "BUILD_IN_PROGRESS",
                        "message": "This commit is already being built",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "DEPLOYMENT_IN_PROGRESS": {
                    "summary": "A release of this cube is already in progress. Wait for it, or cancel it.",
                    "value": {
                      "error": {
                        "code": "DEPLOYMENT_IN_PROGRESS",
                        "message": "A release of this cube is already in progress",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "IDEMPOTENCY_KEY_REUSED": {
                    "summary": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action.",
                    "value": {
                      "error": {
                        "code": "IDEMPOTENCY_KEY_REUSED",
                        "message": "The Idempotency-Key was already used for a different request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "CONFLICT": {
                    "summary": "The request conflicts with the current state of the resource, or it expired and needs a new `Idempotency-Key`.",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "This request expired; send it again with a new Idempotency-Key",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "BUSY": {
                    "summary": "Another operation on this cube is in progress. Retry in a few seconds.",
                    "value": {
                      "error": {
                        "code": "BUSY",
                        "message": "Another operation on this cube is in progress; retry shortly",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "422": {
            "description": "The request is well formed but cannot be carried out. `error.code` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "REPOSITORY_NOT_ACCESSIBLE": {
                    "summary": "Cubecen cannot read the repository: the access was removed, GitHub blocks it, or a public repository is no longer public or has moved.",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "The GitHub installation cannot access this repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "REVISION_NOT_FOUND": {
                    "summary": "The branch, tag or commit does not exist in the repository.",
                    "value": {
                      "error": {
                        "code": "REVISION_NOT_FOUND",
                        "message": "The branch, tag or commit was not found in the repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "revision"
                      }
                    }
                  },
                  "REPOSITORY_EMPTY": {
                    "summary": "The repository has no commits yet. Push a commit, then try again with a new `Idempotency-Key`.",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_EMPTY",
                        "message": "The repository is empty: it has no commits yet. Push a commit, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_REMOVED": {
                    "summary": "The Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_REMOVED",
                        "message": "The Cubecen GitHub App is no longer installed on acme. Connect GitHub again, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_SUSPENDED": {
                    "summary": "The Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_SUSPENDED",
                        "message": "The Cubecen GitHub App is suspended on acme. Unsuspend it in acme's GitHub settings (Settings -> Applications), then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_PERMISSIONS_MISSING": {
                    "summary": "The GitHub account has not approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_PERMISSIONS_MISSING",
                        "message": "The Cubecen GitHub App on acme lacks a permission it needs (repository contents: read). An owner of acme must approve the App's requested permissions on GitHub, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "missing_cube": {
                    "summary": "A variable refers to a cube that is no longer in the project",
                    "value": {
                      "error": {
                        "code": "ENV_REFERENCE_BROKEN",
                        "message": "The variable API_URL refers to \"api\", which is no longer a cube of this project; change the variable, then deploy again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "missing_database": {
                    "summary": "A variable refers to a database that is being deleted or is gone",
                    "value": {
                      "error": {
                        "code": "ENV_REFERENCE_BROKEN",
                        "message": "The variable DATABASE_URL refers to \"db\", which is no longer a cube or database of this project; change the variable, then deploy again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "no_private_address": {
                    "summary": "A variable refers to the private address of a cube that has none yet",
                    "value": {
                      "error": {
                        "code": "ENV_REFERENCE_BROKEN",
                        "message": "The variable API_URL refers to the private address of \"api\", which has none yet; try again in a minute",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAnd2More"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/builds/{buildId}": {
      "get": {
        "operationId": "getBuild",
        "tags": [
          "builds"
        ],
        "summary": "Get a build",
        "description": "Returns one build of a cube, with the state of its release.\n\nUse it to follow a build that you started with `createBuild`. Poll it every 3 to 5 seconds until `terminal` is `true`.\n\n`release_status` says where the release is. `QUEUED`, `BUILDING`, `DEPLOYING` and `UNKNOWN` mean keep polling. `DEPLOYED`, `BUILT`, `BUILD_FAILED`, `DEPLOY_FAILED`, `CANCELLED` and `SUPERSEDED` are final.\n\nOnce `release_status` is `DEPLOYED`, `public_url` holds the address of the cube. When the build or the deployment fails, `error` says why, in words you can show.\n\nIf the request that started the build reused an earlier build, its answer named a new deployment. Follow that deployment instead: this endpoint shows the earlier build as it was.\n\nA build of another cube is not found.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "buildId",
            "in": "path",
            "required": true,
            "description": "The ID of the build: the `id` you got when you started it. An opaque string that starts with `bld_` (`dep_` for the oldest builds). A build of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The build and the state of its release.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Build"
                },
                "examples": {
                  "deployed": {
                    "summary": "A build that was deployed",
                    "value": {
                      "id": "bld_00000001a0fdd794980f85f9c353bf",
                      "revision": "main",
                      "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                      "builder": "railpack",
                      "port": null,
                      "framework": "next",
                      "static": false,
                      "status": "SUCCEEDED",
                      "release_status": "DEPLOYED",
                      "terminal": true,
                      "image_digest": "sha256:0b7eb1bc3e6480072dddfd667fe6003a3e729aba3f65cdc8ea01be89b01f8e3c",
                      "auto_deploy": "TRIGGERED",
                      "reused": false,
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "trigger": "api",
                      "pushed_by": null,
                      "api_key": {
                        "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                        "name": "CI"
                      },
                      "mcp_client": null,
                      "env_version": "e3a91c2",
                      "deployment_id": "dpl_00000002a0fdd794980f85f9c353bf",
                      "deployment": {
                        "id": "dpl_00000002a0fdd794980f85f9c353bf",
                        "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                        "image_digest": "sha256:0b7eb1bc3e6480072dddfd667fe6003a3e729aba3f65cdc8ea01be89b01f8e3c",
                        "status": "SUCCEEDED",
                        "public_url": "https://web-acme-3f9a2c.cubecen.app",
                        "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "trigger": "api",
                        "pushed_by": null,
                        "api_key": {
                          "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                          "name": "CI"
                        },
                        "mcp_client": null,
                        "env_version": "e3a91c2",
                        "created_at": "2026-10-25T09:14:03Z",
                        "started_at": "2026-10-25T09:14:04Z",
                        "finished_at": "2026-10-25T09:14:31Z"
                      },
                      "public_url": "https://web-acme-3f9a2c.cubecen.app",
                      "created_at": "2026-10-25T09:12:40Z",
                      "started_at": "2026-10-25T09:12:44Z",
                      "finished_at": "2026-10-25T09:14:02Z"
                    }
                  },
                  "failed": {
                    "summary": "A build that failed",
                    "value": {
                      "id": "bld_00000003a0fdd794980f85f9c353bf",
                      "revision": "feature/checkout",
                      "commit_sha": "b73a5f7f0d6cadd7602fbb6440a9434b4e1c8a90",
                      "builder": "railpack",
                      "port": null,
                      "framework": "next",
                      "static": false,
                      "status": "FAILED",
                      "release_status": "BUILD_FAILED",
                      "terminal": true,
                      "error": {
                        "code": "WORKFLOW_EXECUTION_FAILED",
                        "message": "The build step failed: the build command exited with status 1"
                      },
                      "auto_deploy": "SKIPPED",
                      "reused": false,
                      "created_by": null,
                      "trigger": "push",
                      "pushed_by": "octocat",
                      "api_key": null,
                      "mcp_client": null,
                      "env_version": "e3a91c2",
                      "created_at": "2026-10-25T10:31:08Z",
                      "started_at": "2026-10-25T10:31:12Z",
                      "finished_at": "2026-10-25T10:32:47Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/builds/{buildId}/cancel": {
      "post": {
        "operationId": "cancelBuild",
        "tags": [
          "builds"
        ],
        "summary": "Cancel a build",
        "description": "Asks for a build to be cancelled. It needs a key with full access.\n\nCancelling is not instant. The answer is the build as it is at that moment, often still `QUEUED` or `BUILDING`. Read the build with `getBuild` until `release_status` is `CANCELLED`, or another final status if the build finished first.\n\nCancelling a build that has finished changes nothing, and the answer is the build as it was. That holds for a build whose deployment is still going on too: this request cancels the build only. To stop a deployment, use `cancelDeployment`.\n\nIn this answer `created_by`, `trigger`, `pushed_by`, `api_key` and `mcp_client` are `null`. `getBuild` shows who started the build.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "buildId",
            "in": "path",
            "required": true,
            "description": "The ID of the build: the `id` you got when you started it. An opaque string that starts with `bld_` (`dep_` for the oldest builds). A build of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Cancelling the same build again is safe: the answer is the build as it is then, and nothing changes once the build has finished.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The build as it is now. It can still be running: cancelling is not instant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Build"
                },
                "example": {
                  "id": "bld_00000004a0fdd794980f85f9c353bf",
                  "revision": "main",
                  "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                  "builder": "railpack",
                  "port": null,
                  "framework": "next",
                  "static": false,
                  "status": "BUILDING",
                  "release_status": "BUILDING",
                  "terminal": false,
                  "auto_deploy": "PENDING",
                  "reused": false,
                  "created_by": null,
                  "trigger": null,
                  "pushed_by": null,
                  "api_key": null,
                  "mcp_client": null,
                  "env_version": "e3a91c2",
                  "created_at": "2026-10-25T11:20:05Z",
                  "started_at": "2026-10-25T11:20:09Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/deployments": {
      "get": {
        "operationId": "listDeployments",
        "tags": [
          "deployments"
        ],
        "summary": "List the deployments of a cube",
        "description": "Returns the deployments of a cube, newest first. The list is not paged.\n\nA deployment runs a build as the version of the cube that serves traffic. A build that deploys makes one when it finishes, and `createDeployment` makes one to redeploy or roll back. Both are listed here.\n\n`live_deployment_id` is the ID of the deployment that serves the cube now: the successful one that finished last. It is `null` when nothing is live. A cube that is still being set up has no deployments.\n\nTo see builds and deployments together, as the cube's history, use `listReleases`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deployments of the cube, newest first, and the one that is live.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentList"
                },
                "example": {
                  "data": [
                    {
                      "id": "dpl_00000005a0fdd794980f85f9c353bf",
                      "build_id": "bld_00000000a0fdd794980f85f9c353bf",
                      "image_digest": "sha256:8b0e7153bf7c3706d85c524e440066559a6656c90bd5482a90a29b9fa5ff5180",
                      "status": "DEPLOYING",
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "trigger": "api",
                      "pushed_by": null,
                      "api_key": {
                        "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                        "name": "CI"
                      },
                      "mcp_client": null,
                      "env_version": "b7d2e49",
                      "created_at": "2026-10-25T11:02:10Z",
                      "started_at": "2026-10-25T11:02:11Z"
                    },
                    {
                      "id": "dpl_00000002a0fdd794980f85f9c353bf",
                      "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                      "image_digest": "sha256:0b7eb1bc3e6480072dddfd667fe6003a3e729aba3f65cdc8ea01be89b01f8e3c",
                      "status": "SUCCEEDED",
                      "public_url": "https://web-acme-3f9a2c.cubecen.app",
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "trigger": "api",
                      "pushed_by": null,
                      "api_key": {
                        "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                        "name": "CI"
                      },
                      "mcp_client": null,
                      "env_version": "e3a91c2",
                      "created_at": "2026-10-25T09:14:03Z",
                      "started_at": "2026-10-25T09:14:04Z",
                      "finished_at": "2026-10-25T09:14:31Z"
                    }
                  ],
                  "live_deployment_id": "dpl_00000002a0fdd794980f85f9c353bf"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "post": {
        "operationId": "createDeployment",
        "tags": [
          "deployments"
        ],
        "summary": "Deploy a build again or roll back",
        "description": "Deploys a build that has already succeeded, without building it again. Use it to redeploy the version that is live, or to roll back to an earlier one. It needs a key with full access.\n\nSend `{\"build_id\": \"bld_...\"}` to deploy that build. It must be a successful build of this cube: a build that is queued, running, failed or cancelled is refused with `409` `BUILD_NOT_DEPLOYABLE`. A build that you started with `\"deploy\": false` can be deployed this way. Send `{}` to deploy the cube's latest successful build.\n\nThe answer is `202 Accepted` with the deployment, usually `QUEUED`. The `Location` header gives its path. Follow it with `getDeployment` until `status` is `SUCCEEDED`, `FAILED` or `CANCELLED`. A deployment that fails or is cancelled leaves the previous version serving.\n\nTo roll back with the variables that an earlier release ran with, add `env_version`: the `env_version` of that release, as `listReleases` and `getRelease` show it. Cubecen first makes those variables the current ones again, as a new version, unless the current ones already hold the same values, and then deploys with them. Old secret values come back too: a secret that you changed since returns to its old value. Without `env_version`, the deployment ships the current variables. Most refusals come before anything changes and leave the variables as they are. Two can come after the restore: `BUSY` and `ENV_REFERENCE_BROKEN`. Then the restored version stays the current one, so read the variables again before you retry.\n\nWhile any release of the cube is in progress, a new deployment is refused with `409` `DEPLOYMENT_IN_PROGRESS`: it would wait in line and then replace the newer release. A release is in progress when a deployment is `QUEUED` or `DEPLOYING`, or when a build that deploys when it finishes has not finished. A build that does not deploy does not count. To roll back at once, cancel the running release first, with `cancelDeployment` or `cancelBuild`.\n\nA cube that is not `active` cannot be deployed: the request is refused with `409` `APPLICATION_NOT_READY`. If a variable of the cube refers to a cube or database that is no longer in the project, or to a database that is being deleted, the request is refused with `422` `ENV_REFERENCE_BROKEN`: change the variable first.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A value that is unique to this deployment, such as a UUID: 1 to 255 visible ASCII characters. Send the same value when you retry the same request, and the retry returns the first answer instead of starting a second deployment; once the first request has finished, the answer carries `Idempotent-Replayed: true`. Use a new value for every new deployment. The same value with a different body is refused with `IDEMPOTENCY_KEY_REUSED`. Once a deployment has been refused for what it asks, for example with `DEPLOYMENT_IN_PROGRESS`, the same value keeps getting that answer: use a new value to try again.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeploymentCreate"
              },
              "examples": {
                "latest": {
                  "summary": "Deploy the latest successful build again",
                  "value": {}
                },
                "rollback": {
                  "summary": "Roll back to an earlier build and the variables it ran with",
                  "value": {
                    "build_id": "bld_00000000a0fdd794980f85f9c353bf",
                    "env_version": "b7d2e49"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "The deployment was accepted. It is usually `QUEUED`; follow it until `status` is `SUCCEEDED`, `FAILED` or `CANCELLED`.",
            "headers": {
              "Location": {
                "description": "The path of the new deployment.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the answer to a retry of a request that had already finished. Absent otherwise.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                },
                "example": {
                  "id": "dpl_00000005a0fdd794980f85f9c353bf",
                  "build_id": "bld_00000000a0fdd794980f85f9c353bf",
                  "image_digest": "sha256:8b0e7153bf7c3706d85c524e440066559a6656c90bd5482a90a29b9fa5ff5180",
                  "status": "QUEUED",
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "trigger": "api",
                  "pushed_by": null,
                  "api_key": {
                    "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                    "name": "CI"
                  },
                  "mcp_client": null,
                  "env_version": "b7d2e49",
                  "created_at": "2026-10-25T11:02:10Z"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported, or a field has the wrong type",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "idempotency_key": {
                    "summary": "The Idempotency-Key header is missing, or is not 1 to 255 visible ASCII characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "An Idempotency-Key header of 1 to 255 visible ASCII characters is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "Idempotency-Key"
                      }
                    }
                  },
                  "env_version_format": {
                    "summary": "env_version is not 7 lowercase hexadecimal characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "env_version must be an env_version of this cube",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "env_version"
                      }
                    }
                  },
                  "env_version_unknown": {
                    "summary": "The cube has no environment version with this ID",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "There is no such env version",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "env_version"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "DEPLOYMENT_IN_PROGRESS": {
                    "summary": "A release of this cube is already in progress. Wait for it, or cancel it.",
                    "value": {
                      "error": {
                        "code": "DEPLOYMENT_IN_PROGRESS",
                        "message": "A release of this cube is already in progress",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "BUILD_NOT_DEPLOYABLE": {
                    "summary": "The build is not a successful build of this cube",
                    "value": {
                      "error": {
                        "code": "BUILD_NOT_DEPLOYABLE",
                        "message": "Only successful builds can be deployed",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "build_id"
                      }
                    }
                  },
                  "APPLICATION_NOT_READY": {
                    "summary": "The cube is still being created, or its creation failed.",
                    "value": {
                      "error": {
                        "code": "APPLICATION_NOT_READY",
                        "message": "The cube is not ready for this operation",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "IDEMPOTENCY_KEY_REUSED": {
                    "summary": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action.",
                    "value": {
                      "error": {
                        "code": "IDEMPOTENCY_KEY_REUSED",
                        "message": "The Idempotency-Key was already used for a different request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "CONFLICT": {
                    "summary": "The request conflicts with the current state of the resource, or it expired and needs a new `Idempotency-Key`.",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "This request expired; send it again with a new Idempotency-Key",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "not_kept": {
                    "summary": "The values of the environment version are no longer kept",
                    "value": {
                      "error": {
                        "code": "ENV_VERSION_UNAVAILABLE",
                        "message": "The values of this env version are no longer kept, so it cannot be restored",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "env_version"
                      }
                    }
                  },
                  "not_readable": {
                    "summary": "A secret of the environment version can no longer be read",
                    "value": {
                      "error": {
                        "code": "ENV_VERSION_UNAVAILABLE",
                        "message": "A secret of this env version can no longer be decrypted, so it cannot be restored",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "env_version"
                      }
                    }
                  },
                  "BUSY": {
                    "summary": "Another operation on this cube is in progress. Retry in a few seconds.",
                    "value": {
                      "error": {
                        "code": "BUSY",
                        "message": "Another operation on this cube is in progress; retry shortly",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "422": {
            "description": "The request is well formed but cannot be carried out. `error.code` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing_cube": {
                    "summary": "A variable refers to a cube that is no longer in the project",
                    "value": {
                      "error": {
                        "code": "ENV_REFERENCE_BROKEN",
                        "message": "The variable API_URL refers to \"api\", which is no longer a cube of this project; change the variable, then deploy again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "missing_database": {
                    "summary": "A variable refers to a database that is being deleted or is gone",
                    "value": {
                      "error": {
                        "code": "ENV_REFERENCE_BROKEN",
                        "message": "The variable DATABASE_URL refers to \"db\", which is no longer a cube or database of this project; change the variable, then deploy again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "no_private_address": {
                    "summary": "A variable refers to the private address of a cube that has none yet",
                    "value": {
                      "error": {
                        "code": "ENV_REFERENCE_BROKEN",
                        "message": "The variable API_URL refers to the private address of \"api\", which has none yet; try again in a minute",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/deployments/{deploymentId}": {
      "get": {
        "operationId": "getDeployment",
        "tags": [
          "deployments"
        ],
        "summary": "Get a deployment",
        "description": "Returns one deployment of a cube.\n\nUse it to follow a deployment that you started with `createDeployment`. When `createBuild` with `reuse` deploys an earlier build again, its answer names the new deployment: follow that deployment here. Poll it every 3 to 5 seconds until `status` is `SUCCEEDED`, `FAILED` or `CANCELLED`. `QUEUED` and `DEPLOYING` mean keep polling.\n\nOnce the deployment has succeeded, `public_url` holds the address of the cube. When it fails, `error` says why, in words you can show. A failed or cancelled deployment leaves the previous version serving.\n\nA deployment of another cube is not found.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "The ID of the deployment: the `id` that `createDeployment` gave, or that `listDeployments` shows. An opaque string that starts with `dpl_`. A deployment of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deployment.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                },
                "example": {
                  "id": "dpl_00000002a0fdd794980f85f9c353bf",
                  "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                  "image_digest": "sha256:0b7eb1bc3e6480072dddfd667fe6003a3e729aba3f65cdc8ea01be89b01f8e3c",
                  "status": "SUCCEEDED",
                  "public_url": "https://web-acme-3f9a2c.cubecen.app",
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "trigger": "api",
                  "pushed_by": null,
                  "api_key": {
                    "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                    "name": "CI"
                  },
                  "mcp_client": null,
                  "env_version": "e3a91c2",
                  "created_at": "2026-10-25T09:14:03Z",
                  "started_at": "2026-10-25T09:14:04Z",
                  "finished_at": "2026-10-25T09:14:31Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/deployments/{deploymentId}/cancel": {
      "post": {
        "operationId": "cancelDeployment",
        "tags": [
          "deployments"
        ],
        "summary": "Cancel a deployment",
        "description": "Asks for a deployment to be cancelled. It needs a key with full access.\n\nCancelling is not instant. The answer is the deployment as it is at that moment, often still `QUEUED` or `DEPLOYING`. Read the deployment with `getDeployment` until `status` is `CANCELLED`, or another final status if it finished first. A cancelled deployment leaves the previous version serving. Cancelling a deployment that has finished changes nothing.\n\nCancel a running release to roll back right away: while a release is in progress, `createDeployment` is refused.\n\nIn this answer `created_by`, `trigger`, `pushed_by`, `api_key` and `mcp_client` are `null`. `getDeployment` shows who started the deployment.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "The ID of the deployment: the `id` that `createDeployment` gave, or that `listDeployments` shows. An opaque string that starts with `dpl_`. A deployment of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Cancelling the same deployment again is safe: the answer is the deployment as it is then, and nothing changes once it has finished.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deployment as it is now. It can still be running: cancelling is not instant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deployment"
                },
                "example": {
                  "id": "dpl_00000005a0fdd794980f85f9c353bf",
                  "build_id": "bld_00000000a0fdd794980f85f9c353bf",
                  "image_digest": "sha256:8b0e7153bf7c3706d85c524e440066559a6656c90bd5482a90a29b9fa5ff5180",
                  "status": "DEPLOYING",
                  "created_by": null,
                  "trigger": null,
                  "pushed_by": null,
                  "api_key": null,
                  "mcp_client": null,
                  "env_version": "b7d2e49",
                  "created_at": "2026-10-25T11:02:10Z",
                  "started_at": "2026-10-25T11:02:11Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/releases": {
      "get": {
        "operationId": "listReleases",
        "tags": [
          "releases"
        ],
        "summary": "List the releases of a cube",
        "description": "Returns the history of a cube, newest first, a page at a time.\n\nA release is a build together with the deployment that follows it, or a deployment of its own: a redeploy or a rollback. A build's own deployment belongs to its release and is not listed separately. `kind` says which it is: `deploy` (a build that deploys, or a deployment of a build newer than the one that is live), `build` (a build that does not deploy), `redeploy` (a deployment of the build that is live) or `rollback` (a deployment of an older build). `id` is the build's ID, or the deployment's ID for a redeploy and a rollback.\n\nUse the list to see what was released and by whom, and to find the build to roll back to. Pass its `build_id`, and its `env_version` to bring back its variables too, to `createDeployment`. `stages` shows the build step and the deploy step of a release, each with its own status.\n\nThe answer holds up to `limit` releases in `data`. When there are more, `next_cursor` is set: send it back as `cursor` to get the next page. On the last page `next_cursor` is `null`. `live_deployment_id` is the ID of the deployment that serves the cube now, or `null` when nothing is live.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most releases to return in a page, from 1 to 100. The default is 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where the next page starts: an opaque value. Send the `next_cursor` of the previous page as it is. Leave it out to get the first page. A value that does not belong to this list is refused with `400`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the cube's releases, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleasePage"
                },
                "example": {
                  "data": [
                    {
                      "id": "dpl_00000005a0fdd794980f85f9c353bf",
                      "kind": "rollback",
                      "build_id": "bld_00000000a0fdd794980f85f9c353bf",
                      "deployment_id": "dpl_00000005a0fdd794980f85f9c353bf",
                      "revision": "main",
                      "commit_sha": "bc0dbc0e15637ebb8e3b91d26ab4a829a95249f5",
                      "builder": "railpack",
                      "release_status": "DEPLOYING",
                      "terminal": false,
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "trigger": "api",
                      "pushed_by": null,
                      "api_key": {
                        "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                        "name": "CI"
                      },
                      "mcp_client": null,
                      "created_at": "2026-10-25T11:02:10Z",
                      "started_at": "2026-10-25T11:02:11Z",
                      "stages": {
                        "build": null,
                        "deploy": {
                          "status": "DEPLOYING",
                          "started_at": "2026-10-25T11:02:11Z"
                        }
                      },
                      "env_version": "b7d2e49"
                    },
                    {
                      "id": "bld_00000001a0fdd794980f85f9c353bf",
                      "kind": "deploy",
                      "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                      "deployment_id": "dpl_00000002a0fdd794980f85f9c353bf",
                      "revision": "main",
                      "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                      "builder": "railpack",
                      "release_status": "DEPLOYED",
                      "terminal": true,
                      "public_url": "https://web-acme-3f9a2c.cubecen.app",
                      "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                      "trigger": "api",
                      "pushed_by": null,
                      "api_key": {
                        "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                        "name": "CI"
                      },
                      "mcp_client": null,
                      "created_at": "2026-10-25T09:12:40Z",
                      "started_at": "2026-10-25T09:12:44Z",
                      "finished_at": "2026-10-25T09:14:31Z",
                      "stages": {
                        "build": {
                          "status": "SUCCEEDED",
                          "started_at": "2026-10-25T09:12:44Z",
                          "finished_at": "2026-10-25T09:14:02Z"
                        },
                        "deploy": {
                          "status": "SUCCEEDED",
                          "started_at": "2026-10-25T09:14:04Z",
                          "finished_at": "2026-10-25T09:14:31Z"
                        }
                      },
                      "env_version": "e3a91c2"
                    }
                  ],
                  "live_deployment_id": "dpl_00000002a0fdd794980f85f9c353bf",
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "limit": {
                    "summary": "limit is not a number from 1 to 100",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "limit must be between 1 and 100",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "limit"
                      }
                    }
                  },
                  "cursor": {
                    "summary": "cursor is not one that this list gave",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "cursor is invalid for this list",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "cursor"
                      }
                    }
                  },
                  "repeated": {
                    "summary": "A parameter is repeated, or the query string is not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/releases/{releaseId}": {
      "get": {
        "operationId": "getRelease",
        "tags": [
          "releases"
        ],
        "summary": "Get a release",
        "description": "Returns one release of a cube: a build with the deployment that follows it, or a deployment of its own.\n\n`releaseId` is the ID of a build, or of a deployment that is a release of its own: a redeploy or a rollback. The ID of the deployment that a build made on its own is accepted too, and gives that build's release. `kind` says what the release is, as in `listReleases`.\n\nUse it to follow a release as a whole. `release_status` and `terminal` say where it is, and `stages` shows its build step and its deploy step. When a build or a deployment fails, `error` says why, in words you can show. `env_version` is the version of the variables the release ran with: pass it to `createDeployment` to roll back with them.\n\nA release of another cube is not found.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "releaseId",
            "in": "path",
            "required": true,
            "description": "The ID of the release: the `id` of a build (`bld_...`), or of a deployment that is a release of its own, a redeploy or a rollback (`dpl_...`). The ID of the deployment that a build made on its own is accepted too, and gives that build's release. A release of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The release.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Release"
                },
                "example": {
                  "id": "bld_00000001a0fdd794980f85f9c353bf",
                  "kind": "deploy",
                  "build_id": "bld_00000001a0fdd794980f85f9c353bf",
                  "deployment_id": "dpl_00000002a0fdd794980f85f9c353bf",
                  "revision": "main",
                  "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                  "builder": "railpack",
                  "release_status": "DEPLOYED",
                  "terminal": true,
                  "public_url": "https://web-acme-3f9a2c.cubecen.app",
                  "created_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                  "trigger": "api",
                  "pushed_by": null,
                  "api_key": {
                    "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                    "name": "CI"
                  },
                  "mcp_client": null,
                  "created_at": "2026-10-25T09:12:40Z",
                  "started_at": "2026-10-25T09:12:44Z",
                  "finished_at": "2026-10-25T09:14:31Z",
                  "stages": {
                    "build": {
                      "status": "SUCCEEDED",
                      "started_at": "2026-10-25T09:12:44Z",
                      "finished_at": "2026-10-25T09:14:02Z"
                    },
                    "deploy": {
                      "status": "SUCCEEDED",
                      "started_at": "2026-10-25T09:14:04Z",
                      "finished_at": "2026-10-25T09:14:31Z"
                    }
                  },
                  "env_version": "e3a91c2"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/builds/{buildId}/logs": {
      "get": {
        "operationId": "getBuildLogs",
        "tags": [
          "logs"
        ],
        "summary": "Stream the logs of a build",
        "description": "Streams the log lines of one build, from fetching the source to pushing the image, as Server-Sent Events (`text/event-stream`). Use it to see why a build failed, or to follow a build that is running. It needs only read access.\n\nWithout `follow`, the stream sends the lines that exist and ends with an `end` event. With `follow=true` it stays open and sends new lines a few seconds after they are printed. When the build has finished and every line is sent, the stream ends with `complete: true`.\n\nTo continue after a broken connection, send the `id` of the last event you received as `cursor`. `tail` and `since` are for the output of a running cube (`getApplicationLogs`): without a `cursor`, a request that has one of them is refused with `400`.\n\nBuild logs are kept for 30 days. A build of another cube is not found. The events are described under the response.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "buildId",
            "in": "path",
            "required": true,
            "description": "The ID of the build: the `id` you got when you started it. An opaque string that starts with `bld_` (`dep_` for the oldest builds). A build of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "follow",
            "in": "query",
            "required": false,
            "description": "`true` keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with `false`, the stream sends the lines that exist and ends.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where to continue a stream: the `id` of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with `400`; the message differs between the two, so match on the code. Leave it out to start at the beginning.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The same as `cursor`: the `id` of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The log lines, as a stream of Server-Sent Events.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStream"
                },
                "example": "retry: 3000\n: connected\n\nid: Mzc4MQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:12:44.120483Z\",\"source\":\"build\",\"step\":\"fetch\",\"line\":\"Fetching revision main\"}\n\nid: Mzc4Mg\nevent: log\ndata: {\"time\":\"2026-10-25T09:12:51.903112Z\",\"source\":\"build\",\"step\":\"build\",\"line\":\"#5 [2/4] RUN npm ci\"}\n\nid: Mzc4Mw\nevent: end\ndata: {\"complete\":true,\"cursor\":\"Mzc4Mw\"}\n"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationErrorAnd2More"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "No such build in this cube",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Resource not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited4292"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/LogsUnavailableAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/deployments/{deploymentId}/logs": {
      "get": {
        "operationId": "getDeploymentLogs",
        "tags": [
          "logs"
        ],
        "summary": "Stream the logs of a deployment",
        "description": "Streams the log lines of one deployment as Server-Sent Events (`text/event-stream`): its own steps (`apply` and `rollout`), the output of the new pods as they start, and the pod events that happen while it rolls out, such as a restart. Use it to see why a deployment failed, or to follow one that is going on. It needs only read access.\n\nWithout `follow`, the stream sends the lines that exist and ends with an `end` event. With `follow=true` it stays open and sends new lines a few seconds after they are printed. When the deployment has finished and every line is sent, the stream ends with `complete: true`.\n\nTo continue after a broken connection, send the `id` of the last event you received as `cursor`. `tail` and `since` are for the output of a running cube (`getApplicationLogs`): without a `cursor`, a request that has one of them is refused with `400`.\n\nDeployment logs are kept for 30 days. A deployment of another cube is not found. The events are described under the response.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "The ID of the deployment: the `id` that `createDeployment` gave, or that `listDeployments` shows. An opaque string that starts with `dpl_`. A deployment of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "follow",
            "in": "query",
            "required": false,
            "description": "`true` keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with `false`, the stream sends the lines that exist and ends.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where to continue a stream: the `id` of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with `400`; the message differs between the two, so match on the code. Leave it out to start at the beginning.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The same as `cursor`: the `id` of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The log lines, as a stream of Server-Sent Events.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStream"
                },
                "example": "retry: 3000\n: connected\n\nid: NDEwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:14:04.511903Z\",\"source\":\"deploy\",\"step\":\"apply\",\"line\":\"Applying the new version\"}\n\nid: NDEwMg\nevent: log\ndata: {\"time\":\"2026-10-25T09:14:19.340771Z\",\"source\":\"event\",\"reason\":\"Pulled\",\"event_type\":\"Normal\",\"object\":\"Pod/app-4c1d9e07-7784d7c787-fk4jm\",\"line\":\"Successfully pulled image\"}\n\nid: NDEwMw\nevent: end\ndata: {\"complete\":true,\"cursor\":\"NDEwMw\"}\n"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationErrorAnd2More"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "No such deployment in this cube",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Resource not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited4292"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/LogsUnavailableAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/logs": {
      "get": {
        "operationId": "getApplicationLogs",
        "tags": [
          "logs"
        ],
        "summary": "Stream the logs of a cube",
        "description": "Streams what a running cube prints, from all of its replicas, together with its pod events, as Server-Sent Events (`text/event-stream`). Use it to see what a cube prints now, or what it printed a little while ago. It needs only read access.\n\nThe stream starts with a window of the output: the last `tail` lines (1 to 1000), or the lines since `since`, or the last 100 lines when you send neither. `tail` and `since` together are refused with `400`. Without `follow`, the stream ends with an `end` event after the window. With `follow=true` it stays open and sends new lines a few seconds after they are printed.\n\nTo continue after a broken connection, send the `id` of the last event you received as `cursor`. It wins over `tail` and `since`.\n\nLines are shown as the cube printed them. What a cube prints is not hidden, secrets included, so do not print secrets. A cube's output is kept for `logs_retention_days` days (see `getOrganizationPlan`). A cube that is not set up yet, for example while it is being created, has no logs and is answered with `404`. The events are described under the response.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "follow",
            "in": "query",
            "required": false,
            "description": "`true` keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with `false`, the stream sends the lines that exist and ends.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where to continue a stream: the `id` of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with `400`; the message differs between the two, so match on the code. Leave it out to start at the beginning.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "tail",
            "in": "query",
            "required": false,
            "description": "Start with the last N lines, from 1 to 1000. Without `tail`, `since` or a `cursor`, the last 100 lines. Not together with `since`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Start at this time, as an RFC 3339 time, instead of with the last lines. Not together with `tail`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The same as `cursor`: the `id` of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The log lines, as a stream of Server-Sent Events.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStream"
                },
                "example": "retry: 3000\n: connected\n\nid: NTIwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:20:01.204118Z\",\"source\":\"runtime\",\"pod\":\"app-4c1d9e07-7784d7c787-fk4jm\",\"line\":\"Listening on port 8080\"}\n\nid: NTIwMg\nevent: log\ndata: {\"time\":\"2026-10-25T09:20:09.774002Z\",\"source\":\"runtime\",\"pod\":\"app-4c1d9e07-7784d7c787-fk4jm\",\"line\":\"GET /health 200 2ms\"}\n\n: ping\n"
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "follow": {
                    "summary": "follow is not true or false",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "follow must be true or false",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "follow"
                      }
                    }
                  },
                  "cursor": {
                    "summary": "The cursor is not a log position, or the position has expired",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "The log position is invalid; reload the logs",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "cursor"
                      }
                    }
                  },
                  "tail": {
                    "summary": "tail is not a whole number from 1 to 1000",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "tail must be between 1 and 1000",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "tail"
                      }
                    }
                  },
                  "since": {
                    "summary": "since is not an RFC 3339 time",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "since must be an RFC 3339 time",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "since"
                      }
                    }
                  },
                  "tail_and_since": {
                    "summary": "tail and since are both sent",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Use tail or since, not both",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "since"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4042"
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited4292"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/LogsUnavailableAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/metrics": {
      "get": {
        "operationId": "getApplicationMetrics",
        "tags": [
          "logs"
        ],
        "summary": "Get the metrics of a cube",
        "description": "Returns the resource use, traffic and health of a cube over a window of time, ready for charts: CPU, memory, network, requests by status class, the share of failed requests, latency, restarts and replicas. It needs only read access.\n\nThe window is `range` (`1h` by default, `6h`, `24h`, `7d` or `30d`, ending now), or `from` and `to`, at most 30 days apart. Do not send `range` together with `from` or `to`. `step` is the number of seconds between points, from 30 to 86400, with at most 1000 points. Without `step`, it is the smallest multiple of 30 seconds that gives at most 240 points. `from` and `to` are rounded down to a multiple of the step, so the same window always gives the same points.\n\nEvery series is a list of points, `[unix seconds, value]`, oldest first. A missing point is a gap, for example while the cube was not running or got no requests: draw it as a gap, not as zero. A series without points is `[]`.\n\nSamples appear 30 to 60 seconds after the fact, so the newest point can be missing. An answer is kept for 30 seconds: refresh an open chart at most every 30 seconds, and every few minutes for ranges over a day. Metrics are kept for `metrics_retention_days` days (see `getOrganizationPlan`).\n\nA cube that is not set up yet, for example while it is being created, has no metrics and is answered with `404`. When metrics cannot be read for a moment, the answer is `503` `METRICS_UNAVAILABLE` with `Retry-After`: retry with backoff.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "The window, ending now: `1h` (the default), `6h`, `24h`, `7d` or `30d`. Not together with `from` or `to`.",
            "schema": {
              "type": "string",
              "enum": [
                "1h",
                "6h",
                "24h",
                "7d",
                "30d"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "The start of the window, as an RFC 3339 time. Without it, one hour before `to`. At most 30 days before `to`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "The end of the window, as an RFC 3339 time. Without it, now. A time in the future counts as now.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "step",
            "in": "query",
            "required": false,
            "description": "The seconds between points, from 30 to 86400. The window can have at most 1000 points. Without it, the smallest multiple of 30 that gives at most 240 points.",
            "schema": {
              "type": "integer",
              "minimum": 30,
              "maximum": 86400
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The metrics of the cube over the window.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Metrics"
                },
                "example": {
                  "from": "2026-10-25T09:00:00Z",
                  "to": "2026-10-25T09:01:00Z",
                  "step": 30,
                  "cpu": {
                    "unit": "cores",
                    "total": [
                      [
                        1792918800,
                        0.012
                      ],
                      [
                        1792918830,
                        0.015
                      ],
                      [
                        1792918860,
                        0.011
                      ]
                    ],
                    "limit": [
                      [
                        1792918800,
                        0.5
                      ],
                      [
                        1792918830,
                        0.5
                      ],
                      [
                        1792918860,
                        0.5
                      ]
                    ],
                    "pods": [
                      {
                        "pod": "app-4c1d9e07-7784d7c787-fk4jm",
                        "points": [
                          [
                            1792918800,
                            0.012
                          ],
                          [
                            1792918830,
                            0.015
                          ],
                          [
                            1792918860,
                            0.011
                          ]
                        ]
                      }
                    ]
                  },
                  "memory": {
                    "unit": "bytes",
                    "total": [
                      [
                        1792918800,
                        52428800
                      ],
                      [
                        1792918830,
                        52953088
                      ],
                      [
                        1792918860,
                        52953088
                      ]
                    ],
                    "limit": [
                      [
                        1792918800,
                        2147483648
                      ],
                      [
                        1792918830,
                        2147483648
                      ],
                      [
                        1792918860,
                        2147483648
                      ]
                    ],
                    "pods": [
                      {
                        "pod": "app-4c1d9e07-7784d7c787-fk4jm",
                        "points": [
                          [
                            1792918800,
                            52428800
                          ],
                          [
                            1792918830,
                            52953088
                          ],
                          [
                            1792918860,
                            52953088
                          ]
                        ]
                      }
                    ]
                  },
                  "network": {
                    "unit": "bytes/s",
                    "receive": [
                      [
                        1792918800,
                        1840.5
                      ],
                      [
                        1792918830,
                        2210.2
                      ],
                      [
                        1792918860,
                        1795.8
                      ]
                    ],
                    "transmit": [
                      [
                        1792918800,
                        9120.4
                      ],
                      [
                        1792918830,
                        10480.9
                      ],
                      [
                        1792918860,
                        8870.1
                      ]
                    ]
                  },
                  "requests": {
                    "unit": "requests/s",
                    "total": [
                      [
                        1792918800,
                        3.2
                      ],
                      [
                        1792918830,
                        3.9
                      ],
                      [
                        1792918860,
                        3.1
                      ]
                    ],
                    "1xx": [],
                    "2xx": [
                      [
                        1792918800,
                        3.1
                      ],
                      [
                        1792918830,
                        3.8
                      ],
                      [
                        1792918860,
                        3.1
                      ]
                    ],
                    "3xx": [],
                    "4xx": [
                      [
                        1792918800,
                        0.1
                      ],
                      [
                        1792918830,
                        0.1
                      ]
                    ],
                    "5xx": []
                  },
                  "error_rate": {
                    "unit": "ratio",
                    "points": [
                      [
                        1792918800,
                        0
                      ],
                      [
                        1792918830,
                        0
                      ],
                      [
                        1792918860,
                        0
                      ]
                    ]
                  },
                  "latency": {
                    "unit": "seconds",
                    "p50": [
                      [
                        1792918800,
                        0.012
                      ],
                      [
                        1792918830,
                        0.011
                      ],
                      [
                        1792918860,
                        0.012
                      ]
                    ],
                    "p95": [
                      [
                        1792918800,
                        0.045
                      ],
                      [
                        1792918830,
                        0.048
                      ],
                      [
                        1792918860,
                        0.044
                      ]
                    ],
                    "p99": [
                      [
                        1792918800,
                        0.09
                      ],
                      [
                        1792918830,
                        0.12
                      ],
                      [
                        1792918860,
                        0.08
                      ]
                    ]
                  },
                  "restarts": {
                    "unit": "count",
                    "points": [
                      [
                        1792918800,
                        0
                      ],
                      [
                        1792918830,
                        0
                      ],
                      [
                        1792918860,
                        0
                      ]
                    ]
                  },
                  "replicas": {
                    "unit": "count",
                    "ready": [
                      [
                        1792918800,
                        1
                      ],
                      [
                        1792918830,
                        1
                      ],
                      [
                        1792918860,
                        1
                      ]
                    ],
                    "desired": [
                      [
                        1792918800,
                        1
                      ],
                      [
                        1792918830,
                        1
                      ],
                      [
                        1792918860,
                        1
                      ]
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "range": {
                    "summary": "range is not one of the values",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "range must be 1h, 6h, 24h, 7d or 30d",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "range"
                      }
                    }
                  },
                  "range_and_time": {
                    "summary": "range is sent together with from or to",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Use range or from and to, not both",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "range"
                      }
                    }
                  },
                  "time": {
                    "summary": "from or to is not an RFC 3339 time, from is not before to, or the window is longer than 30 days",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "from must be before to",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "from"
                      }
                    }
                  },
                  "step": {
                    "summary": "step is not from 30 to 86400, or the window would have more than 1000 points",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "At most 1000 points: use a larger step",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "step"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4042"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
            "headers": {
              "Retry-After": {
                "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "METRICS_UNAVAILABLE": {
                    "summary": "Metrics are temporarily unavailable. Retry after the seconds in `Retry-After`.",
                    "value": {
                      "error": {
                        "code": "METRICS_UNAVAILABLE",
                        "message": "Metrics are temporarily unavailable; try again shortly",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "DATABASE_UNAVAILABLE": {
                    "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                    "value": {
                      "error": {
                        "code": "DATABASE_UNAVAILABLE",
                        "message": "Database unavailable",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/env": {
      "get": {
        "operationId": "getEnvironment",
        "tags": [
          "environment"
        ],
        "summary": "Get the variables and secrets of a cube",
        "description": "Returns the variables and secrets of a cube, sorted by key, at the current version of its environment. It needs only read access.\n\nA variable shows its `value`. A secret never does: its `value` is always `null`, because a secret can be written but not read. Anyone who can read the cube can read its variables, so keep secrets out of variables.\n\n`env_version` names the current version: 7 lowercase hexadecimal characters, such as `7f20b1d`. Every change that alters something makes a new version with a new ID. IDs do not count up: compare them only for equality. `env_version` is `null` before the first change. The environment can be read and changed while the cube is being created, is active or has failed, so that a failed first deploy can be fixed. For a cube in any other state, the request is `404`.\n\nA change reaches the running cube with the next build or deployment. `live_env_version` is the version the live deployment runs with, and `live_build_env_version` the one its build was made with. Both are `null` when nothing is live. `live_env_behind` is `true` when the live deployment runs with other values than the current ones. An entry with `build` set to `true` is read by the build: `live_build_env_behind` is `true` when one of them differs from what the live build was made with, and `build_keys_behind` names them. Then apply the change with a new build (`createBuild`). Otherwise, when only `live_env_behind` is `true`, a redeploy is enough (`createDeployment`).\n\n`platform` lists the variables that Cubecen sets in every cube. They are read-only, their names are reserved, and they are not part of `entries`. `limits` says how much an environment can hold.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The variables and secrets at the current version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Env"
                },
                "example": {
                  "env_version": "7f20b1d",
                  "live_env_version": "e3a91c2",
                  "live_build_env_version": "e3a91c2",
                  "live_env_behind": true,
                  "live_build_env_behind": true,
                  "build_keys_behind": [
                    "VITE_API_URL"
                  ],
                  "databases_behind": [],
                  "entries": [
                    {
                      "key": "DATABASE_URL",
                      "type": "secret",
                      "value": null,
                      "previews": false,
                      "build": false,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-20T10:02:11Z"
                    },
                    {
                      "key": "LOG_LEVEL",
                      "type": "variable",
                      "value": "info",
                      "previews": true,
                      "build": false,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-20T10:02:11Z"
                    },
                    {
                      "key": "VITE_API_URL",
                      "type": "variable",
                      "value": "https://api.example.com",
                      "previews": true,
                      "build": true,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-24T14:30:05Z"
                    }
                  ],
                  "platform": [
                    {
                      "key": "CUBECEN_CUBE_NAME",
                      "value": "Web",
                      "next_deploy": true
                    },
                    {
                      "key": "CUBECEN_DEPLOYMENT_ID",
                      "value": "dpl_00000002a0fdd794980f85f9c353bf",
                      "next_deploy": false
                    },
                    {
                      "key": "CUBECEN_PROJECT",
                      "value": "Storefront",
                      "next_deploy": true
                    },
                    {
                      "key": "CUBECEN_REGION",
                      "value": null,
                      "next_deploy": false
                    },
                    {
                      "key": "CUBECEN_WORKSPACE",
                      "value": "Acme",
                      "next_deploy": true
                    }
                  ],
                  "limits": {
                    "max_entries": 200,
                    "max_key_length": 128,
                    "max_value_bytes": 65536,
                    "max_total_bytes": 262144
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound404"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "patch": {
        "operationId": "updateEnvironment",
        "tags": [
          "environment"
        ],
        "summary": "Change the variables and secrets of a cube",
        "description": "Adds, changes and removes variables and secrets in one atomic change: all of it is applied, or none of it. It needs a key with full access.\n\nSend `expected_version`: the `env_version` that your change is based on, as `getEnvironment` gave it, or `null` for the first change. It is required. If the environment has changed since, the request is refused with `409` `ENV_CHANGED`: read the environment again, check what you change and send it again.\n\n`set` adds or replaces entries. Each has a `key`, a `type` (`variable` or `secret`) and a `value`. The value is required: it can be empty or span several lines, and it cannot contain a NUL character. To change only the marks of an entry that exists, leave `value` out and send its `type` with `build` or, for a secret, `previews`. `delete` lists the keys to remove. A key cannot be in both lists, and the change needs at least one entry in either.\n\n`build` marks a key that the build reads, such as `VITE_API_URL`: a change to a marked key needs a new build, and a change to the others needs only a redeploy. Left out, a key keeps its mark, and a new key starts without one. `previews` is for secrets: whether pull request previews get the secret. Variables go to previews, so `previews: false` on a variable is refused, except on one that refers to a database, which previews never get. Left out, a secret keeps its mark, and a new secret starts without one.\n\nA secret never turns into a variable without a new value. A variable becomes a secret when you send its value again with `type` set to `secret`.\n\nA key is 1 to 128 letters, digits and `_`, and does not start with a digit. `PORT` and the names that start with a prefix of the platform, such as `CUBECEN_` and `KUBERNETES_`, are set by Cubecen: they are refused with `ENV_KEY_RESERVED`. A cube can have 200 entries, a value can be 64 KiB, and keys and values together can be 256 KiB. More is refused with `ENV_TOO_LARGE`.\n\nA variable can refer to another cube of the same project: `${{ api.PUBLIC_URL }}` or `${{ api.PUBLIC_HOST }}`, where `api` is the slug of that cube. `${{ api.PRIVATE_URL }}` gives its address on the project's private network. A reference is resolved each time a build or deployment starts. A reference to no cube of the project, a reference with another field, a reference in a secret, and `PRIVATE_URL` in a variable that a browser reads, such as one that starts with `VITE_` or `NEXT_PUBLIC_`, are refused with `400`. A variable can also refer to a database of the project: `${{ db.DATABASE_URL }}` for the pooled connection or `${{ db.DATABASE_URL_UNPOOLED }}` for the direct one, where `db` is the database's slug. It is sent to the cube as a secret, pull request previews never get it, and it is refused with `400` in a variable that a browser reads. A build or deployment is refused with `409` `DATABASE_NOT_READY` while the database is not ready. Any other `${{ ... }}` text in a variable is refused with `400` too, because it would be taken for a reference; a secret can hold it, since a secret is never resolved.\n\nA change that alters nothing is answered with the current state and makes no new version. The answer is the environment at the new version, as `getEnvironment` shows it. The change reaches the running cube with the next build or deployment: `live_env_behind` and `live_build_env_behind` in the answer say which one.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional, and recommended. A value that is unique to this change, such as a UUID: 1 to 255 visible ASCII characters. Send the same value when you retry the same request, and the retry returns the answer of the first request, with `Idempotent-Replayed: true`, instead of changing the environment again. The same value with other keys, types, marks, deleted keys or version is refused with `IDEMPOTENCY_KEY_REUSED`. Values are not compared, to keep secrets out of the record: a request with the same value and other values gets the first answer and changes nothing, so use a new value for every new change. Without it, a retry of a change that was applied is refused with `ENV_CHANGED`, because the version has moved on.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvPatch"
              },
              "example": {
                "expected_version": "7f20b1d",
                "set": [
                  {
                    "key": "LOG_LEVEL",
                    "type": "variable",
                    "value": "debug"
                  },
                  {
                    "key": "STRIPE_KEY",
                    "type": "secret",
                    "value": "example-secret-value"
                  }
                ],
                "delete": [
                  "OLD_FLAG"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The variables and secrets at the new version. A change that alters nothing answers the current version.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "`true` when this is the answer to a retry of a request that had already finished. Absent otherwise.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Env"
                },
                "example": {
                  "env_version": "9b1f0c4",
                  "live_env_version": "e3a91c2",
                  "live_build_env_version": "e3a91c2",
                  "live_env_behind": true,
                  "live_build_env_behind": false,
                  "build_keys_behind": [],
                  "databases_behind": [],
                  "entries": [
                    {
                      "key": "DATABASE_URL",
                      "type": "secret",
                      "value": null,
                      "previews": false,
                      "build": false,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-20T10:02:11Z"
                    },
                    {
                      "key": "LOG_LEVEL",
                      "type": "variable",
                      "value": "debug",
                      "previews": true,
                      "build": false,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-25T11:05:42Z"
                    },
                    {
                      "key": "STRIPE_KEY",
                      "type": "secret",
                      "value": null,
                      "previews": false,
                      "build": false,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-25T11:05:42Z"
                    },
                    {
                      "key": "VITE_API_URL",
                      "type": "variable",
                      "value": "https://api.example.com",
                      "previews": true,
                      "build": true,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-24T14:30:05Z"
                    }
                  ],
                  "platform": [
                    {
                      "key": "CUBECEN_CUBE_NAME",
                      "value": "Web",
                      "next_deploy": true
                    },
                    {
                      "key": "CUBECEN_DEPLOYMENT_ID",
                      "value": "dpl_00000002a0fdd794980f85f9c353bf",
                      "next_deploy": false
                    },
                    {
                      "key": "CUBECEN_PROJECT",
                      "value": "Storefront",
                      "next_deploy": true
                    },
                    {
                      "key": "CUBECEN_REGION",
                      "value": null,
                      "next_deploy": false
                    },
                    {
                      "key": "CUBECEN_WORKSPACE",
                      "value": "Acme",
                      "next_deploy": true
                    }
                  ],
                  "limits": {
                    "max_entries": 200,
                    "max_key_length": 128,
                    "max_value_bytes": 65536,
                    "max_total_bytes": 262144
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "idempotency_key": {
                    "summary": "The Idempotency-Key is not 1 to 255 visible ASCII characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "An Idempotency-Key header of 1 to 255 visible ASCII characters is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "Idempotency-Key"
                      }
                    }
                  },
                  "expected_version": {
                    "summary": "expected_version is missing, or is not an env_version of this cube",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "expected_version is required: the env_version the change is based on",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "expected_version"
                      }
                    }
                  },
                  "empty": {
                    "summary": "Neither set nor delete has an entry",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Send at least one entry to set or delete",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "set"
                      }
                    }
                  },
                  "key": {
                    "summary": "A key in set is not valid, or is listed twice",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "A key is 1 to 128 letters, digits or _ and does not start with a digit",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "set[0].key"
                      }
                    }
                  },
                  "value": {
                    "summary": "A value is missing or not valid, or a reference in it is not allowed. error.field can also be set[0].type or set[0].previews",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "value is required, except to change only an existing entry's marks (build, or a secret's previews)",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "set[0].value"
                      }
                    }
                  },
                  "delete": {
                    "summary": "A key to delete is not in the environment, is listed twice, or is also in set",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "There is no such key",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "delete[0]"
                      }
                    }
                  },
                  "ENV_KEY_RESERVED": {
                    "summary": "The key is set by the platform, such as `PORT` or a name that starts with `CUBECEN_`. Choose another key.",
                    "value": {
                      "error": {
                        "code": "ENV_KEY_RESERVED",
                        "message": "PORT is set by the platform",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "set[0].key"
                      }
                    }
                  },
                  "ENV_TOO_LARGE": {
                    "summary": "The variables are over a limit. A cube can have 200 entries, a value can be 64 KiB, and keys and values together can be 256 KiB.",
                    "value": {
                      "error": {
                        "code": "ENV_TOO_LARGE",
                        "message": "A value can be at most 64 KiB",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "set[0].value"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound404"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "ENV_CHANGED": {
                    "summary": "The variables changed since you read them: `expected_version` is not the current version. Read them again, check your change and send it again.",
                    "value": {
                      "error": {
                        "code": "ENV_CHANGED",
                        "message": "The env changed since it was loaded; review it and save again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "IDEMPOTENCY_KEY_REUSED": {
                    "summary": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action.",
                    "value": {
                      "error": {
                        "code": "IDEMPOTENCY_KEY_REUSED",
                        "message": "The Idempotency-Key was already used for a different request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/env/versions": {
      "get": {
        "operationId": "listEnvironmentVersions",
        "tags": [
          "environment"
        ],
        "summary": "List the versions of the variables of a cube",
        "description": "Returns the history of a cube's variables and secrets, newest first, a page at a time. It needs only read access.\n\nEach version has its `version` ID, its `kind`, who made it and when, and the keys it added, changed and removed in `changes`. The history never shows values, not even of variables: an older version may hold a value as a variable that was later made a secret. The first item of the first page is the current version.\n\n`kind` is `change` (a write) or `restore` (the values of an older version made current again). A restore names the version it brought back in `restored_from`, and `deployment_id` is the rollback that restored it, or `null`. `created_by` is the user who made the version. `api_key` is the API key it was made with, and `mcp_client` the AI client it was made through Cubecen's MCP server, such as `claude.ai`. For a version made with a key or an AI client, `created_by` is the key's owner or the person the client acts for. Both are `null` for any other version.\n\nOnly the newest 100 versions keep their values. Older ones stay in the list with `restorable` set to `false`, and cannot be restored or compared.\n\nThe answer holds up to `limit` versions in `data`. When there are more, `next_cursor` is set: send it back as `cursor` to get the next page. On the last page `next_cursor` is `null`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most versions to return in a page, from 1 to 100. The default is 20.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where the next page starts: an opaque value. Send the `next_cursor` of the previous page as it is. Leave it out to get the first page. A value that does not belong to this list is refused with `400`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the versions, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvVersionList"
                },
                "example": {
                  "data": [
                    {
                      "version": "9b1f0c4",
                      "kind": "change",
                      "restored_from": null,
                      "deployment_id": null,
                      "changes": {
                        "added": [
                          "STRIPE_KEY"
                        ],
                        "changed": [
                          "LOG_LEVEL"
                        ],
                        "removed": [
                          "OLD_FLAG"
                        ]
                      },
                      "created_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "api_key": {
                        "id": "7e3b9d14-6a52-4f08-b1c7-2d9a5e8f0b36",
                        "name": "CI"
                      },
                      "mcp_client": null,
                      "created_at": "2026-10-25T11:05:42Z",
                      "restorable": true
                    },
                    {
                      "version": "7f20b1d",
                      "kind": "change",
                      "restored_from": null,
                      "deployment_id": null,
                      "changes": {
                        "added": [],
                        "changed": [
                          "VITE_API_URL"
                        ],
                        "removed": []
                      },
                      "created_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "api_key": null,
                      "mcp_client": "claude.ai",
                      "created_at": "2026-10-24T14:30:05Z",
                      "restorable": true
                    },
                    {
                      "version": "e3a91c2",
                      "kind": "restore",
                      "restored_from": "b7d2e49",
                      "deployment_id": "dpl_00000005a0fdd794980f85f9c353bf",
                      "changes": {
                        "added": [
                          "OLD_FLAG"
                        ],
                        "changed": [],
                        "removed": []
                      },
                      "created_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "api_key": null,
                      "mcp_client": null,
                      "created_at": "2026-10-20T10:02:11Z",
                      "restorable": true
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "limit": {
                    "summary": "limit is not a number from 1 to 100",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "limit must be between 1 and 100",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "limit"
                      }
                    }
                  },
                  "cursor": {
                    "summary": "The cursor does not belong to this list",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "cursor is invalid for this list",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "cursor"
                      }
                    }
                  },
                  "VALIDATION_ERROR": {
                    "summary": "A parameter is repeated, or the query string is not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound404"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/env/diff": {
      "get": {
        "operationId": "compareEnvironmentVersions",
        "tags": [
          "environment"
        ],
        "summary": "Compare two versions of the variables of a cube",
        "description": "Returns what going from one version of a cube's variables and secrets to another adds, changes and removes: keys and types, never values. It needs only read access.\n\n`to` is the version to compare to. It is required. `from` is the version to compare from; without it, the current version. In the answer, `from` is `null` when the environment has no version yet. Use it to see what `restoreEnvironmentVersion`, or a rollback with `env_version` in `createDeployment`, would change. For a changed key, `from_type` is the type it had before.\n\nSecrets are compared by their values on our side, so a secret that was saved again with the same value counts as unchanged. A key whose `build` mark, or a secret's `previews` mark, differs also counts as changed, with `from_type` equal to `type`. A version that no longer keeps its values, because only the newest 100 do, cannot be compared: it is refused with `409` `ENV_VERSION_UNAVAILABLE`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "The version to compare to: an `env_version` of this cube, as `getEnvironment` and `listEnvironmentVersions` show it. 7 lowercase hexadecimal characters.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{7}$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "The version to compare from: an `env_version` of this cube. Without it, the current version.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{7}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What the change from one version to the other adds, changes and removes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvDiff"
                },
                "example": {
                  "from": "7f20b1d",
                  "to": "e3a91c2",
                  "added": [
                    {
                      "key": "OLD_FLAG",
                      "type": "variable"
                    }
                  ],
                  "changed": [
                    {
                      "key": "STRIPE_KEY",
                      "type": "secret",
                      "from_type": "secret"
                    },
                    {
                      "key": "API_TOKEN",
                      "type": "secret",
                      "from_type": "variable"
                    }
                  ],
                  "removed": [
                    {
                      "key": "NEW_FLAG",
                      "type": "variable"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "to": {
                    "summary": "to is missing, or is not an env_version of this cube",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "to must be an env_version of this cube",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "to"
                      }
                    }
                  },
                  "from": {
                    "summary": "from is not an env_version of this cube",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "from must be an env_version of this cube",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "from"
                      }
                    }
                  },
                  "VALIDATION_ERROR": {
                    "summary": "A parameter is repeated, or the query string is not valid",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound404"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "ENV_VERSION_UNAVAILABLE": {
                    "summary": "The values of that environment version are no longer kept, or can no longer be read, so it cannot be restored or compared.",
                    "value": {
                      "error": {
                        "code": "ENV_VERSION_UNAVAILABLE",
                        "message": "The values of this env version are no longer kept, so it cannot be compared",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "to"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/env/restore": {
      "post": {
        "operationId": "restoreEnvironmentVersion",
        "tags": [
          "environment"
        ],
        "summary": "Bring back an earlier version of the variables",
        "description": "Makes an older version of a cube's variables and secrets the current one again. Its values become a new version, of `kind` `restore`, on top of `expected_version`. It needs a key with full access.\n\nSend `version`, the version to bring back, and `expected_version`, the current version as `getEnvironment` shows it, or `null` before the first version. Both are required. If the environment has changed since, the request is refused with `409` `ENV_CHANGED`. Restoring values that the environment already holds changes nothing, and the answer is the current state.\n\nOld secret values come back too: a secret that you changed since returns to its old value. Compare first with `compareEnvironmentVersions`. A key that is marked `build` now, or in the restored version, stays marked. A version whose values are no longer kept, or one of whose secrets can no longer be read, is refused with `409` `ENV_VERSION_UNAVAILABLE`.\n\nThe answer is the environment at the new version. The restored values reach the running cube with the next build or deployment, like any change. To roll back a release together with its variables in one step, use `createDeployment` with the release's `env_version`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "Optional, and recommended. A value that is unique to this restore, such as a UUID: 1 to 255 visible ASCII characters. Send the same value when you retry the same request, and the retry returns the answer of the first request, with `Idempotent-Replayed: true`, instead of restoring again. The same value with another `version` or `expected_version` is refused with `IDEMPOTENCY_KEY_REUSED`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnvRestore"
              },
              "example": {
                "version": "e3a91c2",
                "expected_version": "9b1f0c4"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The variables and secrets at the version that now holds the restored values.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "`true` when this is the answer to a retry of a request that had already finished. Absent otherwise.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Env"
                },
                "example": {
                  "env_version": "4d8a6e1",
                  "live_env_version": "e3a91c2",
                  "live_build_env_version": "e3a91c2",
                  "live_env_behind": true,
                  "live_build_env_behind": false,
                  "build_keys_behind": [],
                  "databases_behind": [],
                  "entries": [
                    {
                      "key": "LOG_LEVEL",
                      "type": "variable",
                      "value": "info",
                      "previews": true,
                      "build": false,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-25T12:40:18Z"
                    },
                    {
                      "key": "VITE_API_URL",
                      "type": "variable",
                      "value": "https://api.example.com",
                      "previews": true,
                      "build": true,
                      "updated_by": {
                        "id": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                        "name": "Ada Lovelace"
                      },
                      "updated_at": "2026-10-24T14:30:05Z"
                    }
                  ],
                  "platform": [
                    {
                      "key": "CUBECEN_CUBE_NAME",
                      "value": "Web",
                      "next_deploy": true
                    },
                    {
                      "key": "CUBECEN_DEPLOYMENT_ID",
                      "value": "dpl_00000002a0fdd794980f85f9c353bf",
                      "next_deploy": false
                    },
                    {
                      "key": "CUBECEN_PROJECT",
                      "value": "Storefront",
                      "next_deploy": true
                    },
                    {
                      "key": "CUBECEN_REGION",
                      "value": null,
                      "next_deploy": false
                    },
                    {
                      "key": "CUBECEN_WORKSPACE",
                      "value": "Acme",
                      "next_deploy": true
                    }
                  ],
                  "limits": {
                    "max_entries": 200,
                    "max_key_length": 128,
                    "max_value_bytes": 65536,
                    "max_total_bytes": 262144
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "idempotency_key": {
                    "summary": "The Idempotency-Key is not 1 to 255 visible ASCII characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "An Idempotency-Key header of 1 to 255 visible ASCII characters is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "Idempotency-Key"
                      }
                    }
                  },
                  "expected_version": {
                    "summary": "expected_version is missing, or is not an env_version of this cube",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "expected_version is required: the env_version the change is based on",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "expected_version"
                      }
                    }
                  },
                  "version": {
                    "summary": "version is not an env_version of this cube, or there is no such version",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "There is no such env version",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "version"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound404"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "ENV_CHANGED": {
                    "summary": "The variables changed since you read them: `expected_version` is not the current version. Read them again, check your change and send it again.",
                    "value": {
                      "error": {
                        "code": "ENV_CHANGED",
                        "message": "The env changed since it was loaded; review it and save again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "ENV_VERSION_UNAVAILABLE": {
                    "summary": "The values of that environment version are no longer kept, or can no longer be read, so it cannot be restored or compared.",
                    "value": {
                      "error": {
                        "code": "ENV_VERSION_UNAVAILABLE",
                        "message": "The values of this env version are no longer kept, so it cannot be restored",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "version"
                      }
                    }
                  },
                  "IDEMPOTENCY_KEY_REUSED": {
                    "summary": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action.",
                    "value": {
                      "error": {
                        "code": "IDEMPOTENCY_KEY_REUSED",
                        "message": "The Idempotency-Key was already used for a different request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/domains": {
      "get": {
        "operationId": "listDomains",
        "tags": [
          "domains"
        ],
        "summary": "List the custom domains of a cube",
        "description": "Returns the custom domains of a cube, oldest first. It needs only read access. The list is not paged.\n\nA custom domain is a hostname that you own, such as `app.example.com`, which serves the cube besides its generated address. Each domain comes with the DNS records that you create at your DNS provider and whether Cubecen has seen them work (`dns_records`, each with `ok`), its `status`, and an `error` when something needs your attention.\n\nA domain that is `pending_verification` or `provisioning` moves on its own. After you add, check or remove a domain, read the list every 10 seconds for a minute, then every 30 seconds, and stop when every domain is `active` or `failed`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The custom domains of the cube, oldest first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DomainList"
                },
                "example": {
                  "data": [
                    {
                      "id": "6f2d9c41-8a37-4e05-b1d6-3c7a90e5f284",
                      "hostname": "www.example.com",
                      "apex": false,
                      "status": "active",
                      "dns_records": [
                        {
                          "purpose": "ownership",
                          "type": "TXT",
                          "name": "_cubecen-challenge.www.example.com",
                          "value": "cubecen-verify=3f1c9a7e5b2d4c6f8a0b1c2d3e4f5a6b",
                          "ok": true
                        },
                        {
                          "purpose": "routing",
                          "type": "CNAME",
                          "name": "www.example.com",
                          "value": "customers.cubecen.com",
                          "ok": true
                        }
                      ],
                      "certificate": {
                        "status": "active"
                      },
                      "reconnect": null,
                      "created_at": "2026-10-16T12:00:00Z",
                      "checked_at": "2026-10-25T09:10:00Z",
                      "verified_at": "2026-10-16T12:01:00Z",
                      "activated_at": "2026-10-16T12:07:30Z"
                    },
                    {
                      "id": "b3a8e517-2c94-4f60-9d1e-7a5c0f2e8b46",
                      "hostname": "app.example.com",
                      "apex": false,
                      "status": "provisioning",
                      "dns_records": [
                        {
                          "purpose": "ownership",
                          "type": "TXT",
                          "name": "_cubecen-challenge.app.example.com",
                          "value": "cubecen-verify=8d2e4a6c0b1f3e5a7c9d1b3f5e7a9c2d",
                          "ok": true
                        },
                        {
                          "purpose": "routing",
                          "type": "CNAME",
                          "name": "app.example.com",
                          "value": "customers.cubecen.com",
                          "ok": false
                        }
                      ],
                      "certificate": {
                        "status": "pending"
                      },
                      "error": {
                        "code": "DNS_NOT_POINTED",
                        "message": "custom hostname does not CNAME to this zone."
                      },
                      "reconnect": null,
                      "created_at": "2026-10-25T08:55:12Z",
                      "checked_at": "2026-10-25T09:05:12Z",
                      "verified_at": "2026-10-25T09:01:03Z",
                      "activated_at": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "post": {
        "operationId": "addDomain",
        "tags": [
          "domains"
        ],
        "summary": "Add a custom domain to a cube",
        "description": "Adds a hostname that you own to a cube. It needs a key with full access, and an `Idempotency-Key` header.\n\nSend `{\"hostname\": \"app.example.com\"}`. A pasted URL gives its host. The hostname is stored in lowercase, without a trailing dot, and an international name in punycode (`xn--...`). A wildcard, an IP address, a name with a port or a path, a public suffix such as `co.uk`, a name longer than 253 characters and a domain of Cubecen itself are refused with `400`. The cube can be active or still being created. A cube that has failed is refused with `409` `APPLICATION_NOT_READY`.\n\nThe answer is `201` with the domain in `pending_verification`, and the records to create at your DNS provider. The `Location` header gives the domain's path.\n\n- The `ownership` record is a TXT record that proves that you control the hostname. You can delete it once the domain is `active`.\n- The `routing` record points the hostname at Cubecen. Copy its `value` as it is: it can differ between domains. An apex domain (`apex` is `true`, such as `example.com`) cannot have a plain CNAME. Its record then carries a `note` that asks for your DNS provider's CNAME flattening or ALIAS record, or it is a set of `A` and `AAAA` records.\n\nCubecen checks the ownership record, then the routing record, and issues the certificate. Follow `status` with `getDomain` until it is `active` or `failed`. After you fix a record, `checkDomain` asks for a check at once.\n\nAdding a hostname claims nothing. Until a domain is verified, other cubes can add the same hostname, and the first one whose ownership record appears gets it. A cube can have at most 10 custom domains.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A value that is unique to this domain, such as a UUID: 1 to 255 visible ASCII characters. It is required. Send the same value when you retry the same request, and the retry returns the domain that the first request added, with `Idempotent-Replayed: true`, instead of adding it again. The same value with another hostname is refused with `IDEMPOTENCY_KEY_REUSED`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DomainCreate"
              },
              "example": {
                "hostname": "app.example.com"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The domain was added. It waits for its ownership record.",
            "headers": {
              "Location": {
                "description": "The path of the new domain.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "`true` when this is the answer to a retry of a request that had already finished. Absent otherwise.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                },
                "example": {
                  "id": "b3a8e517-2c94-4f60-9d1e-7a5c0f2e8b46",
                  "hostname": "app.example.com",
                  "apex": false,
                  "status": "pending_verification",
                  "dns_records": [
                    {
                      "purpose": "ownership",
                      "type": "TXT",
                      "name": "_cubecen-challenge.app.example.com",
                      "value": "cubecen-verify=8d2e4a6c0b1f3e5a7c9d1b3f5e7a9c2d",
                      "ok": false
                    },
                    {
                      "purpose": "routing",
                      "type": "CNAME",
                      "name": "app.example.com",
                      "value": "customers.cubecen.com",
                      "ok": null
                    }
                  ],
                  "certificate": null,
                  "reconnect": null,
                  "created_at": "2026-10-25T08:55:12Z",
                  "checked_at": null,
                  "verified_at": null,
                  "activated_at": null
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "idempotency_key": {
                    "summary": "The Idempotency-Key is missing, or is not 1 to 255 visible ASCII characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "An Idempotency-Key header of 1 to 255 visible ASCII characters is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "Idempotency-Key"
                      }
                    }
                  },
                  "hostname": {
                    "summary": "The hostname is empty or is not a valid domain name that can be added",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Enter a hostname such as app.example.com",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "hostname"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "other_cube": {
                    "summary": "Another cube already serves the hostname",
                    "value": {
                      "error": {
                        "code": "DOMAIN_TAKEN",
                        "message": "Another cube already serves this hostname",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "hostname"
                      }
                    }
                  },
                  "this_cube": {
                    "summary": "The cube already has the hostname",
                    "value": {
                      "error": {
                        "code": "DOMAIN_TAKEN",
                        "message": "This cube already has this hostname",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "hostname"
                      }
                    }
                  },
                  "DOMAIN_LIMIT_REACHED": {
                    "summary": "The cube has as many custom domains as it can have, 10. Remove one first.",
                    "value": {
                      "error": {
                        "code": "DOMAIN_LIMIT_REACHED",
                        "message": "A cube can have at most 10 custom domains",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "APPLICATION_NOT_READY": {
                    "summary": "The cube is still being created, or its creation failed.",
                    "value": {
                      "error": {
                        "code": "APPLICATION_NOT_READY",
                        "message": "The cube is not ready for custom domains",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "IDEMPOTENCY_KEY_REUSED": {
                    "summary": "The `Idempotency-Key` was already used for a different request. Use a new key for a new action.",
                    "value": {
                      "error": {
                        "code": "IDEMPOTENCY_KEY_REUSED",
                        "message": "The Idempotency-Key was already used for a different request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/domains/{domainId}": {
      "get": {
        "operationId": "getDomain",
        "tags": [
          "domains"
        ],
        "summary": "Get a custom domain",
        "description": "Returns one custom domain of a cube, with the DNS records to create, whether Cubecen has seen them work, and its state. It needs only read access.\n\nUse it to follow a domain that you added, checked or reconnected, until `status` is `active` or `failed`. `status` moves on its own, and `checked_at` is the time of the last check. `error` is absent while there is nothing to explain, and its `message` is safe to show. When `status` is `failed`, the domain is no longer checked: `checkDomain` starts it over.\n\nOnce a domain is removed, this request is `404`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The ID of the domain: the `id` that `addDomain` gave, or that `listDomains` shows. A domain of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The custom domain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                },
                "example": {
                  "id": "b3a8e517-2c94-4f60-9d1e-7a5c0f2e8b46",
                  "hostname": "app.example.com",
                  "apex": false,
                  "status": "provisioning",
                  "dns_records": [
                    {
                      "purpose": "ownership",
                      "type": "TXT",
                      "name": "_cubecen-challenge.app.example.com",
                      "value": "cubecen-verify=8d2e4a6c0b1f3e5a7c9d1b3f5e7a9c2d",
                      "ok": true
                    },
                    {
                      "purpose": "routing",
                      "type": "CNAME",
                      "name": "app.example.com",
                      "value": "customers.cubecen.com",
                      "ok": false
                    }
                  ],
                  "certificate": {
                    "status": "pending"
                  },
                  "error": {
                    "code": "DNS_NOT_POINTED",
                    "message": "custom hostname does not CNAME to this zone."
                  },
                  "reconnect": null,
                  "created_at": "2026-10-25T08:55:12Z",
                  "checked_at": "2026-10-25T09:05:12Z",
                  "verified_at": "2026-10-25T09:01:03Z",
                  "activated_at": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4043"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "delete": {
        "operationId": "removeDomain",
        "tags": [
          "domains"
        ],
        "summary": "Remove a custom domain from a cube",
        "description": "Starts removing a custom domain from a cube. It needs a key with full access.\n\nThe answer is `202` with the domain, which is now `removing`. Usually within a minute, Cubecen stops serving the hostname and stops routing it to the cube. Then `getDomain` answers `404` and the hostname is free. Repeating the request while the domain is still being removed answers `202` again. After the removal you can delete the DNS records. Deleting a cube removes its domains too.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The ID of the domain: the `id` that `addDomain` gave, or that `listDomains` shows. A domain of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Removing the same domain again answers `202` while it is still being removed, and `404` once it is gone.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The domain is being removed. `getDomain` answers `404` once it is gone.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                },
                "example": {
                  "id": "b3a8e517-2c94-4f60-9d1e-7a5c0f2e8b46",
                  "hostname": "app.example.com",
                  "apex": false,
                  "status": "removing",
                  "dns_records": [
                    {
                      "purpose": "ownership",
                      "type": "TXT",
                      "name": "_cubecen-challenge.app.example.com",
                      "value": "cubecen-verify=8d2e4a6c0b1f3e5a7c9d1b3f5e7a9c2d",
                      "ok": true
                    },
                    {
                      "purpose": "routing",
                      "type": "CNAME",
                      "name": "app.example.com",
                      "value": "customers.cubecen.com",
                      "ok": true
                    }
                  ],
                  "certificate": {
                    "status": "active"
                  },
                  "reconnect": null,
                  "created_at": "2026-10-16T12:00:00Z",
                  "checked_at": "2026-10-25T09:10:00Z",
                  "verified_at": "2026-10-16T12:01:00Z",
                  "activated_at": "2026-10-16T12:07:30Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "No such domain in this cube, or it is already gone",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Resource not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/domains/{domainId}/check": {
      "post": {
        "operationId": "checkDomain",
        "tags": [
          "domains"
        ],
        "summary": "Check a custom domain now",
        "description": "Asks for a custom domain to be checked now. Use it after you created or fixed a DNS record, instead of waiting for the next check. It needs a key with full access.\n\nThe answer is `202` with the domain as it is: Cubecen looks at it within seconds. Read it with `getDomain` for the outcome. A `failed` domain starts over, as `pending_verification` or, once its ownership is verified, as `provisioning`. A domain that was checked in the last 10 seconds, or that is being removed, is answered as it is.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The ID of the domain: the `id` that `addDomain` gave, or that `listDomains` shows. A domain of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Checking again is safe: a domain that was checked in the last 10 seconds, or that is being removed, is answered as it is.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The domain as it is. It is checked within seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                },
                "example": {
                  "id": "b3a8e517-2c94-4f60-9d1e-7a5c0f2e8b46",
                  "hostname": "app.example.com",
                  "apex": false,
                  "status": "provisioning",
                  "dns_records": [
                    {
                      "purpose": "ownership",
                      "type": "TXT",
                      "name": "_cubecen-challenge.app.example.com",
                      "value": "cubecen-verify=8d2e4a6c0b1f3e5a7c9d1b3f5e7a9c2d",
                      "ok": true
                    },
                    {
                      "purpose": "routing",
                      "type": "CNAME",
                      "name": "app.example.com",
                      "value": "customers.cubecen.com",
                      "ok": false
                    }
                  ],
                  "certificate": {
                    "status": "pending"
                  },
                  "error": {
                    "code": "DNS_NOT_POINTED",
                    "message": "custom hostname does not CNAME to this zone."
                  },
                  "reconnect": null,
                  "created_at": "2026-10-25T08:55:12Z",
                  "checked_at": "2026-10-25T09:05:12Z",
                  "verified_at": "2026-10-25T09:01:03Z",
                  "activated_at": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4043"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/domains/{domainId}/reconnect": {
      "post": {
        "operationId": "reconnectDomain",
        "tags": [
          "domains"
        ],
        "summary": "Move a custom domain to the current connection",
        "description": "Moves a domain that uses an older connection to the current one. Such a domain has `reconnect` set, with `by`, the date after which the older connection stops serving it, which is `null` until a date is set. It needs a key with full access. There is no body.\n\nThe answer is `202` with the domain. An `active` domain stays `active` and keeps serving over the older connection meanwhile. Its `routing` record now shows the new target: point your DNS record at it, then call `checkDomain`. While the certificate is issued, `error` can say `DNS_NOT_POINTED` or `CERTIFICATE_PENDING`. Once the new connection works, the older one is removed and `reconnect` becomes `null`. A domain that is not active moves at once and starts over on the new connection. Its ownership stays proven: no new TXT record is needed.\n\nAsking again while the move is going on changes nothing. A domain that already uses the current connection, or that is being removed, is refused with `409` `CONFLICT`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "description": "The ID of the domain: the `id` that `addDomain` gave, or that `listDomains` shows. A domain of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Asking again changes nothing while the move is going on. Once the domain uses the current connection, asking again is refused with `409`.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The domain, now moving to the current connection.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Domain"
                },
                "example": {
                  "id": "6f2d9c41-8a37-4e05-b1d6-3c7a90e5f284",
                  "hostname": "www.example.com",
                  "apex": false,
                  "status": "active",
                  "dns_records": [
                    {
                      "purpose": "ownership",
                      "type": "TXT",
                      "name": "_cubecen-challenge.www.example.com",
                      "value": "cubecen-verify=3f1c9a7e5b2d4c6f8a0b1c2d3e4f5a6b",
                      "ok": true
                    },
                    {
                      "purpose": "routing",
                      "type": "CNAME",
                      "name": "www.example.com",
                      "value": "customers.cubecen.com",
                      "ok": null
                    }
                  ],
                  "certificate": {
                    "status": "active"
                  },
                  "reconnect": {
                    "by": "2026-11-20T00:00:00Z",
                    "started_at": "2026-10-25T13:02:44Z"
                  },
                  "created_at": "2026-10-16T12:00:00Z",
                  "checked_at": "2026-10-25T09:10:00Z",
                  "verified_at": "2026-10-16T12:01:00Z",
                  "activated_at": "2026-10-16T12:07:30Z"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError400"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4043"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "current_connection": {
                    "summary": "The domain already uses the current connection",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "The domain already uses the current connection",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "being_removed": {
                    "summary": "The domain is being removed",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "The domain is being removed",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/previews": {
      "get": {
        "operationId": "listPreviews",
        "tags": [
          "previews"
        ],
        "summary": "List the previews of a cube",
        "description": "Returns the pull request previews of a cube: the open ones first, then those closed in the last seven days, the most recently updated first, at most 50. It needs only read access. The list is not paged. Pull requests into the branch the cube deploys from get previews when their branch is in the same repository; a pull request from a fork gets none.\n\nA preview is a copy of the cube, built from the head commit of a pull request into the cube's tracked branch and served at its own address. `limits.max_open` is how many previews a cube can have open at once, and `limits.idle_days` is how many days without a push make Cubecen remove a preview. For each preview, `status` says where it is, `release` is its newest build and the deployment that follows it (their IDs open its logs), and `error` explains a wait or a failure.\n\nThe list is empty when the cube has no previews. Turn previews on with `updatePreviewSettings`. While a preview is `pending`, `waiting`, `building` or `deploying`, read the list every 10 seconds.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The previews of the cube, and the limits that apply to them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewList"
                },
                "example": {
                  "data": [
                    {
                      "id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
                      "pull_request": {
                        "number": 42,
                        "title": "New checkout page",
                        "author": "octocat",
                        "url": "https://github.com/acme/storefront/pull/42",
                        "head_ref": "feature/checkout",
                        "base_ref": "main",
                        "head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                        "head_received_at": "2026-10-25T09:40:18Z",
                        "draft": false
                      },
                      "status": "ready",
                      "url": "https://web-acme-pr42-8c1d0e.cubecen.app",
                      "release": {
                        "build_id": "bld_00000006a0fdd794980f85f9c353bf",
                        "deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
                        "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                        "release_status": "DEPLOYED",
                        "env_version": "e3a91c2",
                        "started_at": "2026-10-25T09:40:44Z"
                      },
                      "created_at": "2026-10-25T09:38:02Z",
                      "updated_at": "2026-10-25T09:43:10Z",
                      "ready_at": "2026-10-25T09:43:10Z",
                      "closed_at": null,
                      "expires_at": "2026-11-01T09:40:18Z",
                      "size": "small"
                    },
                    {
                      "id": "c92f1b68-0d47-4e35-8a6c-5f3b7e1d9a20",
                      "pull_request": {
                        "number": 40,
                        "title": "Fix the footer links",
                        "author": "hubot",
                        "url": "https://github.com/acme/storefront/pull/40",
                        "head_ref": "fix/footer",
                        "base_ref": "main",
                        "head_sha": "b73a5f7f0d6cadd7602fbb6440a9434b4e1c8a90",
                        "head_received_at": "2026-10-23T15:12:44Z",
                        "draft": false
                      },
                      "status": "closed",
                      "url": null,
                      "release": {
                        "build_id": "bld_00000003a0fdd794980f85f9c353bf",
                        "deployment_id": "dpl_00000004a0fdd794980f85f9c353bf",
                        "commit_sha": "b73a5f7f0d6cadd7602fbb6440a9434b4e1c8a90",
                        "release_status": "DEPLOYED",
                        "env_version": "e3a91c2",
                        "started_at": "2026-10-23T15:13:10Z"
                      },
                      "close_reason": "merged",
                      "created_at": "2026-10-23T15:10:51Z",
                      "updated_at": "2026-10-24T08:02:37Z",
                      "ready_at": "2026-10-23T15:16:20Z",
                      "closed_at": "2026-10-24T08:02:37Z",
                      "expires_at": null,
                      "size": "small"
                    }
                  ],
                  "limits": {
                    "max_open": 3,
                    "idle_days": 7
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/previews/settings": {
      "get": {
        "operationId": "getPreviewSettings",
        "tags": [
          "previews"
        ],
        "summary": "Get the preview settings of a cube",
        "description": "Returns whether pull request previews are on for a cube, and whether they can be turned on. It needs only read access.\n\n`enabled` is the switch. `available` says whether it can be turned on now. When it cannot, `reason` says why: `PUBLIC_REPOSITORY` (the cube was made from a link, so Cubecen does not see its pull requests), `APPLICATION_NOT_READY` (the cube is not active), `PLAN` (the organization's plan has no previews), `REPOSITORY_NOT_ACCESSIBLE` (the cube's GitHub connection is gone) or `GITHUB_PERMISSIONS_MISSING` (an owner of the GitHub account has not approved the permissions that previews need: `approve_url` is the page where they do). `branch` is the tracked branch: the pull requests into it get previews.\n\nWhat the GitHub account has granted is read from GitHub at most once an hour, and again when its owner approves new permissions. Change the switch with `updatePreviewSettings`.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The preview settings of the cube.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewSettings"
                },
                "examples": {
                  "available": {
                    "summary": "Previews are on",
                    "value": {
                      "enabled": true,
                      "available": true,
                      "reason": null,
                      "approve_url": null,
                      "branch": "main",
                      "limits": {
                        "max_open": 3,
                        "idle_days": 7
                      }
                    }
                  },
                  "approval": {
                    "summary": "An owner has to approve permissions on GitHub",
                    "value": {
                      "enabled": false,
                      "available": false,
                      "reason": "GITHUB_PERMISSIONS_MISSING",
                      "approve_url": "https://github.com/organizations/acme/settings/installations/12345678",
                      "branch": "main",
                      "limits": {
                        "max_open": 3,
                        "idle_days": 7
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "422": {
            "$ref": "#/components/responses/GithubInstallationRemovedAnd2More"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAndDatabaseUnavailable"
          }
        }
      },
      "put": {
        "operationId": "updatePreviewSettings",
        "tags": [
          "previews"
        ],
        "summary": "Turn previews on or off for a cube",
        "description": "Turns pull request previews on or off for a cube. It needs a key with full access.\n\nSend `{\"enabled\": true}` or `{\"enabled\": false}`. `enabled` is required. The answer is the settings, as `getPreviewSettings` shows them.\n\nTurning previews on first asks GitHub again what the account has granted. It is refused when previews cannot be turned on: with `402` `PLAN_LIMIT_REACHED` while the organization's plan has no previews (`error.limit` is `previews`), with `409` `APPLICATION_NOT_READY` while the cube is not active, and with `422` `GITHUB_PERMISSIONS_MISSING`, `REPOSITORY_NOT_ACCESSIBLE`, `GITHUB_INSTALLATION_REMOVED` or `GITHUB_INSTALLATION_SUSPENDED` when GitHub does not allow it. The pull requests that are already open get their previews within about 10 minutes. New pull requests and pushes get theirs within seconds.\n\nTurning previews off is always allowed. It closes every preview of the cube: their cubes are deleted and GitHub is told. Turning previews on again brings back the previews of the pull requests that are still open.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Sending the same request again sets the same switch again, so a retry is safe.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewSettingsUpdate"
              },
              "examples": {
                "on": {
                  "summary": "Turn previews on",
                  "value": {
                    "enabled": true
                  }
                },
                "off": {
                  "summary": "Turn previews off",
                  "value": {
                    "enabled": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The preview settings after the change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewSettings"
                },
                "example": {
                  "enabled": true,
                  "available": true,
                  "reason": null,
                  "approve_url": null,
                  "branch": "main",
                  "limits": {
                    "max_open": 3,
                    "idle_days": 7
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "body": {
                    "summary": "The body is not JSON, or has a field that is not supported",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Request body must be valid JSON with only supported fields",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "enabled": {
                    "summary": "enabled is missing",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "enabled is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "enabled"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "402": {
            "description": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "PLAN_LIMIT_REACHED": {
                    "summary": "The organization's plan does not allow this. `error.limit`, `error.max`, `error.used` and `error.plan` say which limit.",
                    "value": {
                      "error": {
                        "code": "PLAN_LIMIT_REACHED",
                        "message": "The Free plan does not include pull request previews; change plans to turn them on",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "limit": "previews",
                        "max": 0,
                        "used": 0,
                        "plan": "free"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "APPLICATION_NOT_READY": {
                    "summary": "The cube is still being created, or its creation failed.",
                    "value": {
                      "error": {
                        "code": "APPLICATION_NOT_READY",
                        "message": "The cube is not ready for previews",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "413": {
            "$ref": "#/components/responses/ValidationError413"
          },
          "415": {
            "$ref": "#/components/responses/ValidationError415"
          },
          "422": {
            "description": "The request is well formed but cannot be carried out. `error.code` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "GITHUB_PERMISSIONS_MISSING": {
                    "summary": "The GitHub account has not approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_PERMISSIONS_MISSING",
                        "message": "Approve the Cubecen GitHub App's new permissions (pull requests, commit statuses and deployments) for this account on GitHub, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "public_repository": {
                    "summary": "The cube was made from a link, so previews cannot be turned on",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "Previews need a repository connected through the Cubecen GitHub App; Cubecen does not see the pull requests of a repository added by its link",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "connection": {
                    "summary": "The cube's GitHub connection is gone",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "The repository is no longer accessible through the organization's GitHub connection",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_REMOVED": {
                    "summary": "The Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_REMOVED",
                        "message": "The Cubecen GitHub App is no longer installed on acme. Connect GitHub again, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_SUSPENDED": {
                    "summary": "The Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_SUSPENDED",
                        "message": "The Cubecen GitHub App is suspended on acme. Unsuspend it in acme's GitHub settings (Settings -> Applications), then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAnd2More"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/previews/{previewId}": {
      "get": {
        "operationId": "getPreview",
        "tags": [
          "previews"
        ],
        "summary": "Get a preview",
        "description": "Returns one pull request preview of a cube, with its newest release. It needs only read access.\n\n`status` says where the preview is: `pending` (just seen, being set up), `waiting` (for a place or a build slot: `error.code` says which), `building`, `deploying`, `ready` (served at `url`), `failed` (`error` says why) or `closed` (`close_reason` says why). `url` is set once the preview has served, until it closes. A push builds the new head while the previous version keeps serving at the same address, and a failed build leaves it serving too.\n\n`release` is the newest build of the preview and its automatic deployment. Its `build_id` and `deployment_id` are what `getPreviewBuildLogs` and `getPreviewDeploymentLogs` take. `pull_request.head_sha` is the newest commit that Cubecen knows of: it is ahead of `release.commit_sha` while a new commit waits to be built.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "previewId",
            "in": "path",
            "required": true,
            "description": "The ID of the preview: the `id` that `listPreviews` shows. A preview of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preview"
                },
                "example": {
                  "id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
                  "pull_request": {
                    "number": 42,
                    "title": "New checkout page",
                    "author": "octocat",
                    "url": "https://github.com/acme/storefront/pull/42",
                    "head_ref": "feature/checkout",
                    "base_ref": "main",
                    "head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                    "head_received_at": "2026-10-25T09:40:18Z",
                    "draft": false
                  },
                  "status": "ready",
                  "url": "https://web-acme-pr42-8c1d0e.cubecen.app",
                  "release": {
                    "build_id": "bld_00000006a0fdd794980f85f9c353bf",
                    "deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
                    "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                    "release_status": "DEPLOYED",
                    "env_version": "e3a91c2",
                    "started_at": "2026-10-25T09:40:44Z"
                  },
                  "created_at": "2026-10-25T09:38:02Z",
                  "updated_at": "2026-10-25T09:43:10Z",
                  "ready_at": "2026-10-25T09:43:10Z",
                  "closed_at": null,
                  "expires_at": "2026-11-01T09:40:18Z",
                  "size": "small"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError4002"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4044"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      },
      "delete": {
        "operationId": "removePreview",
        "tags": [
          "previews"
        ],
        "summary": "Remove a preview",
        "description": "Closes a preview until the next push to its pull request. It needs a key with full access.\n\nThe answer is `202` with the preview, which now has `close_reason` set to `removed`. Within seconds the preview is closed, its cube is deleted and GitHub is told. It comes back with the next push to the pull request. A preview that is already closed is answered as it is.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "previewId",
            "in": "path",
            "required": true,
            "description": "The ID of the preview: the `id` that `listPreviews` shows. A preview of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Removing the same preview again is safe: a preview that is already closed is answered as it is.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The preview, which is being closed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preview"
                },
                "example": {
                  "id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
                  "pull_request": {
                    "number": 42,
                    "title": "New checkout page",
                    "author": "octocat",
                    "url": "https://github.com/acme/storefront/pull/42",
                    "head_ref": "feature/checkout",
                    "base_ref": "main",
                    "head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                    "head_received_at": "2026-10-25T09:40:18Z",
                    "draft": false
                  },
                  "status": "ready",
                  "url": "https://web-acme-pr42-8c1d0e.cubecen.app",
                  "release": {
                    "build_id": "bld_00000006a0fdd794980f85f9c353bf",
                    "deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
                    "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                    "release_status": "DEPLOYED",
                    "env_version": "e3a91c2",
                    "started_at": "2026-10-25T09:40:44Z"
                  },
                  "close_reason": "removed",
                  "created_at": "2026-10-25T09:38:02Z",
                  "updated_at": "2026-10-25T13:15:27Z",
                  "ready_at": "2026-10-25T09:43:10Z",
                  "closed_at": null,
                  "expires_at": "2026-11-01T09:40:18Z",
                  "size": "small"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError4002"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4044"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/previews/{previewId}/redeploy": {
      "post": {
        "operationId": "redeployPreview",
        "tags": [
          "previews"
        ],
        "summary": "Build a preview again",
        "description": "Builds the head of an open preview again, with the current variables and the secrets marked for previews. It needs a key with full access.\n\nThe answer is `202` with the preview as it is, and the build starts within seconds. Follow it with `getPreview`. A preview that is closed is refused with `409` `CONFLICT`: a push to its pull request brings it back.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "previewId",
            "in": "path",
            "required": true,
            "description": "The ID of the preview: the `id` that `listPreviews` shows. A preview of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "description": "The API does not use this header here. Asking again builds the preview's head again, so repeat the request only when you want another build.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "202": {
            "description": "The preview as it is. Its head is built again within seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Preview"
                },
                "example": {
                  "id": "7e4a9d12-5b83-4c60-a1f7-2d9e0c6b8a35",
                  "pull_request": {
                    "number": 42,
                    "title": "New checkout page",
                    "author": "octocat",
                    "url": "https://github.com/acme/storefront/pull/42",
                    "head_ref": "feature/checkout",
                    "base_ref": "main",
                    "head_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                    "head_received_at": "2026-10-25T09:40:18Z",
                    "draft": false
                  },
                  "status": "ready",
                  "url": "https://web-acme-pr42-8c1d0e.cubecen.app",
                  "release": {
                    "build_id": "bld_00000006a0fdd794980f85f9c353bf",
                    "deployment_id": "dpl_00000007a0fdd794980f85f9c353bf",
                    "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                    "release_status": "DEPLOYED",
                    "env_version": "e3a91c2",
                    "started_at": "2026-10-25T09:40:44Z"
                  },
                  "created_at": "2026-10-25T09:38:02Z",
                  "updated_at": "2026-10-25T09:43:10Z",
                  "ready_at": "2026-10-25T09:43:10Z",
                  "closed_at": null,
                  "expires_at": "2026-11-01T09:40:18Z",
                  "size": "small"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationError4002"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4044"
          },
          "409": {
            "description": "The request conflicts with the current state of the resource. `error.code` says how.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "CONFLICT": {
                    "summary": "The preview is closed",
                    "value": {
                      "error": {
                        "code": "CONFLICT",
                        "message": "This preview is closed; a push to its pull request brings it back",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailableAndMaintenance"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/previews/{previewId}/logs": {
      "get": {
        "operationId": "getPreviewLogs",
        "tags": [
          "previews"
        ],
        "summary": "Stream the logs of a preview",
        "description": "Streams what a preview prints, from all of its replicas, together with its pod events, as Server-Sent Events (`text/event-stream`). It works like `getApplicationLogs`, for a preview. It needs only read access.\n\nThe stream starts with a window of the output: the last `tail` lines (1 to 1000), or the lines since `since`, or the last 100 lines when you send neither. `tail` and `since` together are refused with `400`. Without `follow`, the stream ends with an `end` event after the window. With `follow=true` it stays open and sends new lines a few seconds after they are printed.\n\nTo continue after a broken connection, send the `id` of the last event you received as `cursor`. It wins over `tail` and `since`.\n\nA preview that has no cube of its own yet, because it is closed or not set up yet, has no logs and is answered with `404`. The events are described under the response.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "previewId",
            "in": "path",
            "required": true,
            "description": "The ID of the preview: the `id` that `listPreviews` shows. A preview of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "follow",
            "in": "query",
            "required": false,
            "description": "`true` keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with `false`, the stream sends the lines that exist and ends.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where to continue a stream: the `id` of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with `400`; the message differs between the two, so match on the code. Leave it out to start at the beginning.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "tail",
            "in": "query",
            "required": false,
            "description": "Start with the last N lines, from 1 to 1000. Without `tail`, `since` or a `cursor`, the last 100 lines. Not together with `since`.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Start at this time, as an RFC 3339 time, instead of with the last lines. Not together with `tail`.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The same as `cursor`: the `id` of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The log lines, as a stream of Server-Sent Events.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStream"
                },
                "example": "retry: 3000\n: connected\n\nid: NjMwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:44:01.204118Z\",\"source\":\"runtime\",\"pod\":\"app-9a2f1c3e-6d5b8f7c49-x7k2p\",\"line\":\"Listening on port 8080\"}\n\n: ping\n"
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "follow": {
                    "summary": "follow is not true or false",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "follow must be true or false",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "follow"
                      }
                    }
                  },
                  "cursor": {
                    "summary": "The cursor is not a log position, or the position has expired",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "The log position is invalid; reload the logs",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "cursor"
                      }
                    }
                  },
                  "tail": {
                    "summary": "tail is not a whole number from 1 to 1000",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "tail must be between 1 and 1000",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "tail"
                      }
                    }
                  },
                  "since": {
                    "summary": "since is not an RFC 3339 time",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "since must be an RFC 3339 time",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "since"
                      }
                    }
                  },
                  "tail_and_since": {
                    "summary": "tail and since are both sent",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Use tail or since, not both",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "since"
                      }
                    }
                  },
                  "id": {
                    "summary": "The preview ID is not a valid ID",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "No such preview in this cube, or it has no cube of its own",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Resource not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited4292"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/LogsUnavailableAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/previews/{previewId}/builds/{buildId}/logs": {
      "get": {
        "operationId": "getPreviewBuildLogs",
        "tags": [
          "previews"
        ],
        "summary": "Stream the logs of a preview build",
        "description": "Streams the log lines of one build of a preview, from fetching the source to pushing the image, as Server-Sent Events (`text/event-stream`). It works like `getBuildLogs`, for a preview. It needs only read access.\n\nTake the build's ID from `release.build_id` of the preview, as `getPreview` shows it. Without `follow`, the stream sends the lines that exist and ends with an `end` event. With `follow=true` it stays open and sends new lines a few seconds after they are printed. When the build has finished and every line is sent, the stream ends with `complete: true`.\n\nTo continue after a broken connection, send the `id` of the last event you received as `cursor`. `tail` and `since` are for the output of a running preview (`getPreviewLogs`): without a `cursor`, a request that has one of them is refused with `400`.\n\nOnly builds of this preview are found. Any other build ID, the cube's own builds included, is `404`, and so is a preview that has no cube of its own yet. The events are described under the response.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "previewId",
            "in": "path",
            "required": true,
            "description": "The ID of the preview: the `id` that `listPreviews` shows. A preview of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "buildId",
            "in": "path",
            "required": true,
            "description": "The ID of the build: the `id` you got when you started it. An opaque string that starts with `bld_` (`dep_` for the oldest builds). A build of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "follow",
            "in": "query",
            "required": false,
            "description": "`true` keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with `false`, the stream sends the lines that exist and ends.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where to continue a stream: the `id` of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with `400`; the message differs between the two, so match on the code. Leave it out to start at the beginning.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The same as `cursor`: the `id` of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The log lines, as a stream of Server-Sent Events.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStream"
                },
                "example": "retry: 3000\n: connected\n\nid: NzEwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:40:48.331092Z\",\"source\":\"build\",\"step\":\"fetch\",\"line\":\"Fetching revision feature/checkout\"}\n\nid: NzEwMg\nevent: end\ndata: {\"complete\":true,\"cursor\":\"NzEwMg\"}\n"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationErrorAnd3More"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "No such preview or build in this cube, or the preview has no cube of its own",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Resource not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited4292"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/LogsUnavailableAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/projects/{projectId}/applications/{applicationId}/previews/{previewId}/deployments/{deploymentId}/logs": {
      "get": {
        "operationId": "getPreviewDeploymentLogs",
        "tags": [
          "previews"
        ],
        "summary": "Stream the logs of a preview deployment",
        "description": "Streams the log lines of one deployment of a preview as Server-Sent Events (`text/event-stream`): its own steps (`apply` and `rollout`), the output of the new pods as they start, and the pod events that happen while it rolls out. It works like `getDeploymentLogs`, for a preview. It needs only read access.\n\nTake the deployment's ID from `release.deployment_id` of the preview, as `getPreview` shows it. It is `null` until the build has succeeded. Without `follow`, the stream sends the lines that exist and ends with an `end` event. With `follow=true` it stays open and sends new lines a few seconds after they are printed. When the deployment has finished and every line is sent, the stream ends with `complete: true`.\n\nTo continue after a broken connection, send the `id` of the last event you received as `cursor`. `tail` and `since` are for the output of a running preview (`getPreviewLogs`): without a `cursor`, a request that has one of them is refused with `400`.\n\nOnly deployments of this preview are found. Any other deployment ID, the cube's own deployments included, is `404`, and so is a preview that has no cube of its own yet. The events are described under the response.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the project. A slug is unique within the organization.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "applicationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the cube. A slug is unique within the project.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "previewId",
            "in": "path",
            "required": true,
            "description": "The ID of the preview: the `id` that `listPreviews` shows. A preview of another cube is not found.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "description": "The ID of the deployment: the `id` that `createDeployment` gave, or that `listDeployments` shows. An opaque string that starts with `dpl_`. A deployment of another cube is not found.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          },
          {
            "name": "follow",
            "in": "query",
            "required": false,
            "description": "`true` keeps the stream open: it sends new lines a few seconds after they are printed. Without it, or with `false`, the stream sends the lines that exist and ends.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where to continue a stream: the `id` of the last event you received, as it is. Send it after a broken connection, and the stream goes on after that line. A value that is not a log position, or whose position has expired, is refused with `400`; the message differs between the two, so match on the code. Leave it out to start at the beginning.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          },
          {
            "name": "Last-Event-ID",
            "in": "header",
            "required": false,
            "description": "The same as `cursor`: the `id` of the last event you received. EventSource sends it by itself when it reconnects. If both are sent, this one counts.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The log lines, as a stream of Server-Sent Events.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/LogStream"
                },
                "example": "retry: 3000\n: connected\n\nid: ODEwMQ\nevent: log\ndata: {\"time\":\"2026-10-25T09:42:20.511903Z\",\"source\":\"deploy\",\"step\":\"apply\",\"line\":\"Applying the new version\"}\n\nid: ODEwMg\nevent: end\ndata: {\"complete\":true,\"cursor\":\"ODEwMg\"}\n"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/ValidationErrorAnd3More"
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "NOT_FOUND": {
                    "summary": "No such preview or deployment in this cube, or the preview has no cube of its own",
                    "value": {
                      "error": {
                        "code": "NOT_FOUND",
                        "message": "Resource not found",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited4292"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/LogsUnavailableAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/integrations/github/installations": {
      "get": {
        "operationId": "listGitHubInstallations",
        "tags": [
          "github"
        ],
        "summary": "List GitHub installations",
        "description": "Returns the GitHub installations connected to the organization. An installation is the Cubecen GitHub App installed on a GitHub account: a person or a GitHub organization. A cube is made from a repository that one of these installations can reach.\n\nThe answer holds all of them in `data`, the oldest connection first. It is not paged. Use an item's `id` where a path asks for an installation, as `listGitHubInstallationRepositories` and `getRepositoryFolders` do.\n\nTwo things can need attention. When `approval_pending` is `true`, the GitHub account has not approved every permission that the App asks for now, and `approve_url` is the page on github.com where an owner approves them. When `access` is `lost`, the person who connected the installation can no longer use it. It allows no repository, and new cubes, builds and previews from it are refused until an owner connects it again in the Cubecen dashboard. Cubes that are running keep running.\n\nConnecting and disconnecting GitHub is done in the Cubecen dashboard, not with an API key.\n",
        "x-cubecen-access": "read",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The connected installations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubInstallationList"
                },
                "examples": {
                  "connected": {
                    "summary": "An installation that works",
                    "value": {
                      "data": [
                        {
                          "id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                          "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                          "installation_id": 12345678,
                          "account_id": 87654321,
                          "account_login": "acme",
                          "account_type": "Organization",
                          "connected_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                          "verified_at": "2026-09-14T08:25:41Z",
                          "repositories_synced_at": "2026-10-25T08:00:12Z",
                          "repository_selection": "all",
                          "repository_count": 22,
                          "created_at": "2026-09-14T08:25:41Z",
                          "updated_at": "2026-10-25T08:00:12Z",
                          "approval_pending": false,
                          "approve_url": null,
                          "access": "verified",
                          "access_lost_reason": null,
                          "access_checked_at": "2026-10-25T09:00:07Z"
                        }
                      ]
                    }
                  },
                  "needs_attention": {
                    "summary": "An installation that waits for approval, and one that was lost",
                    "value": {
                      "data": [
                        {
                          "id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                          "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                          "installation_id": 12345678,
                          "account_id": 87654321,
                          "account_login": "acme",
                          "account_type": "Organization",
                          "connected_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                          "verified_at": "2026-09-14T08:25:41Z",
                          "repositories_synced_at": "2026-10-25T08:00:12Z",
                          "repository_selection": "selected",
                          "repository_count": 3,
                          "created_at": "2026-09-14T08:25:41Z",
                          "updated_at": "2026-10-25T08:00:12Z",
                          "approval_pending": true,
                          "approve_url": "https://github.com/organizations/acme/settings/installations/12345678",
                          "access": "verified",
                          "access_lost_reason": null,
                          "access_checked_at": "2026-10-25T09:00:07Z"
                        },
                        {
                          "id": "a92e6b07-14d8-4c35-b1f9-0e7d3a5c8f12",
                          "organization_id": "5d0f3a8c-2b19-4e7d-a6c4-1f8e9b027d35",
                          "installation_id": 23456789,
                          "account_id": 76543210,
                          "account_login": "ada",
                          "account_type": "User",
                          "connected_by": "c41e7a02-93bd-4d58-b0f6-6a1d2e8f4c73",
                          "verified_at": "2026-10-02T11:40:09Z",
                          "repositories_synced_at": "2026-10-02T11:40:09Z",
                          "repository_selection": "all",
                          "repository_count": 4,
                          "created_at": "2026-10-02T11:40:09Z",
                          "updated_at": "2026-10-25T09:00:07Z",
                          "approval_pending": false,
                          "approve_url": null,
                          "access": "lost",
                          "access_lost_reason": "github_access",
                          "access_checked_at": "2026-10-25T09:00:07Z"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/DatabaseUnavailable503"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/integrations/github/installations/{installationId}/repositories": {
      "get": {
        "operationId": "listGitHubInstallationRepositories",
        "tags": [
          "github"
        ],
        "summary": "List the repositories of an installation",
        "description": "Returns one page of the repositories that the organization can use through one GitHub installation. Use it to find the repository to make a cube from. It needs a key with full access, because it serves the creation of cubes.\n\nName the installation by its `id`, as `listGitHubInstallations` gives it. The list holds only the repositories that the organization may use through that installation. A repository that is missing was not chosen for this organization, or the person who connected the installation cannot reach it on GitHub. An owner of the organization can choose repositories and refresh the connection in the Cubecen dashboard.\n\n`page` counts from 1. `total_count` is the number of repositories in the whole list, and `next_page` is the number of the next page, or `null` on the last page. To search the repositories of all the installations by name, use `listGitHubRepositories`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "installationId",
            "in": "path",
            "required": true,
            "description": "The `id` of a GitHub installation, as `listGitHubInstallations` returns it. It is not the `installation_id` number that GitHub uses.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "The page to return, from 1 to 1000. The default is 1.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "How many repositories a page holds, from 1 to 100. The default is 30.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the installation's repositories.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GitHubRepositoryPage"
                },
                "example": {
                  "data": [
                    {
                      "id": 123456789,
                      "owner": "acme",
                      "name": "storefront",
                      "full_name": "acme/storefront",
                      "private": true,
                      "default_branch": "main",
                      "archived": false
                    },
                    {
                      "id": 234567890,
                      "owner": "acme",
                      "name": "docs",
                      "full_name": "acme/docs",
                      "private": false,
                      "default_branch": "main",
                      "archived": false
                    }
                  ],
                  "total_count": 22,
                  "next_page": 2
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "VALIDATION_ERROR": {
                    "summary": "page or per_page is out of range, or the installation ID is not a UUID",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Invalid request",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4047"
          },
          "422": {
            "$ref": "#/components/responses/GithubInstallationRemovedAnd2More"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/integrations/github/repositories": {
      "get": {
        "operationId": "listGitHubRepositories",
        "tags": [
          "github"
        ],
        "summary": "List the repositories of all installations",
        "description": "Returns the repositories that the organization can use through all its GitHub installations, in one list sorted by full name. Use `q` to search by name. It needs a key with full access, because it serves the creation of cubes.\n\nEach item says which installation it comes through: `installation_id` is the `id` of the installation, as `listGitHubInstallations` gives it (not GitHub's own number), and `account_login` is its GitHub account.\n\nThe answer holds up to `limit` repositories in `data`. When there are more, `next_cursor` is set: send it back as `cursor`, with the same `q`, to get the next page. On the last page `next_cursor` is `null`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Keeps the repositories whose full name, `owner/name`, contains this text, ignoring case. At most 200 bytes: a character outside plain ASCII takes more than one.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "The most repositories to return in a page, from 1 to 100. The default is 30.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Where the next page starts: an opaque value. Send the `next_cursor` of the previous page as it is, with the same `q`. Leave it out to get the first page. A value that does not belong to this list is refused with `400`.",
            "schema": {
              "type": "string",
              "maxLength": 1024
            }
          }
        ],
        "responses": {
          "200": {
            "description": "One page of repositories.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationRepositoryPage"
                },
                "example": {
                  "data": [
                    {
                      "id": 123456789,
                      "owner": "acme",
                      "name": "docs",
                      "full_name": "acme/docs",
                      "private": false,
                      "default_branch": "main",
                      "archived": false,
                      "installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                      "account_login": "acme"
                    },
                    {
                      "id": 234567890,
                      "owner": "acme",
                      "name": "storefront",
                      "full_name": "acme/storefront",
                      "private": true,
                      "default_branch": "main",
                      "archived": false,
                      "installation_id": "3d7c1e90-5b24-4a68-9f03-8c2e7a1d4b56",
                      "account_login": "acme"
                    }
                  ],
                  "next_cursor": "Zk3vQx9TnWl2RbYc7uHs5dPgAe8MjXo1iNtV4yLq"
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "limit": {
                    "summary": "limit is not a number from 1 to 100",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "limit must be between 1 and 100",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "limit"
                      }
                    }
                  },
                  "q": {
                    "summary": "q is longer than 200 characters",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "q is too long",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "q"
                      }
                    }
                  },
                  "cursor": {
                    "summary": "cursor is not one that this list gave",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "cursor is invalid for this list",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "cursor"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "422": {
            "$ref": "#/components/responses/GithubInstallationRemovedAnd2More"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/integrations/github/public-repository": {
      "get": {
        "operationId": "resolvePublicRepository",
        "tags": [
          "github"
        ],
        "summary": "Look up a public repository",
        "description": "Reads a link to a public GitHub repository, and says what a cube made from it would build. No GitHub installation is needed: any public repository can be read. It needs a key with full access, because it serves the creation of cubes.\n\nThe link is `https://github.com/owner/repo`, or `https://github.com/owner/repo/tree/branch/folder` to name a branch and a folder. The answer holds the repository and its default branch, the branch and the folder that the link names (the default branch and `.` when it names none), and `commit_sha`: the commit that a build of that branch would use now.\n\nLookups are limited to about 30 a minute for the key's owner. A repository that is private, that does not exist or that has moved is refused with `422`.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "The link to a public GitHub repository, as described above. At most 2048 characters. This is the only parameter.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What a cube made from the link would build.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRepository"
                },
                "examples": {
                  "repository": {
                    "summary": "A link to a repository",
                    "value": {
                      "owner": "octocat",
                      "name": "Hello-World",
                      "url": "https://github.com/octocat/Hello-World.git",
                      "default_branch": "master",
                      "branch": "master",
                      "app_root": ".",
                      "commit_sha": "7fd1a60b01f91b314f59955a4e4d4e80d8edf11d"
                    }
                  },
                  "folder": {
                    "summary": "A link to a branch and a folder",
                    "value": {
                      "owner": "acme",
                      "name": "monorepo",
                      "url": "https://github.com/acme/monorepo.git",
                      "default_branch": "main",
                      "branch": "release",
                      "app_root": "apps/web",
                      "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "missing": {
                    "summary": "url is missing, or another parameter is sent",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "url is required",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  },
                  "link": {
                    "summary": "The link is not a GitHub repository link",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Paste a GitHub repository link, such as https://github.com/owner/repo or https://github.com/owner/repo/tree/branch/folder",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4046"
          },
          "422": {
            "description": "The request is well formed but cannot be carried out. `error.code` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "not_public": {
                    "summary": "The repository is private, or does not exist",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "This repository is not public on GitHub, or does not exist",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  },
                  "moved": {
                    "summary": "The repository was renamed or moved",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "This repository moved on GitHub; use its new link",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  },
                  "REVISION_NOT_FOUND": {
                    "summary": "The branch in the link does not exist",
                    "value": {
                      "error": {
                        "code": "REVISION_NOT_FOUND",
                        "message": "The branch in the link does not exist in the repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  },
                  "REPOSITORY_EMPTY": {
                    "summary": "The repository has no commits yet",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_EMPTY",
                        "message": "The repository is empty: it has no commits yet. Push a commit, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "The key made too many requests. Wait for the number of seconds in `Retry-After`, then retry.",
            "headers": {
              "Retry-After": {
                "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "RATE_LIMITED": {
                    "summary": "The key made too many requests. Wait for the seconds in `Retry-After`, then retry.",
                    "value": {
                      "error": {
                        "code": "RATE_LIMITED",
                        "message": "Too many requests with this API key; try again shortly",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "lookups": {
                    "summary": "More than 30 lookups in a minute",
                    "value": {
                      "error": {
                        "code": "RATE_LIMITED",
                        "message": "Too many repository lookups; try again in a minute",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAndDatabaseUnavailable"
          }
        }
      }
    },
    "/v1/organizations/{organizationId}/integrations/github/repository-tree": {
      "get": {
        "operationId": "getRepositoryFolders",
        "tags": [
          "github"
        ],
        "summary": "List the folders of a repository",
        "description": "Lists the folders of a repository at a branch, tag or commit, so that you can choose the `app_root` of a cube. It needs a key with full access, because it serves the creation of cubes.\n\nName the repository in one of two ways, and not both. For a repository of a GitHub installation, send `installation_id` (the `id` of the installation) and `repository` (`owner/name`). For a public repository, send its link as `url`.\n\nEach folder has a `path`, where `.` is the root of the repository, and `markers`: the files in it that builders use to recognize what to build, such as a `Dockerfile`, `package.json` or `go.mod`. A folder with markers is likely to hold a cube. `pnpm-workspace.yaml` marks the root of a monorepo. The folders `.git` and `node_modules` are never listed.\n\n`ref` picks the branch, tag or commit to read. Without it, the branch of a public link is read, or else the default branch of the repository. The answer names the commit it read. A repository with more than 2000 folders is cut short, and `truncated` is `true`: the root comes first, then the folders with markers and their parents, then the shallowest folders.\n\nLookups are limited to about 30 a minute for the key's owner.\n",
        "x-cubecen-access": "full",
        "security": [
          {
            "APIKeyBearer": []
          }
        ],
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "description": "The ID or slug of the organization. A key works in one organization. Another organization, by ID or by slug, is refused with `403`, and so is a slug that matches no organization. An ID that matches no organization at all is `404`.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "installation_id",
            "in": "query",
            "required": false,
            "description": "For a repository of a GitHub installation: the `id` of the installation, as `listGitHubInstallations` gives it. Send it with `repository`, and without `url`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "repository",
            "in": "query",
            "required": false,
            "description": "For a repository of a GitHub installation: its name as `owner/name`, at most 140 characters. Send it with `installation_id`.",
            "schema": {
              "type": "string",
              "maxLength": 140
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "For a public repository: its link, `https://github.com/owner/repo`, which can name a branch and a folder with `/tree/branch/folder`. At most 2048 characters. Send it without `installation_id` and `repository`.",
            "schema": {
              "type": "string",
              "maxLength": 2048
            }
          },
          {
            "name": "ref",
            "in": "query",
            "required": false,
            "description": "The branch, tag or commit SHA to read, at most 255 characters. Leave it out for the branch of the link, or else the default branch.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The folders of the repository at the commit that was read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RepositoryTree"
                },
                "example": {
                  "repository": "acme/storefront",
                  "ref": "main",
                  "commit_sha": "6e8b7d3c38a461f0c27c4d52b7a0943e4cbbb119",
                  "directories": [
                    {
                      "path": ".",
                      "markers": [
                        "package.json",
                        "pnpm-workspace.yaml"
                      ]
                    },
                    {
                      "path": "apps",
                      "markers": []
                    },
                    {
                      "path": "apps/api",
                      "markers": [
                        "Dockerfile",
                        "package.json"
                      ]
                    },
                    {
                      "path": "apps/web",
                      "markers": [
                        "package.json"
                      ]
                    }
                  ],
                  "truncated": false
                }
              }
            }
          },
          "400": {
            "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "both": {
                    "summary": "url is sent with installation_id or repository",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Send either url, or installation_id and repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  },
                  "neither": {
                    "summary": "Neither url nor installation_id is sent",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "installation_id and repository are required without url",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "installation_id"
                      }
                    }
                  },
                  "no_repository": {
                    "summary": "installation_id is sent without repository",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "repository (owner/name) is required with installation_id",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "repository": {
                    "summary": "repository is not owner/name",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "repository must be owner/name",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "installation_id": {
                    "summary": "installation_id is not an installation's ID",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "installation_id must be a connected installation's ID",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "installation_id"
                      }
                    }
                  },
                  "ref": {
                    "summary": "ref is not a valid branch, tag or commit",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "ref must be a branch, a tag or a commit SHA",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "ref"
                      }
                    }
                  },
                  "link": {
                    "summary": "The link is not a GitHub repository link",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "Paste a GitHub repository link, such as https://github.com/owner/repo or https://github.com/owner/repo/tree/branch/folder",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  },
                  "unknown": {
                    "summary": "A parameter is not supported, or is repeated",
                    "value": {
                      "error": {
                        "code": "VALIDATION_ERROR",
                        "message": "limit is not a parameter, or is repeated",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "limit"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthenticated"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden4032"
          },
          "404": {
            "$ref": "#/components/responses/NotFound4047"
          },
          "422": {
            "description": "The request is well formed but cannot be carried out. `error.code` says why.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "installation": {
                    "summary": "The installation cannot reach the repository, or does not allow it",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "The GitHub installation cannot access this repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "not_public": {
                    "summary": "The public repository is private, or does not exist",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_NOT_ACCESSIBLE",
                        "message": "This repository is not public on GitHub, or does not exist",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "url"
                      }
                    }
                  },
                  "REVISION_NOT_FOUND": {
                    "summary": "The branch, tag or commit does not exist in the repository.",
                    "value": {
                      "error": {
                        "code": "REVISION_NOT_FOUND",
                        "message": "The branch, tag or commit was not found in the repository",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "ref"
                      }
                    }
                  },
                  "REPOSITORY_EMPTY": {
                    "summary": "The repository has no commits yet",
                    "value": {
                      "error": {
                        "code": "REPOSITORY_EMPTY",
                        "message": "The repository is empty: it has no commits yet. Push a commit, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                        "field": "repository"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_REMOVED": {
                    "summary": "The Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_REMOVED",
                        "message": "The Cubecen GitHub App is no longer installed on acme. Connect GitHub again, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_INSTALLATION_SUSPENDED": {
                    "summary": "The Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_INSTALLATION_SUSPENDED",
                        "message": "The Cubecen GitHub App is suspended on acme. Unsuspend it in acme's GitHub settings (Settings -> Applications), then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  },
                  "GITHUB_PERMISSIONS_MISSING": {
                    "summary": "The GitHub account has not approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub.",
                    "value": {
                      "error": {
                        "code": "GITHUB_PERMISSIONS_MISSING",
                        "message": "The Cubecen GitHub App on acme lacks a permission it needs (repository contents: read). An owner of acme must approve the App's requested permissions on GitHub, then try again",
                        "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimitedAndRateLimited429"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "502": {
            "$ref": "#/components/responses/GithubUnavailable"
          },
          "503": {
            "$ref": "#/components/responses/GithubRateLimitedAndDatabaseUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "APIKeyBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "An API key, made in the dashboard and sent in the `Authorization` header: `Authorization: Bearer cbc_...`.\n\nA key belongs to one organization and acts as the person who made it, with their role. A read-only key can call only the operations marked `read` in `x-cubecen-access`; a full-access key can call them all. A key that is missing, unknown, expired or revoked is refused with `401`.\n"
      }
    },
    "responses": {
      "Conflict": {
        "description": "The request conflicts with the current state of the resource. `error.code` says how.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "CONFLICT": {
                "summary": "Another project of the organization has this slug",
                "value": {
                  "error": {
                    "code": "CONFLICT",
                    "message": "Resource already exists",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "DatabaseUnavailable503": {
        "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "DATABASE_UNAVAILABLE": {
                "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASE_UNAVAILABLE",
                    "message": "Database unavailable",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "DatabaseUnavailable5032": {
        "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "DATABASE_UNAVAILABLE": {
                "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASE_UNAVAILABLE",
                    "message": "Service temporarily unavailable",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "DatabaseUnavailableAndDatabasesUnavailable": {
        "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "DATABASE_UNAVAILABLE": {
                "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASE_UNAVAILABLE",
                    "message": "Database unavailable",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "DATABASES_UNAVAILABLE": {
                "summary": "Databases are temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASES_UNAVAILABLE",
                    "message": "Databases are temporarily unavailable; try again shortly",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "DatabaseUnavailableAndMaintenance": {
        "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "DATABASE_UNAVAILABLE": {
                "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASE_UNAVAILABLE",
                    "message": "Database unavailable",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "MAINTENANCE": {
                "summary": "The platform is in maintenance. Builds and other changes are paused for a short while; retry after the seconds in `Retry-After`.",
                "value": {
                  "error": {
                    "code": "MAINTENANCE",
                    "message": "The platform is in maintenance; builds, deployments and other changes to cubes are paused for a short while",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "Forbidden403": {
        "description": "The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "FORBIDDEN": {
                "summary": "The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.",
                "value": {
                  "error": {
                    "code": "FORBIDDEN",
                    "message": "Access denied",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "Forbidden4032": {
        "description": "The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "FORBIDDEN": {
                "summary": "The key may not do this. Its access level or its owner's role does not allow it, or the organization is not the key's.",
                "value": {
                  "error": {
                    "code": "FORBIDDEN",
                    "message": "Permission denied",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "GithubInstallationRemovedAnd2More": {
        "description": "The request is well formed but cannot be carried out. `error.code` says why.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "GITHUB_INSTALLATION_REMOVED": {
                "summary": "The Cubecen GitHub App is no longer installed on the GitHub account. Connect GitHub again.",
                "value": {
                  "error": {
                    "code": "GITHUB_INSTALLATION_REMOVED",
                    "message": "The Cubecen GitHub App is no longer installed on acme. Connect GitHub again, then try again",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "GITHUB_INSTALLATION_SUSPENDED": {
                "summary": "The Cubecen GitHub App is suspended on the GitHub account. An owner of the account can unsuspend it on GitHub.",
                "value": {
                  "error": {
                    "code": "GITHUB_INSTALLATION_SUSPENDED",
                    "message": "The Cubecen GitHub App is suspended on acme. Unsuspend it in acme's GitHub settings (Settings -> Applications), then try again",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "GITHUB_PERMISSIONS_MISSING": {
                "summary": "The GitHub account has not approved a permission the Cubecen GitHub App needs. An owner of the account can approve it on GitHub.",
                "value": {
                  "error": {
                    "code": "GITHUB_PERMISSIONS_MISSING",
                    "message": "The Cubecen GitHub App on acme lacks a permission it needs (repository contents: read). An owner of acme must approve the App's requested permissions on GitHub, then try again",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "GithubRateLimitedAnd2More": {
        "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "GITHUB_RATE_LIMITED": {
                "summary": "GitHub's rate limit was reached. Retry after the seconds in `Retry-After`.",
                "value": {
                  "error": {
                    "code": "GITHUB_RATE_LIMITED",
                    "message": "GitHub's rate limit was reached. Try again in about a minute",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "DATABASE_UNAVAILABLE": {
                "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASE_UNAVAILABLE",
                    "message": "Database unavailable",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "MAINTENANCE": {
                "summary": "The platform is in maintenance. Builds and other changes are paused for a short while; retry after the seconds in `Retry-After`.",
                "value": {
                  "error": {
                    "code": "MAINTENANCE",
                    "message": "The platform is in maintenance; builds, deployments and other changes to cubes are paused for a short while",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "GithubRateLimitedAndDatabaseUnavailable": {
        "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "GITHUB_RATE_LIMITED": {
                "summary": "GitHub's rate limit was reached. Retry after the seconds in `Retry-After`.",
                "value": {
                  "error": {
                    "code": "GITHUB_RATE_LIMITED",
                    "message": "GitHub's rate limit was reached. Try again in about a minute",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "DATABASE_UNAVAILABLE": {
                "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASE_UNAVAILABLE",
                    "message": "Database unavailable",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "GithubUnavailable": {
        "description": "A service Cubecen relies on, such as GitHub, did not answer. Retry the same request with backoff.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "GITHUB_UNAVAILABLE": {
                "summary": "GitHub is temporarily unavailable. Retry the same request.",
                "value": {
                  "error": {
                    "code": "GITHUB_UNAVAILABLE",
                    "message": "GitHub is temporarily unavailable; retry the same request",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "InternalError": {
        "description": "Something went wrong on our side. Retry the request with backoff. If it keeps failing, give support the `error.requestId`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "INTERNAL_ERROR": {
                "summary": "Something went wrong on our side. Retry; if it keeps failing, give support the `error.requestId`.",
                "value": {
                  "error": {
                    "code": "INTERNAL_ERROR",
                    "message": "An internal error occurred",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "LogsUnavailableAndDatabaseUnavailable": {
        "description": "The service is temporarily unavailable. Retry the same request with backoff: wait a little longer after each failed attempt. The error code can differ from the one shown.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "LOGS_UNAVAILABLE": {
                "summary": "Logs are temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "LOGS_UNAVAILABLE",
                    "message": "Logs are temporarily unavailable; try again shortly",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "DATABASE_UNAVAILABLE": {
                "summary": "The service is temporarily unavailable. Retry the same request with backoff.",
                "value": {
                  "error": {
                    "code": "DATABASE_UNAVAILABLE",
                    "message": "Database unavailable",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound404": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "No such cube, or the cube is in a state that has no environment",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound4042": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "No such cube, or the cube is not set up yet",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound4043": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "No such domain in this cube",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound4044": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "No such preview in this cube",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound4045": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "No such project or database",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound4046": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "Nothing was found at this address. Check the IDs, slugs and query values in the request.",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound4047": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "The installation is not one of the organization's",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "NotFound4048": {
        "description": "Nothing was found at this address. An organization ID that matches no organization is `404`, and so is a project, cube or other ID or slug in the path that matches nothing in the organization (or in the project or cube that the path names). An organization slug that matches nothing, and another organization by ID or by slug, is `403`, not `404`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "NOT_FOUND": {
                "summary": "The organization ID matches no organization",
                "value": {
                  "error": {
                    "code": "NOT_FOUND",
                    "message": "Resource not found",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "The key made too many requests. Wait for the number of seconds in `Retry-After`, then retry.",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "RATE_LIMITED": {
                "summary": "The key made too many requests. Wait for the seconds in `Retry-After`, then retry.",
                "value": {
                  "error": {
                    "code": "RATE_LIMITED",
                    "message": "Too many requests with this API key; try again shortly",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "RateLimitedAndRateLimited429": {
        "description": "The key made too many requests. Wait for the number of seconds in `Retry-After`, then retry.",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "RATE_LIMITED": {
                "summary": "The key made too many requests. Wait for the seconds in `Retry-After`, then retry.",
                "value": {
                  "error": {
                    "code": "RATE_LIMITED",
                    "message": "Too many requests with this API key; try again shortly",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "lookups": {
                "summary": "More than 30 folder lookups in a minute",
                "value": {
                  "error": {
                    "code": "RATE_LIMITED",
                    "message": "Too many folder lookups; try again in a minute",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "RateLimitedAndRateLimited4292": {
        "description": "The key made too many requests. Wait for the number of seconds in `Retry-After`, then retry.",
        "headers": {
          "Retry-After": {
            "description": "The number of seconds to wait before you send the request again. Sent with `429`, and with the `503` answers `GITHUB_RATE_LIMITED`, `METRICS_UNAVAILABLE` and `MAINTENANCE`.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "RATE_LIMITED": {
                "summary": "The key made too many requests. Wait for the seconds in `Retry-After`, then retry.",
                "value": {
                  "error": {
                    "code": "RATE_LIMITED",
                    "message": "Too many requests with this API key; try again shortly",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              },
              "streams": {
                "summary": "Too many log streams are open. The answer has no Retry-After: close a stream first",
                "value": {
                  "error": {
                    "code": "RATE_LIMITED",
                    "message": "Too many log streams are open; close one and try again",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "Unauthenticated": {
        "description": "The API key is missing, unknown, expired or revoked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "UNAUTHENTICATED": {
                "summary": "The API key is missing, unknown, expired or revoked.",
                "value": {
                  "error": {
                    "code": "UNAUTHENTICATED",
                    "message": "Authentication required",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "ValidationError400": {
        "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "VALIDATION_ERROR": {
                "summary": "The domain ID is not a valid ID",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "Invalid request",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "ValidationError4002": {
        "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "VALIDATION_ERROR": {
                "summary": "The preview ID is not a valid ID",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "Invalid request",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "ValidationError413": {
        "description": "The request body is larger than 1 MiB.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "VALIDATION_ERROR": {
                "summary": "The request is not valid. `error.field` names the field to blame, when there is one.",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "Request body is too large",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "ValidationError415": {
        "description": "The request body must be JSON. Send `Content-Type: application/json`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "VALIDATION_ERROR": {
                "summary": "The request is not valid. `error.field` names the field to blame, when there is one.",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "Content-Type must be application/json",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      },
      "ValidationErrorAnd2More": {
        "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "follow": {
                "summary": "follow is not true or false",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "follow must be true or false",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                    "field": "follow"
                  }
                }
              },
              "cursor": {
                "summary": "The cursor is not a log position, or the position has expired",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "The log position is invalid; reload the logs",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                    "field": "cursor"
                  }
                }
              },
              "tail": {
                "summary": "tail or since is sent; they apply to cube logs only",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "tail applies to cube logs only",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                    "field": "tail"
                  }
                }
              }
            }
          }
        }
      },
      "ValidationErrorAnd3More": {
        "description": "The request is not valid. `error.field` names the field to blame, when there is one.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "follow": {
                "summary": "follow is not true or false",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "follow must be true or false",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                    "field": "follow"
                  }
                }
              },
              "cursor": {
                "summary": "The cursor is not a log position, or the position has expired",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "The log position is invalid; reload the logs",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                    "field": "cursor"
                  }
                }
              },
              "tail": {
                "summary": "tail or since is sent; they apply to a preview's own logs only",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "tail applies to cube logs only",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736",
                    "field": "tail"
                  }
                }
              },
              "id": {
                "summary": "The preview ID is not a valid ID",
                "value": {
                  "error": {
                    "code": "VALIDATION_ERROR",
                    "message": "Invalid request",
                    "requestId": "4bf92f3577b34da6a3ce929d0e0e4736"
                  }
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "AppRef": {
        "type": "object",
        "description": "A cube, named briefly.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The cube's ID.",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "description": "The cube's slug."
          },
          "name": {
            "type": "string",
            "description": "The cube's name."
          }
        },
        "required": [
          "id",
          "slug",
          "name"
        ]
      },
      "Application": {
        "type": "object",
        "description": "A cube: an application deployed from a GitHub repository.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The cube's ID.",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "description": "The ID of the organization the cube belongs to.",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "description": "The ID of the project the cube is in.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The cube's name."
          },
          "slug": {
            "type": "string",
            "description": "A short name for the cube, unique within its project, made of lowercase letters, digits and hyphens. Paths accept it in place of the ID."
          },
          "description": {
            "type": "string",
            "description": "What the cube is for, in free text. Empty when none was given."
          },
          "state": {
            "type": "string",
            "description": "`creating` while Cubecen is still setting the cube up: it cannot be built or deployed yet. `active` once it is ready. `failed` when it could not be set up: `failure_code` says why.",
            "enum": [
              "creating",
              "active",
              "failed"
            ]
          },
          "failure_code": {
            "type": "string",
            "description": "A short code that says why the cube could not be set up. Present only when `state` is `failed`."
          },
          "repository": {
            "description": "The GitHub repository the cube is built from. `null` for a very old cube that has none: such a cube can only be deleted.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationRepository"
              },
              {
                "type": "null"
              }
            ]
          },
          "runtime": {
            "$ref": "#/components/schemas/Runtime",
            "description": "How the cube is built and run, and where it is served."
          },
          "push_to_deploy": {
            "type": "boolean",
            "description": "`true` when a push to `deploy_branch` builds and deploys the pushed commit. Always `false` for a cube from a public repository."
          },
          "deploy_branch": {
            "description": "The branch that pushes deploy, and that a build without a `revision` builds. `null` tracks the repository's default branch.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "previews_enabled": {
            "type": "boolean",
            "description": "`true` when pull requests into the tracked branch get a preview of the cube."
          },
          "suspension": {
            "description": "Why the cube is paused, while it is: its instances are stopped and its address shows a page that says so. `null` while it runs. Builds and deployments go on, and start when the cube resumes.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why the cube is paused. `bandwidth_limit` means the organization's bandwidth for the period is used up. Other values can appear.",
                    "enum": [
                      "bandwidth_limit",
                      "payment",
                      "admin"
                    ]
                  }
                },
                "required": [
                  "reason"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "instance": {
            "type": "object",
            "description": "The size the cube runs at. It comes from the organization's plan, or from a choice of the cube's owner up to the size the plan allows.",
            "properties": {
              "size": {
                "type": "string",
                "description": "The size: `small`, `medium`, `large` or `xlarge`.",
                "enum": [
                  "small",
                  "medium",
                  "large",
                  "xlarge"
                ]
              },
              "memory_mib": {
                "type": "integer",
                "description": "The memory the cube is limited to, in MiB. A cube that goes over it is restarted."
              },
              "cpu": {
                "type": "number",
                "description": "The most CPU the cube can use, in cores."
              },
              "setting": {
                "description": "The size that was chosen for the cube, up to the size the plan allows. `null` while the cube follows its plan's size.",
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "small",
                      "medium",
                      "large",
                      "xlarge"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "resizing": {
                "type": "boolean",
                "description": "`true` while Cubecen is taking the cube to its target size: its `setting`, or its plan's size after a change of plan. It is normally over within seconds. `size` then shows the new size, and the instances roll over to it without downtime."
              },
              "changed_at": {
                "type": "string",
                "description": "When the cube got its size: when it was made, or when it was last resized.",
                "format": "date-time"
              },
              "reason": {
                "type": "string",
                "description": "Why the cube got its size. `create`: it was made with it. `plan`: it took its plan's size, after a change of plan or when it was set back to follow the plan. `operator`: Cubecen changed the memory of the plan. `choice`: its owner chose it.",
                "enum": [
                  "create",
                  "plan",
                  "operator",
                  "choice"
                ]
              },
              "previous_size": {
                "description": "The size the cube ran at before. `null` when it has had one size since it was made.",
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "small",
                      "medium",
                      "large",
                      "xlarge"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "size",
              "memory_mib",
              "cpu",
              "setting",
              "resizing",
              "changed_at",
              "reason",
              "previous_size"
            ]
          },
          "live_deployment": {
            "$ref": "#/components/schemas/Deployment",
            "description": "The deployment that serves the cube now. Only `getApplication` answers it, and it is absent when nothing is live."
          },
          "referenced_by": {
            "type": "array",
            "description": "The other cubes of the project whose variables refer to this cube by its slug, as `${{ slug.PUBLIC_URL }}`. Only `getApplication` answers it, and it is absent when there are none. While there are some, the slug cannot be changed.",
            "items": {
              "$ref": "#/components/schemas/AppRef"
            }
          },
          "created_by": {
            "type": "string",
            "description": "The ID of the user who created the cube.",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "description": "When the cube was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When the cube was last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "organization_id",
          "project_id",
          "name",
          "slug",
          "description",
          "state",
          "repository",
          "runtime",
          "push_to_deploy",
          "deploy_branch",
          "previews_enabled",
          "suspension",
          "instance",
          "created_by",
          "created_at",
          "updated_at"
        ]
      },
      "ApplicationCreate": {
        "type": "object",
        "description": "The cube to create. Send only these fields: a request with another field is refused with `400`.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The cube's name: 1 to 120 characters, with no space at the start or the end and no control characters.",
            "minLength": 1,
            "maxLength": 120
          },
          "slug": {
            "type": "string",
            "description": "The cube's slug: lowercase letters, digits and single hyphens, such as `web`, up to 80 characters. It must not look like an ID, and no other cube of the project may have it.",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "description": {
            "type": "string",
            "description": "What the cube is for, in free text, up to 4000 characters. Empty when left out.",
            "maxLength": 4000
          },
          "github_installation_id": {
            "type": "string",
            "description": "For a repository of a GitHub installation: the `id` of the installation, as `listGitHubInstallations` gives it. Send it with `repository.owner` and `repository.name`, and without `repository.url`.",
            "format": "uuid"
          },
          "repository": {
            "type": "object",
            "description": "The repository to build. Send `owner` and `name` with `github_installation_id`, or `url` alone.",
            "properties": {
              "owner": {
                "type": "string",
                "description": "The GitHub account that owns the repository. Letters can be in any case. At most 39 characters.",
                "minLength": 1,
                "maxLength": 39
              },
              "name": {
                "type": "string",
                "description": "The repository's name. Letters can be in any case. At most 100 characters.",
                "minLength": 1,
                "maxLength": 100
              },
              "url": {
                "type": "string",
                "description": "For a public repository: its link, `https://github.com/owner/repo`, which can name a branch and a folder with `/tree/branch/folder`, or `git@github.com:owner/repo.git`. At most 2048 characters. Send it alone, without `github_installation_id`, `owner` or `name`. The branch and the folder of the link become `deploy_branch` and `app_root`, unless the request sets them.",
                "maxLength": 2048
              }
            }
          },
          "app_root": {
            "type": "string",
            "description": "The folder of the repository to build: `.` for the root, or a relative path such as `apps/web`, at most 255 characters. `.` when left out, or the folder of a public link.",
            "default": "."
          },
          "start_command": {
            "type": "string",
            "description": "The command that starts the cube, at most 1024 characters with no control characters. Empty lets the builder find it, or a Dockerfile image run its own command.",
            "maxLength": 1024
          },
          "build_command": {
            "type": "string",
            "description": "Replaces the build command that Railpack detects, at most 1024 characters with no control characters. It does not apply to a cube built from a Dockerfile.",
            "maxLength": 1024
          },
          "output_directory": {
            "type": "string",
            "description": "A folder under `app_root` whose files are served as a static site, written like `app_root`. Not together with `start_command`."
          },
          "port": {
            "type": "integer",
            "description": "The port the cube listens on, from 1 to 65535. Leave it out to use the port the image exposes, else 8080.",
            "minimum": 1,
            "maximum": 65535
          },
          "deploy": {
            "type": "object",
            "description": "Start the cube's first build and deployment right away. Send `{}` to build the branch the cube tracks. Leave it out to only create the cube.",
            "properties": {
              "revision": {
                "type": "string",
                "description": "The branch, tag or commit SHA to build instead of the tracked branch. At most 255 characters.",
                "maxLength": 255
              }
            }
          },
          "push_to_deploy": {
            "type": "boolean",
            "description": "`true` deploys every push to the deploy branch. `true` when left out, for a repository of a GitHub installation. A cube from a public repository cannot have it: it is `false` when left out, and `true` is refused with `400`.",
            "default": true
          },
          "deploy_branch": {
            "type": "string",
            "description": "The branch that pushes deploy, and that a build without a `revision` builds. At most 255 characters; `refs/heads/` in front is dropped. Empty or left out tracks the repository's default branch, or the branch of a public link.",
            "maxLength": 255
          },
          "size": {
            "type": "string",
            "description": "The size the cube starts at, up to the largest size the plan allows: `small`, `medium`, `large` or `xlarge`. `small` when left out. It is a choice of the cube's owner, so a bigger plan later does not grow the cube. A size above the plan's is refused with `402`, and a size that is not offered right now with `409`.",
            "enum": [
              "small",
              "medium",
              "large",
              "xlarge"
            ]
          }
        },
        "required": [
          "name",
          "slug",
          "repository"
        ]
      },
      "ApplicationCreateResult": {
        "type": "object",
        "description": "The cube that was created, with its first build when the request asked for a deploy.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The cube's ID.",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "description": "The ID of the organization the cube belongs to.",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "description": "The ID of the project the cube is in.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The cube's name."
          },
          "slug": {
            "type": "string",
            "description": "A short name for the cube, unique within its project, made of lowercase letters, digits and hyphens. Paths accept it in place of the ID."
          },
          "description": {
            "type": "string",
            "description": "What the cube is for, in free text. Empty when none was given."
          },
          "state": {
            "type": "string",
            "description": "`creating` while Cubecen is still setting the cube up: it cannot be built or deployed yet. `active` once it is ready. `failed` when it could not be set up: `failure_code` says why.",
            "enum": [
              "creating",
              "active",
              "failed"
            ]
          },
          "failure_code": {
            "type": "string",
            "description": "A short code that says why the cube could not be set up. Present only when `state` is `failed`."
          },
          "repository": {
            "description": "The GitHub repository the cube is built from. `null` for a very old cube that has none: such a cube can only be deleted.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationRepository"
              },
              {
                "type": "null"
              }
            ]
          },
          "runtime": {
            "$ref": "#/components/schemas/Runtime",
            "description": "How the cube is built and run, and where it is served."
          },
          "push_to_deploy": {
            "type": "boolean",
            "description": "`true` when a push to `deploy_branch` builds and deploys the pushed commit. Always `false` for a cube from a public repository."
          },
          "deploy_branch": {
            "description": "The branch that pushes deploy, and that a build without a `revision` builds. `null` tracks the repository's default branch.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "previews_enabled": {
            "type": "boolean",
            "description": "`true` when pull requests into the tracked branch get a preview of the cube."
          },
          "suspension": {
            "description": "Why the cube is paused, while it is: its instances are stopped and its address shows a page that says so. `null` while it runs. Builds and deployments go on, and start when the cube resumes.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why the cube is paused. `bandwidth_limit` means the organization's bandwidth for the period is used up. Other values can appear.",
                    "enum": [
                      "bandwidth_limit",
                      "payment",
                      "admin"
                    ]
                  }
                },
                "required": [
                  "reason"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "instance": {
            "type": "object",
            "description": "The size the cube runs at. It comes from the organization's plan, or from a choice of the cube's owner up to the size the plan allows.",
            "properties": {
              "size": {
                "type": "string",
                "description": "The size: `small`, `medium`, `large` or `xlarge`.",
                "enum": [
                  "small",
                  "medium",
                  "large",
                  "xlarge"
                ]
              },
              "memory_mib": {
                "type": "integer",
                "description": "The memory the cube is limited to, in MiB. A cube that goes over it is restarted."
              },
              "cpu": {
                "type": "number",
                "description": "The most CPU the cube can use, in cores."
              },
              "setting": {
                "description": "The size that was chosen for the cube, up to the size the plan allows. `null` while the cube follows its plan's size.",
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "small",
                      "medium",
                      "large",
                      "xlarge"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "resizing": {
                "type": "boolean",
                "description": "`true` while Cubecen is taking the cube to its target size: its `setting`, or its plan's size after a change of plan. It is normally over within seconds. `size` then shows the new size, and the instances roll over to it without downtime."
              },
              "changed_at": {
                "type": "string",
                "description": "When the cube got its size: when it was made, or when it was last resized.",
                "format": "date-time"
              },
              "reason": {
                "type": "string",
                "description": "Why the cube got its size. `create`: it was made with it. `plan`: it took its plan's size, after a change of plan or when it was set back to follow the plan. `operator`: Cubecen changed the memory of the plan. `choice`: its owner chose it.",
                "enum": [
                  "create",
                  "plan",
                  "operator",
                  "choice"
                ]
              },
              "previous_size": {
                "description": "The size the cube ran at before. `null` when it has had one size since it was made.",
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "small",
                      "medium",
                      "large",
                      "xlarge"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "size",
              "memory_mib",
              "cpu",
              "setting",
              "resizing",
              "changed_at",
              "reason",
              "previous_size"
            ]
          },
          "created_by": {
            "type": "string",
            "description": "The ID of the user who created the cube.",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "description": "When the cube was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When the cube was last changed.",
            "format": "date-time"
          },
          "build": {
            "$ref": "#/components/schemas/Build",
            "description": "The cube's first build, when the request asked for `deploy` and the build could start. Absent otherwise."
          },
          "build_error": {
            "$ref": "#/components/schemas/ErrorInfo",
            "description": "Why the first build could not start, when the request asked for `deploy`. The cube exists all the same. Absent otherwise."
          }
        },
        "required": [
          "id",
          "organization_id",
          "project_id",
          "name",
          "slug",
          "description",
          "state",
          "repository",
          "runtime",
          "push_to_deploy",
          "deploy_branch",
          "previews_enabled",
          "suspension",
          "instance",
          "created_by",
          "created_at",
          "updated_at"
        ]
      },
      "ApplicationPage": {
        "type": "object",
        "description": "A page of cubes.",
        "properties": {
          "items": {
            "type": "array",
            "description": "The cubes on this page.",
            "items": {
              "$ref": "#/components/schemas/ApplicationSummary"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Send it as `cursor` to get the next page. Absent on the last page."
          }
        },
        "required": [
          "items"
        ]
      },
      "ApplicationPatch": {
        "type": "object",
        "description": "The fields of a cube to change. Send at least one; one that is left out stays as it is. A request with another field is refused with `400`.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The cube's new name. The rules are those of `name` when a cube is created. It cannot be `null`.",
            "minLength": 1,
            "maxLength": 120
          },
          "slug": {
            "type": "string",
            "description": "The cube's new slug. The rules are those of `slug` when a cube is created. It cannot be `null`. It is refused with `409` while the variables of another cube refer to this cube by its slug.",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "description": {
            "description": "The cube's new description, up to 4000 characters. `null` clears it.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "start_command": {
            "description": "The new start command, at most 1024 characters with no control characters. `null` or an empty string clears it. Applies from the next build, and needs an `active` cube.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "app_root": {
            "type": "string",
            "description": "The new folder of the repository to build: `.` for the root, or a relative path. It cannot be `null`. Applies from the next build, and needs an `active` cube."
          },
          "build_command": {
            "description": "The new build command, at most 1024 characters with no control characters. `null` or an empty string clears it. Applies from the next build, and needs an `active` cube.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "output_directory": {
            "description": "The new output directory, written like `app_root`. `null` or an empty string clears it. The cube cannot end up with both an output directory and a start command. Applies from the next build, and needs an `active` cube.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "port": {
            "description": "The new port, from 1 to 65535. `null` clears it. Applies from the next build, and needs an `active` cube.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ]
          },
          "push_to_deploy": {
            "type": "boolean",
            "description": "`true` or `false`. It cannot be `null`. A cube from a public repository cannot turn it on: that is refused with `400`."
          },
          "deploy_branch": {
            "description": "The new branch that pushes deploy, at most 255 characters. `null` or an empty string tracks the repository's default branch. A branch that does not exist yet is accepted: pushes to it deploy once it does.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "description": "The size to run the cube at, up to the largest size the plan allows: `small`, `medium`, `large` or `xlarge`. `null`, or the plan's own size, makes the cube follow its plan's size. The cube is resized at once. It needs an `active` cube.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "small",
                  "medium",
                  "large",
                  "xlarge"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "minProperties": 1
      },
      "ApplicationRepository": {
        "type": "object",
        "description": "The GitHub repository a cube is built from.",
        "properties": {
          "source": {
            "type": "string",
            "description": "`github_app`: a repository of a GitHub installation, read with the installation's access, which lets pushes deploy it. `public`: a public repository, read without any access, made from its link.",
            "enum": [
              "github_app",
              "public"
            ]
          },
          "github_installation_id": {
            "description": "The `id` of the GitHub installation the repository comes through, as `listGitHubInstallations` gives it. `null` for a public repository.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "owner": {
            "type": "string",
            "description": "The GitHub account that owns the repository."
          },
          "name": {
            "type": "string",
            "description": "The repository's name."
          },
          "url": {
            "type": "string",
            "description": "The address to clone the repository from: `https://github.com/owner/name.git`.",
            "pattern": "^https://github\\.com/[A-Za-z0-9-]+/[A-Za-z0-9_.-]+\\.git$"
          },
          "default_branch": {
            "type": "string",
            "description": "The repository's default branch when the cube was created."
          }
        },
        "required": [
          "source",
          "github_installation_id",
          "owner",
          "name",
          "url",
          "default_branch"
        ]
      },
      "ApplicationSummary": {
        "type": "object",
        "description": "A cube in a list, with its project, its newest release and the deployment that is live now.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The cube's ID.",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "description": "The ID of the organization the cube belongs to.",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "description": "The ID of the project the cube is in.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The cube's name."
          },
          "slug": {
            "type": "string",
            "description": "A short name for the cube, unique within its project, made of lowercase letters, digits and hyphens. Paths accept it in place of the ID."
          },
          "description": {
            "type": "string",
            "description": "What the cube is for, in free text. Empty when none was given."
          },
          "state": {
            "type": "string",
            "description": "`creating` while Cubecen is still setting the cube up: it cannot be built or deployed yet. `active` once it is ready. `failed` when it could not be set up: `failure_code` says why.",
            "enum": [
              "creating",
              "active",
              "failed"
            ]
          },
          "failure_code": {
            "type": "string",
            "description": "A short code that says why the cube could not be set up. Present only when `state` is `failed`."
          },
          "repository": {
            "description": "The GitHub repository the cube is built from. `null` for a very old cube that has none: such a cube can only be deleted.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApplicationRepository"
              },
              {
                "type": "null"
              }
            ]
          },
          "runtime": {
            "$ref": "#/components/schemas/Runtime",
            "description": "How the cube is built and run, and where it is served."
          },
          "push_to_deploy": {
            "type": "boolean",
            "description": "`true` when a push to `deploy_branch` builds and deploys the pushed commit. Always `false` for a cube from a public repository."
          },
          "deploy_branch": {
            "description": "The branch that pushes deploy, and that a build without a `revision` builds. `null` tracks the repository's default branch.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "previews_enabled": {
            "type": "boolean",
            "description": "`true` when pull requests into the tracked branch get a preview of the cube."
          },
          "suspension": {
            "description": "Why the cube is paused, while it is: its instances are stopped and its address shows a page that says so. `null` while it runs. Builds and deployments go on, and start when the cube resumes.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why the cube is paused. `bandwidth_limit` means the organization's bandwidth for the period is used up. Other values can appear.",
                    "enum": [
                      "bandwidth_limit",
                      "payment",
                      "admin"
                    ]
                  }
                },
                "required": [
                  "reason"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "instance": {
            "type": "object",
            "description": "The size the cube runs at. It comes from the organization's plan, or from a choice of the cube's owner up to the size the plan allows.",
            "properties": {
              "size": {
                "type": "string",
                "description": "The size: `small`, `medium`, `large` or `xlarge`.",
                "enum": [
                  "small",
                  "medium",
                  "large",
                  "xlarge"
                ]
              },
              "memory_mib": {
                "type": "integer",
                "description": "The memory the cube is limited to, in MiB. A cube that goes over it is restarted."
              },
              "cpu": {
                "type": "number",
                "description": "The most CPU the cube can use, in cores."
              },
              "setting": {
                "description": "The size that was chosen for the cube, up to the size the plan allows. `null` while the cube follows its plan's size.",
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "small",
                      "medium",
                      "large",
                      "xlarge"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "resizing": {
                "type": "boolean",
                "description": "`true` while Cubecen is taking the cube to its target size: its `setting`, or its plan's size after a change of plan. It is normally over within seconds. `size` then shows the new size, and the instances roll over to it without downtime."
              },
              "changed_at": {
                "type": "string",
                "description": "When the cube got its size: when it was made, or when it was last resized.",
                "format": "date-time"
              },
              "reason": {
                "type": "string",
                "description": "Why the cube got its size. `create`: it was made with it. `plan`: it took its plan's size, after a change of plan or when it was set back to follow the plan. `operator`: Cubecen changed the memory of the plan. `choice`: its owner chose it.",
                "enum": [
                  "create",
                  "plan",
                  "operator",
                  "choice"
                ]
              },
              "previous_size": {
                "description": "The size the cube ran at before. `null` when it has had one size since it was made.",
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "small",
                      "medium",
                      "large",
                      "xlarge"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "size",
              "memory_mib",
              "cpu",
              "setting",
              "resizing",
              "changed_at",
              "reason",
              "previous_size"
            ]
          },
          "live_deployment": {
            "description": "The deployment that serves the cube now. `null` until a deployment has succeeded.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/LiveDeploymentRef"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_by": {
            "type": "string",
            "description": "The ID of the user who created the cube.",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "description": "When the cube was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When the cube was last changed.",
            "format": "date-time"
          },
          "project": {
            "$ref": "#/components/schemas/ProjectRef",
            "description": "The project the cube is in."
          },
          "last_release": {
            "description": "The cube's newest build, and where its release is. `null` until the cube has had a build.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/LastRelease"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "organization_id",
          "project_id",
          "name",
          "slug",
          "description",
          "state",
          "repository",
          "runtime",
          "push_to_deploy",
          "deploy_branch",
          "previews_enabled",
          "suspension",
          "instance",
          "created_by",
          "created_at",
          "updated_at",
          "project",
          "last_release",
          "live_deployment"
        ]
      },
      "Build": {
        "type": "object",
        "description": "A build of a cube, with the state of its release, which is the build and the deployment that follows it.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The build's ID: an opaque string that starts with `bld_` (`dep_` for the oldest builds). Do not take it apart.",
            "pattern": "^(bld|dep)_"
          },
          "revision": {
            "type": "string",
            "description": "What the build was asked to build, as a label: a branch, a tag or a commit SHA. A build started for an exact commit shows the branch or tag that commit was last built from, when there is one."
          },
          "commit_sha": {
            "type": "string",
            "description": "The exact commit that was built, as 40 hexadecimal characters.",
            "pattern": "^[0-9a-f]{40}$"
          },
          "builder": {
            "description": "How the build was made: `dockerfile` (a Dockerfile in the cube's `app_root` folder) or `railpack`. `null` until the build has looked for a Dockerfile, and for builds made before Dockerfile support. New values may appear.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "port": {
            "description": "The port the cube listens on and gets traffic on, which it receives as `PORT`. It is the cube's `port` setting, else the one port the image exposes. `null` means the default, 8080.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ]
          },
          "framework": {
            "description": "What the builder detected, such as `vite`, `next` or `astro`. A guess: a cube built with React Router can show as `vite`. `null` when nothing specific was detected, for Dockerfile builds and for builds made before detection. New values may appear.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "static": {
            "description": "`true` when the image serves files, as a static site does, and `false` when it runs a server. `null` for Dockerfile builds and for builds made before detection.",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "description": "The build step's own status: `QUEUED`, `BUILDING`, `SUCCEEDED`, `FAILED` or `CANCELLED`. Follow `release_status` instead, which also covers the deployment that follows the build. New values may appear."
          },
          "release_status": {
            "type": "string",
            "description": "Where the release is, counting the build and the deployment that follows it. `QUEUED` is waiting to build and `BUILDING` is building. `BUILT` is built without deploying: it can be deployed later. `DEPLOYING` is built and going live, and `DEPLOYED` is live at `public_url`. `BUILD_FAILED` and `DEPLOY_FAILED` have an `error`; after a failed deployment the previous version keeps serving. `CANCELLED` was cancelled. `SUPERSEDED` was built, but a newer build was deployed instead. `UNKNOWN` is a status this API does not describe yet: keep polling.",
            "enum": [
              "QUEUED",
              "BUILDING",
              "BUILD_FAILED",
              "CANCELLED",
              "BUILT",
              "DEPLOYING",
              "SUPERSEDED",
              "DEPLOY_FAILED",
              "DEPLOYED",
              "UNKNOWN"
            ]
          },
          "terminal": {
            "type": "boolean",
            "description": "`false` while the release is still moving, so keep polling. `true` once `release_status` is final."
          },
          "error": {
            "$ref": "#/components/schemas/ErrorInfo",
            "description": "Why the build or the deployment failed. Present when `release_status` is `BUILD_FAILED` or `DEPLOY_FAILED`."
          },
          "image_digest": {
            "type": "string",
            "description": "The digest of the image the build made, as `sha256:` and 64 hexadecimal characters. Present once the image is built."
          },
          "auto_deploy": {
            "type": "string",
            "description": "What became of the deployment that follows the build: `PENDING` (not decided yet), `TRIGGERED` (a deployment was started), `SKIPPED` or `FAILED`. Absent for a build that does not deploy."
          },
          "reused": {
            "type": "boolean",
            "description": "`true` only in the answer to a request that asked for `reuse` and was served by deploying this earlier build again instead of building. `deployment_id` and `deployment` are then the new deployment, and `release_status`, `terminal`, `error` and `public_url` describe it. Follow that deployment: a later read of this build shows it as it was, with `reused` set to `false`. `false` everywhere else."
          },
          "created_by": {
            "description": "The ID of the user who started the build. For a build started with an API key, the key's owner. `null` for a build that a push started, and for a build with no recorded origin.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "trigger": {
            "description": "What started the build: `dashboard` (a person, in the dashboard), `push` (a push to the branch the cube deploys from), `api` (an API key) or `mcp` (an AI agent signed in as a person through Cubecen's MCP server). `null` for a build with no recorded origin.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "dashboard",
                  "push",
                  "api",
                  "mcp"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "pushed_by": {
            "description": "The GitHub login that pushed, when `trigger` is `push`. `null` otherwise.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "api_key": {
            "description": "The API key that started the build, when `trigger` is `api`. `null` otherwise. A revoked key keeps its name here.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The key's ID.",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "description": "The key's name, as it was given. Everyone who can read the build sees it, so a name is no place for a secret."
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_client": {
            "description": "The AI client that started the build for the person, when `trigger` is `mcp`, such as `claude.ai`. `null` otherwise.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "env_version": {
            "description": "The version of the environment variables the build ran with: 7 lowercase hexadecimal characters. `null` for builds made before environment versions, and for builds with no variables.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "deployment_id": {
            "type": "string",
            "description": "The ID of the deployment that follows the build, once there is one. Absent for a build that does not deploy."
          },
          "deployment": {
            "$ref": "#/components/schemas/Deployment",
            "description": "The deployment that follows the build, once there is one."
          },
          "public_url": {
            "type": "string",
            "description": "The address the cube is served at. Present once `release_status` is `DEPLOYED`."
          },
          "created_at": {
            "type": "string",
            "description": "When the build was created.",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "description": "When the build started running. Absent while it waits in the queue.",
            "format": "date-time"
          },
          "finished_at": {
            "type": "string",
            "description": "When the build finished. Absent until then.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "revision",
          "commit_sha",
          "builder",
          "port",
          "framework",
          "static",
          "status",
          "release_status",
          "terminal",
          "reused",
          "env_version",
          "created_at"
        ]
      },
      "BuildCreate": {
        "type": "object",
        "description": "What to build, and whether to deploy it. Send only these fields: a request with another field is refused with `400`.",
        "properties": {
          "revision": {
            "type": "string",
            "description": "The branch, tag or commit SHA to build. Without it, the build uses the branch the cube deploys from, or the repository's default branch. At most 255 characters.",
            "maxLength": 255
          },
          "deploy": {
            "type": "boolean",
            "description": "`true` builds and deploys. `false` builds only. `false` when left out."
          },
          "reuse": {
            "type": "boolean",
            "description": "Only with `deploy` set to `true`. Lets a deploy use an earlier build of the same commit instead of building again, when nothing the build depends on has changed. With `deploy` set to `false` it is refused with `400`, and `error.field` is `reuse`. `false` when left out."
          }
        }
      },
      "BuildList": {
        "type": "object",
        "description": "The builds of a cube.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The builds, newest first.",
            "items": {
              "$ref": "#/components/schemas/Build"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "CubeRef": {
        "type": "object",
        "description": "A cube, by its ID, slug and name.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The cube's ID.",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "description": "The cube's slug."
          },
          "name": {
            "type": "string",
            "description": "The cube's name."
          }
        },
        "required": [
          "id",
          "slug",
          "name"
        ]
      },
      "Database": {
        "type": "object",
        "description": "A Postgres database of a project. It never holds a password: `getDatabaseConnection` does.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The database's ID.",
            "format": "uuid"
          },
          "slug": {
            "type": "string",
            "description": "The database's slug: how cubes refer to it, as in `${{ db.DATABASE_URL }}`. Unique among the cubes and databases of the project."
          },
          "name": {
            "type": "string",
            "description": "The database's name."
          },
          "status": {
            "type": "string",
            "description": "`provisioning` while it is being made, `ready`, `suspended` (it keeps its data and takes no connections; see `suspended_reason`), `failed` (it could not be made: delete it and create it again) or `deleting`.",
            "enum": [
              "provisioning",
              "ready",
              "suspended",
              "failed",
              "deleting",
              "deleted"
            ]
          },
          "suspended_reason": {
            "description": "Why the database is suspended, while it is. `quota`: a monthly limit was reached; compute and transfer start again on the 1st of the month at 00:00 UTC, storage once its limit is raised. `plan`: the organization's plan no longer has databases. `staff`: Cubecen suspended it. `null` when it is not suspended.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "quota",
                  "plan",
                  "staff"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "grace_ends_at": {
            "description": "Set when the organization's plan no longer has databases: the database is suspended at this time unless the plan has databases again. It stays set during the suspension. `null` otherwise.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "delete_after": {
            "description": "When a database suspended for the plan is deleted, 90 days after the suspension began. `null` unless a deletion is scheduled.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "region": {
            "type": "string",
            "description": "Where the database runs: `aws-eu-central-1`, in Frankfurt."
          },
          "postgres_version": {
            "type": "integer",
            "description": "The major version of Postgres."
          },
          "host": {
            "description": "The host that `database_url` connects to. It holds no secret. `null` before the database is ready.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "referenced_by": {
            "type": "array",
            "description": "The cubes whose variables refer to the database. While any does, it cannot be deleted and its slug cannot change.",
            "items": {
              "$ref": "#/components/schemas/CubeRef"
            }
          },
          "limits": {
            "$ref": "#/components/schemas/DatabaseLimits",
            "description": "What the database can use."
          },
          "usage": {
            "$ref": "#/components/schemas/DatabaseUsage",
            "description": "What the database used this month."
          },
          "created_at": {
            "type": "string",
            "description": "When the database was created.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name",
          "status",
          "suspended_reason",
          "grace_ends_at",
          "delete_after",
          "region",
          "postgres_version",
          "host",
          "referenced_by",
          "limits",
          "usage",
          "created_at"
        ]
      },
      "DatabaseConnection": {
        "type": "object",
        "description": "How to connect to a database from outside Cubecen. It holds the password.",
        "properties": {
          "host": {
            "type": "string",
            "description": "The host for direct connections."
          },
          "pooled_host": {
            "type": "string",
            "description": "The host of the connection pooler."
          },
          "port": {
            "type": "integer",
            "description": "The port, 5432."
          },
          "database": {
            "type": "string",
            "description": "The name of the database to connect to."
          },
          "user": {
            "type": "string",
            "description": "The user to connect as."
          },
          "password": {
            "type": "string",
            "description": "The password."
          },
          "database_url": {
            "type": "string",
            "description": "A URL through the connection pooler, with `sslmode=require`: use it in applications."
          },
          "database_url_unpooled": {
            "type": "string",
            "description": "A URL for a direct connection, with `sslmode=require`: use it for migrations, `LISTEN` and session state."
          }
        },
        "required": [
          "host",
          "pooled_host",
          "port",
          "database",
          "user",
          "password",
          "database_url",
          "database_url_unpooled"
        ]
      },
      "DatabaseCreate": {
        "type": "object",
        "description": "A database to create.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The database's name, 1 to 64 characters.",
            "minLength": 1,
            "maxLength": 64
          },
          "slug": {
            "type": "string",
            "description": "The database's slug: lowercase letters, digits and single hyphens. No cube or other database of the project can have it.",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        },
        "required": [
          "name",
          "slug"
        ]
      },
      "DatabaseLimits": {
        "type": "object",
        "description": "What a database can use, from the organization's plan.",
        "properties": {
          "max_cu": {
            "type": "number",
            "description": "The most compute it can scale up to, in compute units: 1 unit is 1 vCPU and 4 GiB of memory."
          },
          "storage_gb": {
            "type": "integer",
            "description": "The storage it can hold, in GB of 10^9 bytes."
          },
          "compute_hours": {
            "type": "integer",
            "description": "The compute it can use in a calendar month (UTC), in compute-unit hours."
          },
          "transfer_gb": {
            "type": "integer",
            "description": "The data it can transfer in a calendar month, in GB."
          }
        },
        "required": [
          "max_cu",
          "storage_gb",
          "compute_hours",
          "transfer_gb"
        ]
      },
      "DatabasePage": {
        "type": "object",
        "description": "A page of databases.",
        "properties": {
          "items": {
            "type": "array",
            "description": "The databases on this page, oldest first.",
            "items": {
              "$ref": "#/components/schemas/Database"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Send it as `cursor` to get the next page. Absent on the last page."
          }
        },
        "required": [
          "items"
        ]
      },
      "DatabaseUpdate": {
        "type": "object",
        "description": "The changes to a database. Send at least one field.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The new name, 1 to 64 characters.",
            "minLength": 1,
            "maxLength": 64
          },
          "slug": {
            "type": "string",
            "description": "The new slug: lowercase letters, digits and single hyphens. Refused while cubes refer to the old one.",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        }
      },
      "DatabaseUsage": {
        "type": "object",
        "description": "What a database used this month.",
        "properties": {
          "compute_hours": {
            "type": "number",
            "description": "The compute used this month, in compute-unit hours."
          },
          "storage_gb": {
            "type": "number",
            "description": "The storage it holds now, in GB."
          },
          "transfer_gb": {
            "type": "number",
            "description": "The data transferred this month, in GB."
          },
          "period_start": {
            "type": "string",
            "description": "The start of the month, UTC.",
            "format": "date-time"
          },
          "period_end": {
            "type": "string",
            "description": "The start of the next month, UTC. It is not part of this one.",
            "format": "date-time"
          },
          "as_of": {
            "description": "When the usage was last measured. It is measured about every hour, so a database can go a little past a limit before it is suspended. `null` before the first measurement.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "compute_hours",
          "storage_gb",
          "transfer_gb",
          "period_start",
          "period_end",
          "as_of"
        ]
      },
      "DeletionPending": {
        "type": "object",
        "description": "The answer to a delete that is still going on.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the cube that is being deleted.",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "Always `DELETION_PENDING`.",
            "enum": [
              "DELETION_PENDING"
            ]
          }
        },
        "required": [
          "id",
          "status"
        ]
      },
      "Deployment": {
        "type": "object",
        "description": "A deployment: a build running as the live version of a cube, or on its way there.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The deployment's ID: an opaque string that starts with `dpl_`. Do not take it apart.",
            "pattern": "^dpl_"
          },
          "build_id": {
            "type": "string",
            "description": "The ID of the build the deployment runs."
          },
          "image_digest": {
            "type": "string",
            "description": "The digest of the image the deployment runs, as `sha256:` and 64 hexadecimal characters."
          },
          "status": {
            "type": "string",
            "description": "The deployment's own status: `QUEUED`, `DEPLOYING`, `SUCCEEDED`, `FAILED` or `CANCELLED`. New values may appear."
          },
          "public_url": {
            "type": "string",
            "description": "The address the cube is served at. Present once the deployment has succeeded."
          },
          "error": {
            "$ref": "#/components/schemas/ErrorInfo",
            "description": "Why the deployment failed. Present when it failed."
          },
          "created_by": {
            "description": "The ID of the user who started the deployment. For a deployment that follows a build, the build's. `null` when a push started it, and when its origin is not recorded.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "trigger": {
            "description": "What started the deployment: `dashboard`, `push`, `api` or `mcp`, as on a build. `null` when its origin is not recorded.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "dashboard",
                  "push",
                  "api",
                  "mcp"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "pushed_by": {
            "description": "The GitHub login that pushed, when `trigger` is `push`. `null` otherwise.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "api_key": {
            "description": "The API key that started the deployment, when `trigger` is `api`. `null` otherwise. A revoked key keeps its name here.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The key's ID.",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "description": "The key's name, as it was given. Everyone who can read the deployment sees it, so a name is no place for a secret."
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_client": {
            "description": "The AI client that started the deployment for the person, when `trigger` is `mcp`, such as `claude.ai`. `null` otherwise.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "env_version": {
            "description": "The version of the environment variables the deployment runs with: 7 lowercase hexadecimal characters. `null` for deployments made before environment versions, and for deployments with no variables.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the deployment was created.",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "description": "When the deployment started. Absent while it waits in the queue.",
            "format": "date-time"
          },
          "finished_at": {
            "type": "string",
            "description": "When the deployment finished. Absent until then.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "build_id",
          "status",
          "env_version",
          "created_at"
        ]
      },
      "DeploymentCreate": {
        "type": "object",
        "description": "Which build to deploy. Send only these fields: a request with another field is refused with `400`.",
        "properties": {
          "build_id": {
            "type": "string",
            "description": "The build to deploy: its `id`. It must be a successful build of this cube. Without it, the cube's latest successful build is deployed."
          },
          "env_version": {
            "type": "string",
            "description": "Also bring back the variables of an earlier release: the `env_version` of that release, 7 lowercase hexadecimal characters. They are first made the current variables again, as a new version, unless the current ones already hold the same values, and then the deployment ships them. Old secret values come back too. Without it, the deployment ships the current variables.",
            "pattern": "^[0-9a-f]{7}$"
          }
        }
      },
      "DeploymentList": {
        "type": "object",
        "description": "The deployments of a cube.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The deployments, newest first.",
            "items": {
              "$ref": "#/components/schemas/Deployment"
            }
          },
          "live_deployment_id": {
            "description": "The ID of the deployment that serves the cube now, the successful one that finished last. `null` when nothing is live.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "live_deployment_id"
        ]
      },
      "Domain": {
        "type": "object",
        "description": "A custom domain of a cube. `error` is absent while there is nothing to explain. `reconnect` is `null` while the domain uses the current connection.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The domain's ID.",
            "format": "uuid"
          },
          "hostname": {
            "type": "string",
            "description": "The hostname, in lowercase. An international name is in punycode (`xn--...`)."
          },
          "apex": {
            "type": "boolean",
            "description": "`true` for a registrable domain itself, such as `example.com`, which cannot have a plain CNAME."
          },
          "status": {
            "type": "string",
            "description": "`pending_verification` waits for the ownership record. `provisioning` is verified, and waits for the routing record, the certificate and the route to the cube. `active` is served over HTTPS. `failed` is no longer checked: `error` says why, and `checkDomain` starts it over. `removing` is going away after `removeDomain`.",
            "enum": [
              "pending_verification",
              "provisioning",
              "active",
              "failed",
              "removing"
            ]
          },
          "dns_records": {
            "type": "array",
            "description": "The DNS records to create at your DNS provider, with whether Cubecen has seen each one work.",
            "items": {
              "$ref": "#/components/schemas/DomainDNSRecord"
            }
          },
          "certificate": {
            "description": "The hostname's certificate. `null` until Cubecen has set the hostname up.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/DomainCertificate"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "$ref": "#/components/schemas/DomainError",
            "description": "Why the domain is not active yet, or has failed."
          },
          "reconnect": {
            "description": "Set while the domain uses an older connection that stops serving it: see `reconnectDomain`. `null` otherwise.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/DomainReconnect"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the domain was added.",
            "format": "date-time"
          },
          "checked_at": {
            "description": "When the domain was last checked. `null` before the first check.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "verified_at": {
            "description": "When the ownership record was seen. `null` until then.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "activated_at": {
            "description": "When the domain first served the cube over HTTPS. `null` until then.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "hostname",
          "apex",
          "status",
          "dns_records",
          "certificate",
          "reconnect",
          "created_at",
          "checked_at",
          "verified_at",
          "activated_at"
        ]
      },
      "DomainCertificate": {
        "type": "object",
        "description": "The hostname's certificate, which Cubecen issues and renews.",
        "properties": {
          "status": {
            "type": "string",
            "description": "`pending` until the certificate is issued, then `active`.",
            "enum": [
              "pending",
              "active"
            ]
          }
        },
        "required": [
          "status"
        ]
      },
      "DomainCreate": {
        "type": "object",
        "description": "The hostname to add. Send only this field: a request with another field is refused with `400`.",
        "properties": {
          "hostname": {
            "type": "string",
            "description": "The hostname, such as `app.example.com`. A pasted URL gives its host. It is stored in lowercase, without a trailing dot, and an international name in punycode.",
            "minLength": 1
          }
        },
        "required": [
          "hostname"
        ]
      },
      "DomainDNSRecord": {
        "type": "object",
        "description": "A DNS record to create at your DNS provider.",
        "properties": {
          "purpose": {
            "type": "string",
            "description": "`ownership` proves that you control the hostname. `routing` points the hostname at Cubecen.",
            "enum": [
              "ownership",
              "routing"
            ]
          },
          "type": {
            "type": "string",
            "description": "The record type: `TXT`, `CNAME`, `A` or `AAAA`.",
            "enum": [
              "TXT",
              "CNAME",
              "A",
              "AAAA"
            ]
          },
          "name": {
            "type": "string",
            "description": "The record's full name."
          },
          "value": {
            "type": "string",
            "description": "What the record holds. Copy it as it is."
          },
          "note": {
            "type": "string",
            "description": "Advice for this record, such as the CNAME flattening that an apex domain needs."
          },
          "ok": {
            "description": "Whether Cubecen has seen the record work. `null` until it can tell.",
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "purpose",
          "type",
          "name",
          "value",
          "ok"
        ]
      },
      "DomainError": {
        "type": "object",
        "description": "Why a domain is not active yet, or has failed.",
        "properties": {
          "code": {
            "type": "string",
            "description": "A short code. `DNS_NOT_VERIFIED`: the ownership record was not found within seven days, and the domain failed. `DNS_NOT_POINTED`: the routing record does not point at Cubecen yet; after seven days the domain fails. `CERTIFICATE_PENDING`: the certificate is not issued yet, for example because a CAA record does not allow its issuer. `PROVIDER_REFUSED`: the hostname was refused or blocked, and the domain failed. `ROUTING_REFUSED`: Cubecen cannot route the hostname yet, or at all, and then the domain failed. `ROUTING_PENDING`: the hostname is served and is being routed to the cube, within a minute, or with the cube's next successful deployment when it has none yet. `DOMAIN_TAKEN`: another cube proved the hostname first, and the domain failed.",
            "enum": [
              "DNS_NOT_VERIFIED",
              "DNS_NOT_POINTED",
              "CERTIFICATE_PENDING",
              "PROVIDER_REFUSED",
              "ROUTING_REFUSED",
              "ROUTING_PENDING",
              "DOMAIN_TAKEN"
            ]
          },
          "message": {
            "type": "string",
            "description": "What went wrong, in words you can show."
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "DomainList": {
        "type": "object",
        "description": "The custom domains of a cube, oldest first.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The domains.",
            "items": {
              "$ref": "#/components/schemas/Domain"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "DomainReconnect": {
        "type": "object",
        "description": "The domain uses an older connection. Reconnect it with `reconnectDomain`, then point its DNS record at the new `value` of its routing record.",
        "properties": {
          "by": {
            "description": "When the older connection stops serving the domain. `null` until a date is set.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "description": "When a reconnect was asked for. `null` before.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "by",
          "started_at"
        ]
      },
      "Env": {
        "type": "object",
        "description": "The variables and secrets of a cube at its current version, sorted by key. The `live_` fields and `build_keys_behind` say whether the running cube already has these values.",
        "properties": {
          "env_version": {
            "description": "The current version, as 7 lowercase hexadecimal characters that are unique within the cube. `null` before the first change.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "live_env_version": {
            "description": "The version that the live deployment runs with. `null` when nothing is live, or when the live deployment is older than the environment feature.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "live_build_env_version": {
            "description": "The version that the live deployment's build was made with. `null` in the same cases as `live_env_version`.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "live_env_behind": {
            "type": "boolean",
            "description": "`true` when the live deployment runs with other values than the current ones. `false` when nothing is live."
          },
          "live_build_env_behind": {
            "type": "boolean",
            "description": "`true` when a key marked `build` has another value than the live build was made with, which means `build_keys_behind` is not empty. Then a change needs a new build. `false` when nothing is live."
          },
          "build_keys_behind": {
            "type": "array",
            "description": "The keys whose change needs a new build, sorted: keys marked `build` now or when the live build was made, that were added, changed or removed since. Empty when nothing is live or when only unmarked keys changed.",
            "items": {
              "type": "string"
            }
          },
          "databases_behind": {
            "type": "array",
            "description": "The slugs of the databases that this cube refers to whose password was reset after the live deployment started. The cube cannot connect to them until it is deployed again. Empty when there is none.",
            "items": {
              "type": "string"
            }
          },
          "entries": {
            "type": "array",
            "description": "The variables and secrets, sorted by key.",
            "items": {
              "$ref": "#/components/schemas/EnvEntry"
            }
          },
          "platform": {
            "type": "array",
            "description": "The variables that Cubecen sets in every cube, sorted by key. They are read-only and not part of `entries`.",
            "items": {
              "$ref": "#/components/schemas/PlatformEnvEntry"
            }
          },
          "limits": {
            "$ref": "#/components/schemas/EnvLimits",
            "description": "What an environment can hold."
          }
        },
        "required": [
          "env_version",
          "live_env_version",
          "live_build_env_version",
          "live_env_behind",
          "live_build_env_behind",
          "build_keys_behind",
          "databases_behind",
          "entries",
          "platform",
          "limits"
        ]
      },
      "EnvChanges": {
        "type": "object",
        "description": "The keys that a version added, changed and removed. Never values.",
        "properties": {
          "added": {
            "type": "array",
            "description": "The keys that the version added, sorted.",
            "items": {
              "type": "string"
            }
          },
          "changed": {
            "type": "array",
            "description": "The keys whose type, value or marks the version changed, sorted.",
            "items": {
              "type": "string"
            }
          },
          "removed": {
            "type": "array",
            "description": "The keys that the version removed, sorted.",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "added",
          "changed",
          "removed"
        ]
      },
      "EnvDiff": {
        "type": "object",
        "description": "What going from one version to another adds, changes and removes: keys and types, never values.",
        "properties": {
          "from": {
            "description": "The version that the comparison starts from. `null` for the empty environment before the first version.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "to": {
            "type": "string",
            "description": "The version that the comparison goes to.",
            "pattern": "^[0-9a-f]{7}$"
          },
          "added": {
            "type": "array",
            "description": "The keys that the second version has and the first has not.",
            "items": {
              "$ref": "#/components/schemas/EnvKeyChange"
            }
          },
          "changed": {
            "type": "array",
            "description": "The keys whose value, type or marks differ.",
            "items": {
              "$ref": "#/components/schemas/EnvKeyChange"
            }
          },
          "removed": {
            "type": "array",
            "description": "The keys that the first version has and the second has not.",
            "items": {
              "$ref": "#/components/schemas/EnvKeyChange"
            }
          }
        },
        "required": [
          "from",
          "to",
          "added",
          "changed",
          "removed"
        ]
      },
      "EnvEntry": {
        "type": "object",
        "description": "A variable or a secret.",
        "properties": {
          "key": {
            "type": "string",
            "description": "The name of the variable or secret.",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
            "maxLength": 128
          },
          "type": {
            "type": "string",
            "description": "`variable`, whose value is shown, or `secret`, whose value is never shown.",
            "enum": [
              "variable",
              "secret"
            ]
          },
          "value": {
            "description": "The value of a variable. Always `null` for a secret.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "previews": {
            "type": "boolean",
            "description": "Whether pull request previews get this entry. `true` for a variable, except one that refers to a database: previews never get it. For a secret, only once it is marked so."
          },
          "build": {
            "type": "boolean",
            "description": "Whether the build reads this key. A change to a key that is marked needs a new build, and a change to the others needs only a redeploy. A new key starts without the mark."
          },
          "updated_by": {
            "$ref": "#/components/schemas/UserRef",
            "description": "The user who last changed the entry."
          },
          "updated_at": {
            "type": "string",
            "description": "When the entry was last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "key",
          "type",
          "value",
          "previews",
          "build",
          "updated_by",
          "updated_at"
        ]
      },
      "EnvKeyChange": {
        "type": "object",
        "description": "One key of a comparison.",
        "properties": {
          "key": {
            "type": "string",
            "description": "The key."
          },
          "type": {
            "type": "string",
            "description": "`variable` or `secret`: the key's type in the version that the comparison goes to, or in the first version for a removed key.",
            "enum": [
              "variable",
              "secret"
            ]
          },
          "from_type": {
            "type": "string",
            "description": "For a changed key, the type it had in the first version.",
            "enum": [
              "variable",
              "secret"
            ]
          }
        },
        "required": [
          "key",
          "type"
        ]
      },
      "EnvLimits": {
        "type": "object",
        "description": "What an environment can hold.",
        "properties": {
          "max_entries": {
            "type": "integer",
            "description": "The most entries, variables and secrets together."
          },
          "max_key_length": {
            "type": "integer",
            "description": "The longest key, in characters."
          },
          "max_value_bytes": {
            "type": "integer",
            "description": "The largest value, in bytes."
          },
          "max_total_bytes": {
            "type": "integer",
            "description": "The largest size of all keys and values together, in bytes."
          }
        },
        "required": [
          "max_entries",
          "max_key_length",
          "max_value_bytes",
          "max_total_bytes"
        ]
      },
      "EnvPatch": {
        "type": "object",
        "description": "One atomic change to the variables and secrets, with at least one entry in `set` or `delete`. Send only these fields: a request with another field is refused with `400`.",
        "properties": {
          "expected_version": {
            "description": "The `env_version` that the change is based on, as `getEnvironment` gave it. `null` for the first change. A stale value is refused with `409` `ENV_CHANGED`.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "set": {
            "type": "array",
            "description": "The entries to add or replace.",
            "items": {
              "$ref": "#/components/schemas/EnvSetEntry"
            }
          },
          "delete": {
            "type": "array",
            "description": "The keys to remove.",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "expected_version"
        ]
      },
      "EnvRestore": {
        "type": "object",
        "description": "Which version to bring back. Send only these fields: a request with another field is refused with `400`.",
        "properties": {
          "version": {
            "type": "string",
            "description": "The version to bring back: an `env_version` of this cube.",
            "pattern": "^[0-9a-f]{7}$"
          },
          "expected_version": {
            "description": "The current version, as `getEnvironment` shows it. `null` before the first version. A stale value is refused with `409` `ENV_CHANGED`.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "version",
          "expected_version"
        ]
      },
      "EnvSetEntry": {
        "type": "object",
        "description": "An entry to add or replace.",
        "properties": {
          "key": {
            "type": "string",
            "description": "The name: 1 to 128 letters, digits and `_`, not starting with a digit. Names that Cubecen sets are refused.",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
            "minLength": 1,
            "maxLength": 128
          },
          "type": {
            "type": "string",
            "description": "`variable` or `secret`.",
            "enum": [
              "variable",
              "secret"
            ]
          },
          "value": {
            "type": "string",
            "description": "The value, up to 64 KiB. It is required: it can be empty or span several lines, and cannot contain a NUL character. Only to change the marks of an entry that exists, leave it out and keep its `type`.",
            "maxLength": 65536
          },
          "previews": {
            "type": "boolean",
            "description": "For a secret: whether pull request previews get it. Left out, a secret keeps its mark, and a new secret starts without one. `false` on a variable is refused: a variable always goes to previews."
          },
          "build": {
            "type": "boolean",
            "description": "Whether the build reads the key. Left out, a key keeps its mark, even when its type changes, and a new key starts without one."
          }
        },
        "required": [
          "key",
          "type"
        ]
      },
      "EnvVersion": {
        "type": "object",
        "description": "One version in the history of the variables: who made it, when, and which keys it changed.",
        "properties": {
          "version": {
            "type": "string",
            "description": "The version's ID, as 7 lowercase hexadecimal characters.",
            "pattern": "^[0-9a-f]{7}$"
          },
          "kind": {
            "type": "string",
            "description": "`change` for a write, or `restore` for the values of an older version made current again.",
            "enum": [
              "change",
              "restore"
            ]
          },
          "restored_from": {
            "description": "The version that a restore brought back. `null` for a change.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "deployment_id": {
            "description": "The ID of the rollback that restored the version. `null` for a change, for a restore made on its own, and while that deployment was not created.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "changes": {
            "$ref": "#/components/schemas/EnvChanges",
            "description": "The keys that this version added, changed and removed, compared with the version before it."
          },
          "created_by": {
            "$ref": "#/components/schemas/UserRef",
            "description": "The user who made the version. For a version made with an API key, the key's owner. For one made through an AI client, the person it acts for."
          },
          "api_key": {
            "description": "The API key that made the version, for a write, a restore, or the restore of a rollback. `null` for every other version. A revoked key keeps its name here.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The key's ID.",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "description": "The key's name, as it was given. Everyone who can read the history sees it, so a name is no place for a secret."
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_client": {
            "description": "The AI client that made the version for the person, through Cubecen's MCP server, such as `claude.ai`. `null` for every other version.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the version was made.",
            "format": "date-time"
          },
          "restorable": {
            "type": "boolean",
            "description": "`false` once the version's values are no longer kept: only the newest 100 versions keep them."
          }
        },
        "required": [
          "version",
          "kind",
          "restored_from",
          "deployment_id",
          "changes",
          "created_by",
          "api_key",
          "mcp_client",
          "created_at",
          "restorable"
        ]
      },
      "EnvVersionList": {
        "type": "object",
        "description": "One page of the history of the variables, newest first. The first item of the first page is the current version.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The versions on this page.",
            "items": {
              "$ref": "#/components/schemas/EnvVersion"
            }
          },
          "next_cursor": {
            "description": "Send it as `cursor` to get the next page. `null` on the last page.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "Error": {
        "type": "object",
        "description": "The body of every error answer.",
        "properties": {
          "error": {
            "type": "object",
            "description": "The error.",
            "properties": {
              "code": {
                "type": "string",
                "description": "A stable code. Handle errors by `code`, not by `message`. The codes the documentation names are not the only ones: a new code can appear, so handle an unknown code by its HTTP status. A 5xx answer is a failure on our side or of a service we rely on: retry with backoff."
              },
              "message": {
                "type": "string",
                "description": "What went wrong, in words. Safe to show for a 4xx answer. For a 5xx answer, show a general message of your own instead."
              },
              "requestId": {
                "type": "string",
                "description": "The ID of the request. Give it to support when you ask about an answer."
              },
              "field": {
                "type": "string",
                "description": "The request field a validation error is about, such as `revision`. Present on some 4xx answers."
              },
              "cubes": {
                "type": "array",
                "description": "Only with `DATABASE_REFERENCED`: the slugs of the cubes whose variables refer to the database.",
                "items": {
                  "type": "string"
                }
              },
              "limit": {
                "type": "string",
                "description": "Only with `PLAN_LIMIT_REACHED`: the plan limit that refused the request. One of `cubes`, `previews`, `build_minutes`, `bandwidth_gb`, `free_organizations`, `size` or `databases`.",
                "enum": [
                  "cubes",
                  "previews",
                  "build_minutes",
                  "bandwidth_gb",
                  "free_organizations",
                  "size",
                  "databases"
                ]
              },
              "max": {
                "type": "integer",
                "description": "Only with `PLAN_LIMIT_REACHED`: what the plan allows, in the unit of `limit`: a count, minutes, gigabytes (`bandwidth_gb`) or MiB of memory per cube (`size`)."
              },
              "used": {
                "type": "integer",
                "description": "Only with `PLAN_LIMIT_REACHED`: what the organization has used, in the unit of `limit`. For `size`, it is the memory of the size you asked for."
              },
              "plan": {
                "type": "string",
                "description": "Only with `PLAN_LIMIT_REACHED`: the ID of the organization's plan: `free`, `launch`, `scale` or `enterprise`.",
                "enum": [
                  "free",
                  "launch",
                  "scale",
                  "enterprise"
                ]
              }
            },
            "required": [
              "code",
              "message",
              "requestId"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "ErrorInfo": {
        "type": "object",
        "description": "Why a build or a deployment failed, why a build could not start, or why a preview waits or failed.",
        "properties": {
          "code": {
            "type": "string",
            "description": "A short code for the failure, such as `BUILD_NOT_DETECTED`, which means there is no Dockerfile and the builder could not tell how to build the cube. Others include `WORKFLOW_EXECUTION_FAILED`, a build step that failed, such as a compile error: the message names the step. When a build could not start, it is the code of the error that stopped it, such as `REVISION_NOT_FOUND`. New codes may appear."
          },
          "message": {
            "type": "string",
            "description": "What went wrong, in words you can show."
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "GitHubInstallation": {
        "type": "object",
        "description": "A GitHub installation connected to the organization: the Cubecen GitHub App, installed on a GitHub account.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The connection's ID. Paths and parameters that name an installation take this one, not `installation_id`.",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "description": "The ID of the organization the installation is connected to.",
            "format": "uuid"
          },
          "installation_id": {
            "type": "integer",
            "description": "The installation's number on GitHub."
          },
          "account_id": {
            "type": "integer",
            "description": "The ID of the GitHub account that the App is installed on."
          },
          "account_login": {
            "type": "string",
            "description": "The login of that GitHub account."
          },
          "account_type": {
            "type": "string",
            "description": "`User` for a person's account, `Organization` for a GitHub organization.",
            "enum": [
              "User",
              "Organization"
            ]
          },
          "connected_by": {
            "type": "string",
            "description": "The ID of the user who connected the installation, or who last refreshed it. The repositories of the connection are those that this person can reach on GitHub.",
            "format": "uuid"
          },
          "verified_at": {
            "type": "string",
            "description": "When the connection was made, or last refreshed.",
            "format": "date-time"
          },
          "repositories_synced_at": {
            "description": "When the list of repositories was last taken from GitHub. `null` for a connection made before repository lists existed: it can use every repository of the installation until it is refreshed.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "repository_selection": {
            "type": "string",
            "description": "`all` when the organization can use every repository in the connection's list, including those that a refresh adds. `selected` when it can use only the repositories that an owner picked.",
            "enum": [
              "all",
              "selected"
            ]
          },
          "repository_count": {
            "description": "How many repositories the organization can use through the connection. `null` when the connection has no list.",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the connection was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When the connection was last changed.",
            "format": "date-time"
          },
          "approval_pending": {
            "type": "boolean",
            "description": "`true` when the GitHub account has not approved every permission that the App asks for now."
          },
          "approve_url": {
            "description": "The page on github.com where an owner of the account reviews and approves the permissions. `null` while nothing is waiting for approval.",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "access": {
            "type": "string",
            "description": "Whether the person in `connected_by` can still use the connection. `verified`: their access was recorded and still holds. `unverified`: it was connected before their GitHub account was recorded, so only their membership of the organization is checked. `lost`: they can no longer use it, and it allows no repository. It is checked about every hour.",
            "enum": [
              "verified",
              "unverified",
              "lost"
            ]
          },
          "access_lost_reason": {
            "description": "Why the access was lost, when `access` is `lost`: `left_organization` (the person left the organization) or `github_access` (they lost the access that the connection rests on, on GitHub). `null` otherwise.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "github_access",
                  "left_organization"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "access_checked_at": {
            "description": "When the access was last checked. `null` before the first check.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "organization_id",
          "installation_id",
          "account_id",
          "account_login",
          "account_type",
          "connected_by",
          "verified_at",
          "repositories_synced_at",
          "repository_selection",
          "repository_count",
          "created_at",
          "updated_at",
          "approval_pending",
          "approve_url",
          "access",
          "access_lost_reason",
          "access_checked_at"
        ]
      },
      "GitHubInstallationList": {
        "type": "object",
        "description": "The GitHub installations connected to an organization.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The installations, the oldest connection first.",
            "items": {
              "$ref": "#/components/schemas/GitHubInstallation"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "GitHubRepository": {
        "type": "object",
        "description": "A repository of a GitHub account.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The repository's ID on GitHub."
          },
          "owner": {
            "type": "string",
            "description": "The GitHub account that owns the repository."
          },
          "name": {
            "type": "string",
            "description": "The repository's name."
          },
          "full_name": {
            "type": "string",
            "description": "The repository's name with its owner, as `owner/name`."
          },
          "private": {
            "type": "boolean",
            "description": "`true` for a private repository."
          },
          "default_branch": {
            "type": "string",
            "description": "The repository's default branch."
          },
          "archived": {
            "type": "boolean",
            "description": "`true` when the repository is archived on GitHub."
          }
        },
        "required": [
          "id",
          "owner",
          "name",
          "full_name",
          "private",
          "default_branch",
          "archived"
        ]
      },
      "GitHubRepositoryPage": {
        "type": "object",
        "description": "A page of the repositories of an installation.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The repositories on this page.",
            "items": {
              "$ref": "#/components/schemas/GitHubRepository"
            }
          },
          "total_count": {
            "type": "integer",
            "description": "How many repositories the whole list holds."
          },
          "next_page": {
            "description": "The number of the next page. `null` on the last page.",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "total_count",
          "next_page"
        ]
      },
      "LastRelease": {
        "type": "object",
        "description": "The newest build of a cube, and where its release is.",
        "properties": {
          "build_id": {
            "type": "string",
            "description": "The ID of the build."
          },
          "release_status": {
            "type": "string",
            "description": "Where the release is, counting the deployment that follows the build. The values are those of a build's `release_status`: `QUEUED`, `BUILDING`, `BUILT`, `DEPLOYING`, `DEPLOYED`, `BUILD_FAILED`, `DEPLOY_FAILED`, `CANCELLED`, `SUPERSEDED` and `UNKNOWN`.",
            "enum": [
              "QUEUED",
              "BUILDING",
              "BUILD_FAILED",
              "CANCELLED",
              "BUILT",
              "DEPLOYING",
              "SUPERSEDED",
              "DEPLOY_FAILED",
              "DEPLOYED",
              "UNKNOWN"
            ]
          },
          "terminal": {
            "type": "boolean",
            "description": "`false` while the release is still moving. `true` once `release_status` is final."
          },
          "revision": {
            "type": "string",
            "description": "What the build was asked to build, as a label: a branch, a tag or a commit SHA."
          },
          "commit_sha": {
            "type": "string",
            "description": "The exact commit that was built, as 40 hexadecimal characters."
          },
          "created_by": {
            "description": "The ID of the user who started the build. For a build started with an API key, the key's owner. `null` for a build that a push started.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "trigger": {
            "description": "What started the build: `dashboard` (a person, in the dashboard), `push` (a push to the branch the cube deploys from), `api` (an API key) or `mcp` (an AI agent signed in as a person through Cubecen's MCP server). `null` for a build with no recorded origin.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "dashboard",
                  "push",
                  "api",
                  "mcp"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "pushed_by": {
            "description": "The GitHub login that pushed, when `trigger` is `push`. `null` otherwise.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "api_key": {
            "description": "Always `null` here, even when `trigger` is `api`. Read the build with `getBuild` to see the key.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The key's ID.",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "description": "The key's name."
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_client": {
            "description": "Always `null` here, even when `trigger` is `mcp`. Read the build with `getBuild` to see the client.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the build was created.",
            "format": "date-time"
          },
          "finished_at": {
            "type": "string",
            "description": "When the release finished. Absent until then.",
            "format": "date-time"
          }
        },
        "required": [
          "build_id",
          "release_status",
          "terminal",
          "revision",
          "commit_sha",
          "created_by",
          "trigger",
          "pushed_by",
          "api_key",
          "mcp_client",
          "created_at"
        ]
      },
      "LiveDeploymentRef": {
        "type": "object",
        "description": "The deployment that serves a cube now.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The deployment's ID."
          },
          "build_id": {
            "type": "string",
            "description": "The ID of the build that the deployment runs."
          },
          "status": {
            "type": "string",
            "description": "The deployment's status. It is `SUCCEEDED` for a deployment that serves a cube."
          },
          "finished_at": {
            "type": "string",
            "description": "When the deployment finished.",
            "format": "date-time"
          },
          "env_version": {
            "description": "The version of the variables the deployment runs with: 7 lowercase hexadecimal characters. `null` for a deployment made before environment versions, and for one with no variables.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "build_env_version": {
            "description": "The version of the variables the deployment's build was built with. `null` for a build made before environment versions, and for one with no variables.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "build_id",
          "status",
          "env_version",
          "build_env_version"
        ]
      },
      "LogStream": {
        "type": "string",
        "description": "The body is a stream of Server-Sent Events: text that arrives line by line while the connection is open. Send the API key in the `Authorization` header. A browser's EventSource cannot send a header, so in a browser read the stream with `fetch`. Events are separated by a blank line. Each has an optional `id`, an `event` name and `data`, which is JSON.\n\n- `log` is one line. Its `id` is its position in the stream. Its `data` is `{time, source, step, pod, reason, event_type, object, line, truncated}`, and the fields that do not apply are absent. `time` is the time of the line. `source` is `build`, `deploy`, `runtime` (what the cube prints) or `event` (a pod event). `step` is set for build and deploy lines: `fetch`, `setup`, `plan` and `build` for builds, `apply` and `rollout` for deployments. `pod` is the replica that printed a runtime line: a new name is a new replica. `reason`, `event_type` and `object` describe a pod event, such as `BackOff` or `Pulling`. `line` is the text. `truncated` is `true` when the line was cut because it was too long.\n- `end` says that the stream is over. Its `data` is `{complete, cursor}`. `complete: true` means that every line was sent: close the connection. `complete: false` means that more may follow: open the stream again with `cursor`. A stream without `follow` stops after 5000 lines with `complete: false`.\n- `unavailable` says that the logs broke off. Its `data` is `{code, message, cursor}`, and `code` is `LOGS_UNAVAILABLE`. Open the stream again after a few seconds, with `cursor`.\n\nLines that start with a colon, such as `: ping` and `: heartbeat`, are signs of life that arrive at least every 10 seconds: ignore them. The stream starts with `retry: 3000`, the milliseconds that EventSource waits before it reconnects. Above about 200 lines a second from a running cube (1000 for a build or a deployment), lines are dropped without a mark. A stream opened with `follow=true` is also ended by the API after about ten minutes, without an `end` event: open it again with the `id` of the last event as `cursor`.\n\n`line` is untrusted text. Show it as text, never as HTML. It can hold ANSI color codes. If the request itself is refused, the answer is an ordinary JSON error and no stream starts.\n"
      },
      "MetricPoint": {
        "type": "array",
        "description": "A point of a series: `[unix seconds, value]`. A missing point is a gap: draw it as a gap, not as zero.",
        "items": {
          "type": "number"
        },
        "minItems": 2,
        "maxItems": 2
      },
      "Metrics": {
        "type": "object",
        "description": "The resource use, traffic and health of a cube over a window. Every series is a list of `[unix seconds, value]` points, oldest first.",
        "properties": {
          "from": {
            "type": "string",
            "description": "The start of the window, rounded down to a multiple of `step`.",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "description": "The end of the window, rounded down to a multiple of `step`.",
            "format": "date-time"
          },
          "step": {
            "type": "integer",
            "description": "The seconds between points.",
            "minimum": 30,
            "maximum": 86400
          },
          "cpu": {
            "$ref": "#/components/schemas/ResourceMetrics",
            "description": "The CPU in use, in cores."
          },
          "memory": {
            "$ref": "#/components/schemas/ResourceMetrics",
            "description": "The memory in use, in bytes."
          },
          "network": {
            "type": "object",
            "description": "The network traffic of all replicas together.",
            "properties": {
              "unit": {
                "type": "string",
                "description": "The unit of the points: `bytes/s`."
              },
              "receive": {
                "type": "array",
                "description": "The bytes per second received.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "transmit": {
                "type": "array",
                "description": "The bytes per second sent.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              }
            },
            "required": [
              "unit",
              "receive",
              "transmit"
            ]
          },
          "requests": {
            "type": "object",
            "description": "The requests per second that reach the cube, in total and by status class.",
            "properties": {
              "unit": {
                "type": "string",
                "description": "The unit of the points: `requests/s`."
              },
              "total": {
                "type": "array",
                "description": "All requests.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "1xx": {
                "type": "array",
                "description": "Requests answered with a 1xx status.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "2xx": {
                "type": "array",
                "description": "Requests answered with a 2xx status.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "3xx": {
                "type": "array",
                "description": "Requests answered with a 3xx status.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "4xx": {
                "type": "array",
                "description": "Requests answered with a 4xx status.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "5xx": {
                "type": "array",
                "description": "Requests answered with a 5xx status.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              }
            },
            "required": [
              "unit",
              "total",
              "1xx",
              "2xx",
              "3xx",
              "4xx",
              "5xx"
            ]
          },
          "error_rate": {
            "type": "object",
            "description": "The share of requests that were answered with a 5xx status. There is a gap where there were no requests.",
            "properties": {
              "unit": {
                "type": "string",
                "description": "The unit of the points: `ratio`, from 0 to 1."
              },
              "points": {
                "type": "array",
                "description": "The share of failed requests in each step.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              }
            },
            "required": [
              "unit",
              "points"
            ]
          },
          "latency": {
            "type": "object",
            "description": "How long requests took, measured where they enter Cubecen, so it adds a short hop to the cube's own response time. Values are estimates from buckets of 5 ms to 10 s, and anything above 10 s shows as 10 s.",
            "properties": {
              "unit": {
                "type": "string",
                "description": "The unit of the points: `seconds`."
              },
              "p50": {
                "type": "array",
                "description": "The median time of a request.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "p95": {
                "type": "array",
                "description": "The time that 95 percent of requests stayed within.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "p99": {
                "type": "array",
                "description": "The time that 99 percent of requests stayed within.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              }
            },
            "required": [
              "unit",
              "p50",
              "p95",
              "p99"
            ]
          },
          "restarts": {
            "type": "object",
            "description": "The container restarts in each step. Their sum is the total.",
            "properties": {
              "unit": {
                "type": "string",
                "description": "The unit of the points: `count`."
              },
              "points": {
                "type": "array",
                "description": "The restarts in each step.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              }
            },
            "required": [
              "unit",
              "points"
            ]
          },
          "replicas": {
            "type": "object",
            "description": "The replicas of the cube.",
            "properties": {
              "unit": {
                "type": "string",
                "description": "The unit of the points: `count`."
              },
              "ready": {
                "type": "array",
                "description": "The replicas that are ready.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              },
              "desired": {
                "type": "array",
                "description": "The replicas that the cube is meant to have.",
                "items": {
                  "$ref": "#/components/schemas/MetricPoint"
                }
              }
            },
            "required": [
              "unit",
              "ready",
              "desired"
            ]
          }
        },
        "required": [
          "from",
          "to",
          "step",
          "cpu",
          "memory",
          "network",
          "requests",
          "error_rate",
          "latency",
          "restarts",
          "replicas"
        ]
      },
      "Organization": {
        "type": "object",
        "description": "An organization.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The organization's ID.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The organization's name."
          },
          "slug": {
            "type": "string",
            "description": "A short, unique name for the organization. Paths accept it in place of the ID."
          },
          "status": {
            "type": "string",
            "description": "The organization's state. It is always `active`: an organization that was deleted cannot be read.",
            "enum": [
              "active"
            ]
          },
          "default_project_id": {
            "description": "The ID of the organization's default project: the one that new cubes are put in by default. `null` when the organization has none, for example after its default project was deleted.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the organization was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When the organization was last changed.",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "default_project_id",
          "created_at",
          "updated_at"
        ]
      },
      "OrganizationPage": {
        "type": "object",
        "description": "A page of organizations.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The organizations on this page.",
            "items": {
              "$ref": "#/components/schemas/Organization"
            }
          },
          "after": {
            "description": "Send it as `after` to get the next page. `null` on the last page. Always `null` for a key, which lists one organization.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "after"
        ]
      },
      "OrganizationPlan": {
        "type": "object",
        "description": "An organization's plan, what the plan allows, and what the organization has used.",
        "properties": {
          "plan": {
            "type": "object",
            "description": "The plan the organization is on.",
            "properties": {
              "id": {
                "type": "string",
                "description": "The plan's ID: `free`, `launch`, `scale` or `enterprise`.",
                "enum": [
                  "free",
                  "launch",
                  "scale",
                  "enterprise"
                ]
              },
              "name": {
                "type": "string",
                "description": "The plan's name, such as `Free`."
              },
              "overage": {
                "type": "boolean",
                "description": "`true` when the organization can go on past the build minutes and bandwidth that the plan includes. `false` when it cannot: builds stop once the period's build minutes are used up, and the cubes are paused once its bandwidth is used up."
              },
              "trial": {
                "type": "boolean",
                "description": "`true` while the plan is on a trial. During a trial the included amounts are firm limits, as when `overage` is `false`."
              },
              "period_start": {
                "type": "string",
                "description": "When the current period starts. Build minutes and bandwidth are counted per period: a calendar month in UTC, or the billing period on a paid plan.",
                "format": "date-time"
              },
              "period_end": {
                "type": "string",
                "description": "When the current period ends. The next period starts then.",
                "format": "date-time"
              }
            },
            "required": [
              "id",
              "name",
              "overage",
              "trial",
              "period_start",
              "period_end"
            ]
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimits",
            "description": "What the plan allows."
          },
          "usage": {
            "type": "object",
            "description": "What the organization has used.",
            "properties": {
              "cubes": {
                "type": "integer",
                "description": "How many cubes the organization has."
              },
              "previews": {
                "type": "integer",
                "description": "How many previews are open."
              },
              "build_minutes": {
                "description": "The build minutes used in the current period, counting a started minute as a whole one. `null` when it is not available.",
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "bandwidth_bytes": {
                "description": "The bytes of responses served in the current period. `null` when it is not available.",
                "anyOf": [
                  {
                    "type": "integer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "as_of": {
                "type": "string",
                "description": "When this answer was made.",
                "format": "date-time"
              },
              "databases": {
                "type": "integer",
                "description": "How many databases the organization has. One that is being deleted counts until its deletion ends."
              }
            },
            "required": [
              "cubes",
              "previews",
              "build_minutes",
              "bandwidth_bytes",
              "as_of",
              "databases"
            ]
          },
          "over_limit": {
            "type": "array",
            "description": "The limits that the organization has passed: `cubes`, `previews`, `build_minutes` or `bandwidth_gb`. For `cubes` and `previews` it has more than the plan allows: what runs keeps running, and no more can be made. For `build_minutes` and `bandwidth_gb` the period's amount is used up: see `plan.overage` for what that means. `databases`: it has more databases than the plan allows, after a change of plan; they keep running, and no more can be made. Empty when there is none.",
            "items": {
              "type": "string",
              "enum": [
                "cubes",
                "previews",
                "build_minutes",
                "bandwidth_gb",
                "databases"
              ]
            }
          },
          "sizes": {
            "type": "array",
            "description": "The sizes that a cube can have, smallest first. A plan allows the sizes up to `limits.size`.",
            "items": {
              "$ref": "#/components/schemas/SizeClass"
            }
          },
          "near_limit": {
            "type": "array",
            "description": "The limits that are at least 80 percent used but not yet used up: `build_minutes` or `bandwidth_gb`. Empty when there is none.",
            "items": {
              "type": "string",
              "enum": [
                "build_minutes",
                "bandwidth_gb"
              ]
            }
          },
          "suspension": {
            "description": "Why the organization's cubes are paused, while they are. `null` when they are not.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "description": "Why the cubes are paused. `bandwidth_limit` means the period's bandwidth is used up. Other values can appear.",
                    "enum": [
                      "bandwidth_limit",
                      "payment",
                      "admin"
                    ]
                  },
                  "since": {
                    "type": "string",
                    "description": "When the cubes were paused.",
                    "format": "date-time"
                  },
                  "until": {
                    "type": "string",
                    "description": "When the pause ends at the latest: the end of the period, unless a plan with more bandwidth comes first.",
                    "format": "date-time"
                  }
                },
                "required": [
                  "reason",
                  "since",
                  "until"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "plan",
          "limits",
          "sizes",
          "usage",
          "over_limit",
          "near_limit",
          "suspension"
        ]
      },
      "OrganizationRepository": {
        "type": "object",
        "description": "A repository that the organization can use, and the installation it comes through.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The repository's ID on GitHub."
          },
          "owner": {
            "type": "string",
            "description": "The GitHub account that owns the repository."
          },
          "name": {
            "type": "string",
            "description": "The repository's name."
          },
          "full_name": {
            "type": "string",
            "description": "The repository's name with its owner, as `owner/name`."
          },
          "private": {
            "type": "boolean",
            "description": "`true` for a private repository."
          },
          "default_branch": {
            "type": "string",
            "description": "The repository's default branch."
          },
          "archived": {
            "type": "boolean",
            "description": "`true` when the repository is archived on GitHub."
          },
          "installation_id": {
            "type": "string",
            "description": "The `id` of the installation the repository comes through, as `listGitHubInstallations` gives it. It is not GitHub's own number.",
            "format": "uuid"
          },
          "account_login": {
            "type": "string",
            "description": "The login of the GitHub account that the installation is on."
          }
        },
        "required": [
          "id",
          "owner",
          "name",
          "full_name",
          "private",
          "default_branch",
          "archived",
          "installation_id",
          "account_login"
        ]
      },
      "OrganizationRepositoryPage": {
        "type": "object",
        "description": "A page of the repositories that an organization can use.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The repositories on this page.",
            "items": {
              "$ref": "#/components/schemas/OrganizationRepository"
            }
          },
          "next_cursor": {
            "description": "Send it as `cursor` to get the next page. `null` on the last page.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ]
      },
      "OrganizationSummary": {
        "type": "object",
        "description": "Counts for an organization.",
        "properties": {
          "projects": {
            "type": "integer",
            "description": "How many projects the organization has."
          },
          "applications": {
            "type": "object",
            "description": "How many cubes the organization has, by state.",
            "properties": {
              "total": {
                "type": "integer",
                "description": "How many cubes still exist."
              },
              "active": {
                "type": "integer",
                "description": "How many cubes are ready."
              },
              "creating": {
                "type": "integer",
                "description": "How many cubes are still being set up."
              },
              "failed": {
                "type": "integer",
                "description": "How many cubes could not be set up."
              },
              "live": {
                "type": "integer",
                "description": "How many cubes have a deployment serving traffic."
              }
            },
            "required": [
              "total",
              "active",
              "creating",
              "failed",
              "live"
            ]
          },
          "releases_in_progress": {
            "type": "integer",
            "description": "How many cubes have a build or a deployment running now."
          },
          "github_installations": {
            "type": "integer",
            "description": "How many GitHub installations are connected."
          },
          "members": {
            "description": "How many members the organization has. Always `null` for an API key, which cannot see the people of an organization.",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "pending_invitations": {
            "description": "How many invitations are waiting to be accepted. Always `null` for an API key.",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "projects",
          "applications",
          "releases_in_progress",
          "github_installations",
          "members",
          "pending_invitations"
        ]
      },
      "OrganizationUsage": {
        "type": "object",
        "description": "What an organization used over a range of UTC days.",
        "properties": {
          "from": {
            "type": "string",
            "description": "The first day counted.",
            "format": "date"
          },
          "to": {
            "type": "string",
            "description": "The day the range stops at. This day is not counted.",
            "format": "date"
          },
          "as_of": {
            "description": "When the usage was last collected. `null` before the first collection.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "totals": {
            "$ref": "#/components/schemas/UsageAmounts",
            "description": "The use of the whole range."
          },
          "instance_hours_by_size": {
            "type": "object",
            "description": "The instance hours of `totals`, split by the size of the cubes.",
            "properties": {
              "small": {
                "type": "number",
                "description": "Instance hours of cubes of size `small`."
              },
              "medium": {
                "type": "number",
                "description": "Instance hours of cubes of size `medium`."
              },
              "large": {
                "type": "number",
                "description": "Instance hours of cubes of size `large`."
              },
              "xlarge": {
                "type": "number",
                "description": "Instance hours of cubes of size `xlarge`."
              }
            },
            "required": [
              "small",
              "medium",
              "large",
              "xlarge"
            ]
          },
          "days": {
            "type": "array",
            "description": "The use of each UTC day that has any, oldest first. A day without use is left out.",
            "items": {
              "$ref": "#/components/schemas/UsageDay"
            }
          },
          "cubes": {
            "type": "array",
            "description": "The use of each cube in the range, by name. A cube that was deleted is listed while it has use in the range.",
            "items": {
              "$ref": "#/components/schemas/UsageCube"
            }
          },
          "databases": {
            "description": "The use of each database in the range. A database that was deleted is listed while it has use in the range.",
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "database_id": {
                      "type": "string",
                      "description": "The database's ID.",
                      "format": "uuid"
                    },
                    "project_id": {
                      "type": "string",
                      "description": "The ID of the project the database is in.",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "description": "The database's name."
                    },
                    "slug": {
                      "type": "string",
                      "description": "The database's slug."
                    },
                    "deleted": {
                      "type": "boolean",
                      "description": "`true` when the database was deleted."
                    },
                    "compute_hours": {
                      "type": "number",
                      "description": "The compute it used, in compute-unit hours."
                    },
                    "storage_gb_month": {
                      "type": "number",
                      "description": "The storage it held over time, in GB-months: 1 GB held for a whole month is 1."
                    },
                    "transfer_bytes": {
                      "type": "integer",
                      "description": "The bytes of data it transferred."
                    }
                  },
                  "required": [
                    "database_id",
                    "project_id",
                    "name",
                    "slug",
                    "deleted",
                    "compute_hours",
                    "storage_gb_month",
                    "transfer_bytes"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "from",
          "to",
          "as_of",
          "totals",
          "instance_hours_by_size",
          "days",
          "cubes"
        ]
      },
      "PlanLimits": {
        "type": "object",
        "description": "What a plan allows. A limit of `null` has no ceiling.",
        "properties": {
          "cubes": {
            "description": "The most cubes that the organization can have.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "memory_mib_per_cube": {
            "type": "integer",
            "description": "The most memory that a cube can have, in MiB."
          },
          "previews": {
            "description": "The most previews that can be open at once.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "build_minutes": {
            "description": "The build minutes that the plan includes in each period.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "bandwidth_gb": {
            "description": "The bandwidth that the plan includes in each period, in GB of 10^9 bytes.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "metrics_retention_days": {
            "type": "integer",
            "description": "How many days the metrics of a cube are kept."
          },
          "logs_retention_days": {
            "type": "integer",
            "description": "How many days the logs of a cube are kept."
          },
          "databases": {
            "type": "object",
            "description": "What the plan allows for databases. All zero on a plan without databases, such as Free.",
            "properties": {
              "count": {
                "type": "integer",
                "description": "The most databases that the organization can have.",
                "minimum": 0
              },
              "max_cu": {
                "type": "number",
                "description": "The most compute each database can scale up to, in compute units: 1 unit is 1 vCPU and 4 GiB of memory."
              },
              "storage_gb": {
                "type": "integer",
                "description": "The storage of each database, in GB of 10^9 bytes."
              },
              "compute_hours": {
                "type": "integer",
                "description": "The compute each database can use in a calendar month (UTC), in compute-unit hours."
              },
              "transfer_gb": {
                "type": "integer",
                "description": "The data transfer of each database in a calendar month, in GB."
              }
            },
            "required": [
              "count",
              "max_cu",
              "storage_gb",
              "compute_hours",
              "transfer_gb"
            ]
          },
          "size": {
            "type": "string",
            "description": "The largest size that a cube can have on this plan, for its memory: `small`, `medium`, `large` or `xlarge`.",
            "enum": [
              "small",
              "medium",
              "large",
              "xlarge"
            ]
          }
        },
        "required": [
          "cubes",
          "memory_mib_per_cube",
          "previews",
          "build_minutes",
          "bandwidth_gb",
          "metrics_retention_days",
          "logs_retention_days",
          "databases",
          "size"
        ]
      },
      "PlatformEnvEntry": {
        "type": "object",
        "description": "A variable that Cubecen sets in every cube. It is shown, and never written.",
        "properties": {
          "key": {
            "type": "string",
            "description": "The name of the variable: `CUBECEN_CUBE_NAME`, `CUBECEN_DEPLOYMENT_ID`, `CUBECEN_PROJECT`, `CUBECEN_REGION` or `CUBECEN_WORKSPACE`.",
            "enum": [
              "CUBECEN_CUBE_NAME",
              "CUBECEN_DEPLOYMENT_ID",
              "CUBECEN_PROJECT",
              "CUBECEN_REGION",
              "CUBECEN_WORKSPACE"
            ]
          },
          "value": {
            "description": "The value. `null` when there is none, as for `CUBECEN_DEPLOYMENT_ID` before a deployment is live and `CUBECEN_REGION` while no region is set.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_deploy": {
            "type": "boolean",
            "description": "`true` when the value is what the next deployment gets: the running cube has the value of its own deployment, so a rename shows from the next deployment. `false` for `CUBECEN_DEPLOYMENT_ID`, which is the live deployment's, and for `CUBECEN_REGION`."
          }
        },
        "required": [
          "key",
          "value",
          "next_deploy"
        ]
      },
      "Preview": {
        "type": "object",
        "description": "A pull request's preview: its head commit built and served at its own address. `error` is absent while there is nothing to explain. `close_reason` is absent while the preview is open and wanted.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The preview's ID.",
            "format": "uuid"
          },
          "pull_request": {
            "$ref": "#/components/schemas/PreviewPullRequest",
            "description": "The pull request that the preview builds."
          },
          "status": {
            "type": "string",
            "description": "`pending` was just seen and is being set up. `waiting` waits for a place or a build slot: `error.code` says which. `building` and `deploying`: the head is on its way. `ready` is served at `url`. `failed`: the build or the deployment failed, and `error` says why. A push or `redeployPreview` tries again. `closed` is gone: `close_reason` says why.",
            "enum": [
              "pending",
              "waiting",
              "building",
              "deploying",
              "ready",
              "failed",
              "closed"
            ]
          },
          "url": {
            "description": "Where the preview is served, once it has served, until it closes. Its last successful deployment keeps serving while a newer build is on its way or has failed. `null` before the first one, and once closed.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "release": {
            "description": "The preview's newest build and the deployment that follows it. `null` before the first build starts.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/PreviewRelease"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "$ref": "#/components/schemas/ErrorInfo",
            "description": "Why the preview waits or has failed. `code` is `PREVIEW_WAITING_FOR_SLOT` (the cube has `limits.max_open` previews open: it waits until one closes, or until a push to its pull request makes room), `PREVIEW_WAITING_FOR_CAPACITY` (Cubecen has no room for another preview now), `PREVIEW_WAITING_FOR_PLAN` (the organization has as many open previews as its plan allows, or its cubes are paused for the month's bandwidth), `PREVIEW_WAITING_FOR_BUILD` (previews build one at a time: it starts within minutes), `GITHUB_PERMISSIONS_MISSING` (the permissions of the Cubecen GitHub App were withdrawn on GitHub: it waits until they are approved again), `PREVIEW_NOT_STARTED` (its build could not be started for an hour: it failed, so push again or redeploy), `BUILD_CANCELLED` (its build was cancelled: it failed), `REPOSITORY_NOT_ACCESSIBLE` (the repository can no longer be reached through the organization's GitHub connection: it failed), or the code of a failed build or deployment, as for a build's `error`."
          },
          "close_reason": {
            "type": "string",
            "description": "Why the preview was closed, or is closing. `closed` and `merged`: its pull request was closed or merged, and it comes back if the pull request is reopened. `idle`: no push for `limits.idle_days` days. `evicted`: a more recently pushed pull request needed its place. `removed`: removed with `removePreview`. `capacity`: Cubecen needed the room. These four come back with the pull request's next push. `base_changed`: it no longer targets the tracked branch, and it comes back when it does again. `disabled`: previews were turned off, and they come back when previews are turned on. `deleted`: the cube was deleted. `not_eligible`: the pull request cannot have a preview.",
            "enum": [
              "closed",
              "merged",
              "idle",
              "disabled",
              "deleted",
              "base_changed",
              "evicted",
              "removed",
              "not_eligible",
              "capacity"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the preview was made.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When the preview last changed.",
            "format": "date-time"
          },
          "ready_at": {
            "description": "When the preview first served. `null` until then.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "closed_at": {
            "description": "When the preview was closed. `null` while it is open.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "expires_at": {
            "description": "When an open preview goes away if there is no new push. `null` once closed.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "description": "The size the preview runs at: `small`, `medium`, `large` or `xlarge`, as the `sizes` of `getOrganizationPlan` list them. It is set when the preview's cube is made: a change of plan or size does not resize an open preview, and a closed preview keeps the size it ran at. `null` until the cube is made, and for previews closed before sizes were shown.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "small",
                  "medium",
                  "large",
                  "xlarge"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "pull_request",
          "status",
          "url",
          "release",
          "created_at",
          "updated_at",
          "ready_at",
          "closed_at",
          "expires_at",
          "size"
        ]
      },
      "PreviewLimits": {
        "type": "object",
        "description": "The limits that apply to the previews of a cube.",
        "properties": {
          "max_open": {
            "type": "integer",
            "description": "The most previews a cube can have open at once."
          },
          "idle_days": {
            "type": "integer",
            "description": "The days without a push after which a preview is removed."
          }
        },
        "required": [
          "max_open",
          "idle_days"
        ]
      },
      "PreviewList": {
        "type": "object",
        "description": "The previews of a cube, open ones first, then those closed in the last seven days, the most recently updated first, at most 50.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The previews.",
            "items": {
              "$ref": "#/components/schemas/Preview"
            }
          },
          "limits": {
            "$ref": "#/components/schemas/PreviewLimits",
            "description": "The limits that apply to the previews of a cube."
          }
        },
        "required": [
          "data",
          "limits"
        ]
      },
      "PreviewPullRequest": {
        "type": "object",
        "description": "The pull request that a preview builds.",
        "properties": {
          "number": {
            "type": "integer",
            "description": "The pull request's number."
          },
          "title": {
            "type": "string",
            "description": "The pull request's title."
          },
          "author": {
            "type": "string",
            "description": "The GitHub login that opened it."
          },
          "url": {
            "type": "string",
            "description": "Its page on GitHub. Empty until Cubecen has read the pull request."
          },
          "head_ref": {
            "type": "string",
            "description": "The branch it comes from."
          },
          "base_ref": {
            "type": "string",
            "description": "The branch it targets: the cube's tracked branch."
          },
          "head_sha": {
            "description": "The newest head commit that Cubecen knows of. It is ahead of `release.commit_sha` while a new commit waits to be built. `null` until known.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{40}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "head_received_at": {
            "description": "When Cubecen learned of `head_sha`. `null` until known.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "draft": {
            "type": "boolean",
            "description": "`true` for a draft pull request. Drafts get previews too."
          }
        },
        "required": [
          "number",
          "title",
          "author",
          "url",
          "head_ref",
          "base_ref",
          "head_sha",
          "head_received_at",
          "draft"
        ]
      },
      "PreviewRelease": {
        "type": "object",
        "description": "The preview's newest build and the deployment that follows it.",
        "properties": {
          "build_id": {
            "type": "string",
            "description": "The build's ID: the one `getPreviewBuildLogs` takes."
          },
          "deployment_id": {
            "description": "The ID of its deployment, once the build has succeeded: the one `getPreviewDeploymentLogs` takes. `null` before.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "commit_sha": {
            "type": "string",
            "description": "The commit that was built, as 40 hexadecimal characters.",
            "pattern": "^[0-9a-f]{40}$"
          },
          "release_status": {
            "type": "string",
            "description": "Where the release is, with the values of `release_status` of a build.",
            "enum": [
              "QUEUED",
              "BUILDING",
              "BUILD_FAILED",
              "CANCELLED",
              "BUILT",
              "DEPLOYING",
              "SUPERSEDED",
              "DEPLOY_FAILED",
              "DEPLOYED",
              "UNKNOWN"
            ]
          },
          "env_version": {
            "description": "The `env_version` it was built with. A preview gets the variables and the secrets marked for previews. `null` for the empty environment.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "started_at": {
            "description": "When the build started. `null` until it has.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "build_id",
          "deployment_id",
          "commit_sha",
          "release_status",
          "env_version",
          "started_at"
        ]
      },
      "PreviewSettings": {
        "type": "object",
        "description": "Whether previews are on for a cube, and whether they can be turned on.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether previews are on."
          },
          "available": {
            "type": "boolean",
            "description": "Whether previews can be turned on now."
          },
          "reason": {
            "description": "Why they cannot be turned on. `PUBLIC_REPOSITORY`: the cube was made from a link, so Cubecen does not see its pull requests. `APPLICATION_NOT_READY`: the cube is not active. `PLAN`: the organization's plan has no previews. `REPOSITORY_NOT_ACCESSIBLE`: the cube's GitHub connection is gone. `GITHUB_PERMISSIONS_MISSING`: an owner of the GitHub account has not approved the permissions that previews need. `null` when they can.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "PUBLIC_REPOSITORY",
                  "APPLICATION_NOT_READY",
                  "PLAN",
                  "REPOSITORY_NOT_ACCESSIBLE",
                  "GITHUB_PERMISSIONS_MISSING"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "approve_url": {
            "description": "Where an owner of the GitHub account approves the permissions, on github.com. `null` unless `reason` is `GITHUB_PERMISSIONS_MISSING`.",
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "branch": {
            "description": "The tracked branch: the pull requests into it get previews. `null` when the cube has none.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "limits": {
            "$ref": "#/components/schemas/PreviewLimits",
            "description": "The limits that apply to the previews of a cube."
          }
        },
        "required": [
          "enabled",
          "available",
          "reason",
          "approve_url",
          "branch",
          "limits"
        ]
      },
      "PreviewSettingsUpdate": {
        "type": "object",
        "description": "The switch. Send only this field: a request with another field is refused with `400`.",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "`true` turns previews on, `false` turns them off. Required."
          }
        },
        "required": [
          "enabled"
        ]
      },
      "Project": {
        "type": "object",
        "description": "A project: a group of cubes in an organization.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The project's ID.",
            "format": "uuid"
          },
          "organization_id": {
            "type": "string",
            "description": "The ID of the organization the project belongs to.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The project's name."
          },
          "slug": {
            "type": "string",
            "description": "A short, unique name made of lowercase letters, digits and hyphens. Paths accept it in place of the ID."
          },
          "description": {
            "type": "string",
            "description": "What the project is for, in free text. Empty when none was given."
          },
          "created_by": {
            "type": "string",
            "description": "The ID of the user who created the project.",
            "format": "uuid"
          },
          "created_at": {
            "type": "string",
            "description": "When the project was created.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "When the project was last changed.",
            "format": "date-time"
          },
          "application_count": {
            "type": "integer",
            "description": "How many cubes the project has, whether they are still being created, running or failed.",
            "minimum": 0
          },
          "last_release_at": {
            "description": "When the newest release of any of its cubes started. `null` before the first release.",
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "organization_id",
          "name",
          "slug",
          "description",
          "created_by",
          "created_at",
          "updated_at",
          "application_count",
          "last_release_at"
        ]
      },
      "ProjectPage": {
        "type": "object",
        "description": "A page of projects.",
        "properties": {
          "items": {
            "type": "array",
            "description": "The projects on this page.",
            "items": {
              "$ref": "#/components/schemas/Project"
            }
          },
          "next_cursor": {
            "type": "string",
            "description": "Send it as `cursor` to get the next page. Absent on the last page."
          }
        },
        "required": [
          "items"
        ]
      },
      "ProjectRef": {
        "type": "object",
        "description": "A project, named briefly.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The project's ID.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The project's name."
          },
          "slug": {
            "type": "string",
            "description": "The project's slug."
          }
        },
        "required": [
          "id",
          "name",
          "slug"
        ]
      },
      "PublicRepository": {
        "type": "object",
        "description": "A public repository, as a link names it, and what a cube made from it would build.",
        "properties": {
          "owner": {
            "type": "string",
            "description": "The GitHub account that owns the repository."
          },
          "name": {
            "type": "string",
            "description": "The repository's name."
          },
          "url": {
            "type": "string",
            "description": "The address to clone the repository from: `https://github.com/owner/name.git`.",
            "pattern": "^https://github\\.com/[A-Za-z0-9-]+/[A-Za-z0-9_.-]+\\.git$"
          },
          "default_branch": {
            "type": "string",
            "description": "The repository's default branch."
          },
          "branch": {
            "type": "string",
            "description": "The branch the link names, or else the default branch."
          },
          "app_root": {
            "type": "string",
            "description": "The folder the link names, or `.` for the root of the repository."
          },
          "commit_sha": {
            "type": "string",
            "description": "The commit that a build of `branch` would use now, as 40 hexadecimal characters.",
            "pattern": "^[0-9a-f]{40}$"
          }
        },
        "required": [
          "owner",
          "name",
          "url",
          "default_branch",
          "branch",
          "app_root",
          "commit_sha"
        ]
      },
      "Release": {
        "type": "object",
        "description": "One release of a cube: a build with the deployment that follows it, or a deployment of its own, a redeploy or a rollback.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The build's ID, or the deployment's ID for a redeploy and a rollback."
          },
          "kind": {
            "type": "string",
            "description": "What the release is. `deploy`: a build that deploys, or a deployment of a build newer than the one that is live. `build`: a build that does not deploy. `redeploy`: a deployment of the build that is live. `rollback`: a deployment of an older build.",
            "enum": [
              "deploy",
              "build",
              "redeploy",
              "rollback"
            ]
          },
          "build_id": {
            "type": "string",
            "description": "The ID of the build that the release builds, or deploys."
          },
          "deployment_id": {
            "type": "string",
            "description": "The ID of the release's deployment. Absent for a build that does not deploy, and until a build that deploys has made its deployment."
          },
          "revision": {
            "type": "string",
            "description": "What the build was asked to build, as a label: a branch, a tag or a commit SHA. For a redeploy and a rollback, that of the build they deploy."
          },
          "commit_sha": {
            "type": "string",
            "description": "The exact commit that was built, as 40 hexadecimal characters."
          },
          "builder": {
            "description": "How the build was made: `dockerfile` or `railpack`. `null` until the build has looked for a Dockerfile, and for builds made before Dockerfile support. New values may appear.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "release_status": {
            "type": "string",
            "description": "Where the release is, counting the deployment that follows a build. `QUEUED` is waiting to build and `BUILDING` is building. `BUILT` is built without deploying: it can be deployed later. `DEPLOYING` is going live, and `DEPLOYED` is live at `public_url`. `BUILD_FAILED` and `DEPLOY_FAILED` have an `error`; after a failed deployment the previous version keeps serving. `CANCELLED` was cancelled. `SUPERSEDED` was built, but a newer build was deployed instead. `UNKNOWN` is a status this API does not describe yet: keep polling.",
            "enum": [
              "QUEUED",
              "BUILDING",
              "BUILD_FAILED",
              "CANCELLED",
              "BUILT",
              "DEPLOYING",
              "SUPERSEDED",
              "DEPLOY_FAILED",
              "DEPLOYED",
              "UNKNOWN"
            ]
          },
          "terminal": {
            "type": "boolean",
            "description": "`false` while the release is still moving, so keep polling. `true` once `release_status` is final."
          },
          "error": {
            "$ref": "#/components/schemas/ErrorInfo",
            "description": "Why the build or the deployment failed. Present when `release_status` is `BUILD_FAILED` or `DEPLOY_FAILED`."
          },
          "public_url": {
            "type": "string",
            "description": "The address the cube is served at. Present once `release_status` is `DEPLOYED`."
          },
          "created_by": {
            "description": "The ID of the user who started the release. For a release started with an API key, the key's owner. `null` for a release that a push started, and for one with no recorded origin.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "trigger": {
            "description": "What started the release: `dashboard` (a person, in the dashboard), `push` (a push to the branch the cube deploys from), `api` (an API key) or `mcp` (an AI agent signed in as a person through Cubecen's MCP server). `null` for a release with no recorded origin.",
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "dashboard",
                  "push",
                  "api",
                  "mcp"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "pushed_by": {
            "description": "The GitHub login that pushed, when `trigger` is `push`. `null` otherwise.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "api_key": {
            "description": "The API key that started the release, when `trigger` is `api`. `null` otherwise. A revoked key keeps its name here.",
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "description": "The key's ID.",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "description": "The key's name, as it was given. Everyone who can read the release sees it, so a name is no place for a secret."
                  }
                },
                "required": [
                  "id",
                  "name"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "mcp_client": {
            "description": "The AI client that started the release for the person, when `trigger` is `mcp`, such as `claude.ai`. `null` otherwise.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "description": "When the release was created.",
            "format": "date-time"
          },
          "started_at": {
            "type": "string",
            "description": "When the release started running: when its build started, or for a redeploy and a rollback when its deployment started. Absent while it waits in the queue.",
            "format": "date-time"
          },
          "finished_at": {
            "type": "string",
            "description": "When the release finished. Absent until then.",
            "format": "date-time"
          },
          "stages": {
            "type": "object",
            "description": "The release's two steps. A step that the release does not have is `null`.",
            "properties": {
              "build": {
                "description": "The build step. `null` for a redeploy and a rollback, which build nothing.",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ReleaseStage"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "deploy": {
                "description": "The deploy step. `null` for a build that does not deploy.",
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ReleaseStage"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "build",
              "deploy"
            ]
          },
          "env_version": {
            "description": "The version of the variables the release ran with (a build: was built with): 7 lowercase hexadecimal characters. `null` for a release made before environment versions, and for one with no variables. Pass it to `createDeployment` to roll back with those variables.",
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[0-9a-f]{7}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "build_id",
          "revision",
          "commit_sha",
          "builder",
          "release_status",
          "terminal",
          "created_by",
          "trigger",
          "pushed_by",
          "api_key",
          "mcp_client",
          "created_at",
          "stages",
          "env_version"
        ]
      },
      "ReleasePage": {
        "type": "object",
        "description": "A page of releases.",
        "properties": {
          "data": {
            "type": "array",
            "description": "The releases on this page, newest first.",
            "items": {
              "$ref": "#/components/schemas/Release"
            }
          },
          "live_deployment_id": {
            "description": "The ID of the deployment that serves the cube now, the successful one that finished last. `null` when nothing is live.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "next_cursor": {
            "description": "Send it as `cursor` to get the next page. `null` on the last page.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "data",
          "live_deployment_id",
          "next_cursor"
        ]
      },
      "ReleaseStage": {
        "type": "object",
        "description": "One step of a release.",
        "properties": {
          "status": {
            "type": "string",
            "description": "The step's status. For the build step: `QUEUED`, `BUILDING`, `SUCCEEDED`, `FAILED` or `CANCELLED`. For the deploy step: `QUEUED`, `DEPLOYING`, `SUCCEEDED`, `FAILED` or `CANCELLED`. The deploy step of a build can also be `PENDING` (waiting for the build), `SKIPPED` (the build failed, was cancelled or was superseded) or `FAILED` (the deployment could not be created). New values may appear."
          },
          "started_at": {
            "type": "string",
            "description": "When the step started running. Absent while it waits.",
            "format": "date-time"
          },
          "finished_at": {
            "type": "string",
            "description": "When the step finished. Absent until then.",
            "format": "date-time"
          }
        },
        "required": [
          "status"
        ]
      },
      "RepositoryTree": {
        "type": "object",
        "description": "The folders of a repository at one commit.",
        "properties": {
          "repository": {
            "type": "string",
            "description": "The repository, as `owner/name`, spelled as GitHub spells it."
          },
          "ref": {
            "type": "string",
            "description": "The branch, tag or commit that was read."
          },
          "commit_sha": {
            "type": "string",
            "description": "The exact commit that was read, as 40 hexadecimal characters.",
            "pattern": "^[0-9a-f]{40}$"
          },
          "directories": {
            "type": "array",
            "description": "The folders, sorted by path, with the root, `.`, first.",
            "items": {
              "$ref": "#/components/schemas/RepositoryTreeDirectory"
            }
          },
          "truncated": {
            "type": "boolean",
            "description": "`true` when some folders were left out: the repository has more than 2000, or GitHub cut the list short."
          }
        },
        "required": [
          "repository",
          "ref",
          "commit_sha",
          "directories",
          "truncated"
        ]
      },
      "RepositoryTreeDirectory": {
        "type": "object",
        "description": "A folder of a repository.",
        "properties": {
          "path": {
            "type": "string",
            "description": "The folder's path from the root of the repository, or `.` for the root."
          },
          "markers": {
            "type": "array",
            "description": "The files in this folder that builders use to recognize what to build, such as `Dockerfile`, `package.json` or `go.mod`. `pnpm-workspace.yaml` marks the root of a monorepo. Empty when there are none.",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "path",
          "markers"
        ]
      },
      "ResourceCreate": {
        "type": "object",
        "description": "The project to create. Send only these fields; a request with another field is refused with `400`.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The project's name: 1 to 120 characters, with no space at the start or the end and no control characters.",
            "minLength": 1,
            "maxLength": 120
          },
          "slug": {
            "type": "string",
            "description": "The project's slug: lowercase letters, digits and single hyphens, such as `my-shop`, up to 80 characters. It must not be an ID, nor one of the reserved slugs, and no other project of the organization may have it.",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "description": {
            "type": "string",
            "description": "What the project is for, in free text, up to 4000 characters. Empty when left out.",
            "maxLength": 4000
          }
        },
        "required": [
          "name",
          "slug"
        ]
      },
      "ResourceMetrics": {
        "type": "object",
        "description": "CPU, in cores (1 is one full core), or memory, in bytes (the working set, which the limit is enforced against: a container that reaches it is restarted). `limit` is the sum of the limits of the running replicas, and `pods` has one series per replica, sorted by name.",
        "properties": {
          "unit": {
            "type": "string",
            "description": "The unit of the points: `cores` or `bytes`."
          },
          "total": {
            "type": "array",
            "description": "The use of all replicas together.",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            }
          },
          "limit": {
            "type": "array",
            "description": "The sum of the limits of the running replicas.",
            "items": {
              "$ref": "#/components/schemas/MetricPoint"
            }
          },
          "pods": {
            "type": "array",
            "description": "The use of each replica.",
            "items": {
              "type": "object",
              "properties": {
                "pod": {
                  "type": "string",
                  "description": "The replica's name. A new name is a new replica, or the pod of a new deployment."
                },
                "points": {
                  "type": "array",
                  "description": "The use of this replica.",
                  "items": {
                    "$ref": "#/components/schemas/MetricPoint"
                  }
                }
              },
              "required": [
                "pod",
                "points"
              ]
            }
          }
        },
        "required": [
          "unit",
          "total",
          "limit",
          "pods"
        ]
      },
      "ResourcePatch": {
        "type": "object",
        "description": "The fields of a project to change. Send at least one; one that is left out stays as it is. A request with another field is refused with `400`.",
        "properties": {
          "name": {
            "type": "string",
            "description": "The project's new name. The rules are those of `name` when a project is created. It cannot be `null`.",
            "minLength": 1,
            "maxLength": 120
          },
          "slug": {
            "type": "string",
            "description": "The project's new slug. The rules are those of `slug` when a project is created. It cannot be `null`.",
            "minLength": 1,
            "maxLength": 80,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "description": {
            "description": "The project's new description, up to 4000 characters. `null` clears it.",
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "minProperties": 1
      },
      "Runtime": {
        "type": "object",
        "description": "How a cube is built and run, and where it is served.",
        "properties": {
          "host_label": {
            "type": "string",
            "description": "The first part of the cube's address: `public_url` is `https://<host_label>.cubecen.app`. It is made when the cube is created, from the cube's slug, the organization's slug and a short random suffix, and it never changes, even when the cube is renamed. You cannot choose it."
          },
          "public_url": {
            "type": "string",
            "description": "The cube's address, whether or not it is deployed yet: `https://<host_label>.cubecen.app`. Empty until `state` is `active`."
          },
          "app_root": {
            "type": "string",
            "description": "The folder of the repository that the cube is built from. `.` is the root of the repository."
          },
          "start_command": {
            "type": "string",
            "description": "The command that starts the cube. Empty lets the builder find it, or a Dockerfile image run its own command. Applies from the next build."
          },
          "build_command": {
            "type": "string",
            "description": "Replaces the build command that Railpack detects. Empty uses the detected one. It does not apply to a cube built from a Dockerfile. Applies from the next build.",
            "maxLength": 1024
          },
          "output_directory": {
            "type": "string",
            "description": "A folder under `app_root` whose files are served as a static site, even when the repository has a start script. Empty lets the builder decide. Never set together with `start_command`. Applies from the next build."
          },
          "port": {
            "description": "The port the cube listens on, which it receives as `PORT`. `null` means the one port the image exposes, else 8080. Applies from the next build.",
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 65535
              },
              {
                "type": "null"
              }
            ]
          },
          "private_url": {
            "type": "string",
            "description": "The address the other cubes of the same project use to reach this cube over the project's private network. It works only from inside the project, once this cube is deployed. Empty when the cube has no such address yet."
          }
        },
        "required": [
          "host_label",
          "public_url",
          "app_root",
          "start_command",
          "build_command",
          "output_directory",
          "port",
          "private_url"
        ]
      },
      "SizeClass": {
        "type": "object",
        "description": "A size that a cube can have.",
        "properties": {
          "size": {
            "type": "string",
            "description": "The size's ID: `small`, `medium`, `large` or `xlarge`.",
            "enum": [
              "small",
              "medium",
              "large",
              "xlarge"
            ]
          },
          "name": {
            "type": "string",
            "description": "The size's name.",
            "enum": [
              "Small",
              "Medium",
              "Large",
              "XLarge"
            ]
          },
          "memory_mib": {
            "type": "integer",
            "description": "The memory that a cube of this size is limited to, in MiB."
          },
          "cpu": {
            "type": "number",
            "description": "The most CPU that a cube of this size can use, in cores."
          },
          "available": {
            "type": "boolean",
            "description": "`true` when a new cube can have this size now. A size can be listed and not available: no new cube gets it yet."
          }
        },
        "required": [
          "size",
          "name",
          "memory_mib",
          "cpu",
          "available"
        ]
      },
      "UsageAmounts": {
        "type": "object",
        "description": "What was used.",
        "properties": {
          "build_minutes": {
            "type": "integer",
            "description": "Minutes spent building, rounded up to a whole minute. Every figure is rounded on its own, so days and cubes may not add up to the total."
          },
          "bandwidth_bytes": {
            "type": "integer",
            "description": "Bytes of responses served."
          },
          "instance_hours": {
            "type": "number",
            "description": "Hours that the instances of the cubes ran, rounded down to two decimals."
          },
          "requests": {
            "type": "integer",
            "description": "Requests answered."
          }
        },
        "required": [
          "build_minutes",
          "bandwidth_bytes",
          "instance_hours",
          "requests"
        ]
      },
      "UsageCube": {
        "type": "object",
        "description": "The use of one cube over the range.",
        "properties": {
          "build_minutes": {
            "type": "integer",
            "description": "Minutes spent building the cube, rounded up to a whole minute."
          },
          "bandwidth_bytes": {
            "type": "integer",
            "description": "Bytes of responses served by the cube."
          },
          "instance_hours": {
            "type": "number",
            "description": "Hours that the instances of the cube ran, rounded down to two decimals."
          },
          "requests": {
            "type": "integer",
            "description": "Requests that the cube answered."
          },
          "application_id": {
            "type": "string",
            "description": "The cube's ID.",
            "format": "uuid"
          },
          "project_id": {
            "type": "string",
            "description": "The ID of the project the cube is in.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The cube's name."
          },
          "slug": {
            "type": "string",
            "description": "The cube's slug."
          },
          "deleted": {
            "type": "boolean",
            "description": "`true` when the cube was deleted. It is listed because it has use in the range."
          },
          "previews": {
            "$ref": "#/components/schemas/UsageAmounts",
            "description": "The part of the cube's use that its previews made. It is included in the figures above."
          }
        },
        "required": [
          "application_id",
          "project_id",
          "name",
          "slug",
          "deleted",
          "build_minutes",
          "bandwidth_bytes",
          "instance_hours",
          "requests",
          "previews"
        ]
      },
      "UsageDay": {
        "type": "object",
        "description": "The use of one UTC day.",
        "properties": {
          "build_minutes": {
            "type": "integer",
            "description": "Minutes spent building that day, rounded up to a whole minute."
          },
          "bandwidth_bytes": {
            "type": "integer",
            "description": "Bytes of responses served that day."
          },
          "instance_hours": {
            "type": "number",
            "description": "Hours that the instances of the cubes ran that day, rounded down to two decimals."
          },
          "requests": {
            "type": "integer",
            "description": "Requests answered that day."
          },
          "day": {
            "type": "string",
            "description": "The day, as a date.",
            "format": "date"
          }
        },
        "required": [
          "day",
          "build_minutes",
          "bandwidth_bytes",
          "instance_hours",
          "requests"
        ]
      },
      "User": {
        "type": "object",
        "description": "A person.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The user's ID. It is the `created_by` of what the user made.",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "description": "The user's email address.",
            "format": "email"
          },
          "email_verified": {
            "type": "boolean",
            "description": "`true` once the user has confirmed the address."
          },
          "first_name": {
            "description": "The user's first name. `null` when there is none.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "last_name": {
            "description": "The user's last name. `null` when there is none.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "avatar_url": {
            "description": "The address of the user's profile picture. `null` when there is none.",
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "email",
          "email_verified",
          "first_name",
          "last_name",
          "avatar_url"
        ]
      },
      "UserRef": {
        "type": "object",
        "description": "A user, as the environment shows who made a change.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The user's ID.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The user's first and last name, or their email address when they have no name."
          }
        },
        "required": [
          "id",
          "name"
        ]
      }
    }
  }
}
