{
 "openapi": "3.0.3",
 "info": {
  "title": "Dispra Cloud developer API",
  "version": "1",
  "description": "Everything inside a project, with a project key (Authorization: Bearer dsp_live_...). Generated by prethm-api tools/gen_devapi_reference.py from the dashboard's spec and the key boundary; do not edit. x-key-access is the least key access (read, deploy, full) a route needs; the key's creator must hold the project role too."
 },
 "servers": [
  {
   "url": "https://devapi.dispralabs.com"
  },
  {
   "url": "https://devapi.dev.dispralabs.com"
  }
 ],
 "security": [
  {
   "key": []
  }
 ],
 "paths": {
  "/v1/cloud/domains/{dom}": {
   "get": {
    "operationId": "clients_api_domain_get",
    "summary": "A custom domain",
    "description": "Service panel > Settings > Networking > a custom domain: its lifecycle (pending_dns, verifying, issuing_certificate, active or failed with a reason), the exact DNS records to create with what the last check found for each, the DNS provider from the zone's NS records, the certificate every serving edge presents, and the next automatic check. cloud-core's domain object, passed through.",
    "parameters": [
     {
      "name": "dom",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "CustomDomain",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomDomain"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "delete": {
    "operationId": "clients_api_domain_remove",
    "summary": "Remove custom domain",
    "description": "Customer removes a custom domain from a service (hostname lifecycle step 8: route revoked, certificate no longer renewed). Added by the lifecycle walk of PDF 9.1; no removal arrow existed.",
    "parameters": [
     {
      "name": "dom",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "DomainRemoved",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DomainRemoved"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/domains/{dom}/connect": {
   "post": {
    "operationId": "clients_api_domain_connect",
    "summary": "Set up the domain's records with Domain Connect",
    "description": "Set up automatically: the signed Domain Connect apply URL of the Dispra template at the domain's DNS provider (synchronous flow). The dashboard opens url in a popup of width x height; the person signs in at their DNS provider and approves the records there, and the provider sends them back to redirect_uri with state. The domain is then checked as usual. Offered only while the domain object's connect.supported is true. Audited as domain.connect.started (provider, domain, host; never the URL). Refused with domain_connect_unsupported (409: the DNS provider does not offer Domain Connect with the Dispra template for this domain), invalid_state (409: the domain is verified or not a custom domain) or invalid_request (400: redirect_uri is not an allowed https address).",
    "parameters": [
     {
      "name": "dom",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "redirect_uri": {
          "type": "string",
          "description": "where the DNS provider sends the person back, an https URL of at most 500 characters on a dashboard origin (<origin>/domain-connect/return)"
         }
        },
        "required": [
         "redirect_uri"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "DomainConnect",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DomainConnect"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/domains/{dom}/verify": {
   "post": {
    "operationId": "clients_api_domain_verify",
    "summary": "Verify custom domain",
    "description": "Check now: the DNS check of a custom domain (the same decision as the automatic checks, which back off from every minute to daily), and for a verified domain a certificate probe of every serving edge. A failed domain goes back on the automatic schedule. Answers the domain object (status, records with what was found, cert); 429 rate_limited within 10 seconds of the last check.",
    "parameters": [
     {
      "name": "dom",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "CustomDomain",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/CustomDomain"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}": {
   "delete": {
    "operationId": "clients_api_env_delete",
    "summary": "Delete environment",
    "description": "Customer deletes a non-production environment. Same 7-day recoverable delete as a project (services stopped, hostnames reserved); step-up authentication required.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "EnvironmentDeleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/EnvironmentDeleted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/services": {
   "get": {
    "operationId": "clients_api_service_list",
    "summary": "List services of an environment",
    "description": "The service board: every service of one environment with its source kind, latest deployment state and desired limits.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor, empty for the first page"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 100"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/environments/{env}/config": {
   "get": {
    "operationId": "clients_api_config_export",
    "summary": "The environment as dispra.yaml",
    "description": "dcloud config export: the environment's services, volumes, groups and variables in the shape of dispra.yaml (version 1). Variables are written as ${{ secret }}: values are never exported.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ConfigExport",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "config": {
           "type": "object",
           "description": "dispra.yaml as JSON (see the developer API reference)"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/environments/{env}/config/apply": {
   "post": {
    "operationId": "clients_api_config_apply",
    "summary": "Apply dispra.yaml to the environment",
    "description": "dcloud apply: makes the plan again and runs it, in order (groups, variables, services and their settings, variables, groups and domains, then volumes); with plan_hash, refused with 409 plan_stale (and the new plan) when the environment changed since. deploy (default true) starts a deployment of each service created or changed. A step Dispra refuses stops the apply: 409 apply_failed with what was applied before it. Nothing is deleted unless prune is true, and volumes never. Developers and up; developer keys with full access.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "config": {
          "type": "object",
          "description": "dispra.yaml as JSON"
         },
         "plan_hash": {
          "type": "string",
          "description": "the plan_hash of the plan that was reviewed"
         },
         "deploy": {
          "type": "boolean",
          "description": "start deployments of what changed (default true)"
         },
         "prune": {
          "type": "boolean",
          "description": "delete what the file leaves out (services, their variables, domains and regions, groups, the environment's variables); never volumes"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ConfigApplied",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "plan_hash": {
           "type": "string"
          },
          "applied": {
           "type": "array",
           "description": "list of {action, kind, target, fields}",
           "items": {
            "type": "object"
           }
          },
          "deployments": {
           "type": "array",
           "description": "list of {service, svc, dep}",
           "items": {
            "type": "object"
           }
          },
          "unmanaged": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "warnings": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/config/plan": {
   "post": {
    "operationId": "clients_api_config_plan",
    "summary": "Plan dispra.yaml against the environment",
    "description": "dcloud plan: what applying the file would change, in order, without changing anything. What the file leaves out is left as it is; services and volumes of the environment not in the file are listed as unmanaged, never deleted. Variable values are compared here and never returned. Developers and up; developer keys with full access (comparing reads secret values).",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "config": {
          "type": "object",
          "description": "dispra.yaml as JSON"
         },
         "prune": {
          "type": "boolean",
          "description": "plan deleting what the file leaves out (never volumes)"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ConfigPlan",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "plan_hash": {
           "type": "string"
          },
          "changes": {
           "type": "array",
           "description": "list of {action, kind, target, fields}",
           "items": {
            "type": "object"
           }
          },
          "unmanaged": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "warnings": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/groups": {
   "get": {
    "operationId": "clients_api_service_group_list",
    "summary": "List the service groups of an environment",
    "description": "Service groups: named, ordered sections of an environment's board (cloud-core migrations 0027, 0035). They organise the board only. In position order.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceGroupList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "groups": {
           "type": "array",
           "description": "list of {grp, name, position, created_at}, by position"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "post": {
    "operationId": "clients_api_service_group_create",
    "summary": "Create a service group",
    "description": "Service groups: named, ordered sections of an environment's board (cloud-core migrations 0027, 0035). They organise the board only.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "1 to 48 characters, unique in the environment (ignoring case)"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ServiceGroup",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "grp": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "position": {
           "type": "integer",
           "description": "0-based place among the environment's groups"
          },
          "created_at": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/groups/{grp}": {
   "patch": {
    "operationId": "clients_api_service_group_rename",
    "summary": "Rename or move a service group",
    "description": "Service groups: named, ordered sections of an environment's board (cloud-core migrations 0027, 0035). They organise the board only. Renames the group, moves it to position among the environment's groups (the others are renumbered 0..n-1; past the end is last), or both.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "grp",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "1 to 48 characters, unique in the environment (ignoring case); optional when position is given"
         },
         "position": {
          "type": "integer",
          "minimum": 0,
          "description": "0-based place among the environment's groups; past the end: last"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ServiceGroup",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "grp": {
           "type": "string"
          },
          "name": {
           "type": "string"
          },
          "position": {
           "type": "integer",
           "description": "0-based place among the environment's groups"
          },
          "created_at": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "delete": {
    "operationId": "clients_api_service_group_delete",
    "summary": "Delete a service group",
    "description": "Service groups: named, ordered sections of an environment's board (cloud-core migrations 0027, 0035). They organise the board only. Its services and volumes stay, at the end of the ungrouped section.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "grp",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceGroupDeleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "grp": {
           "type": "string"
          },
          "status": {
           "type": "string",
           "description": "deleted"
          },
          "services_ungrouped": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/group": {
   "put": {
    "operationId": "clients_api_service_group_set",
    "summary": "Put a service in a group, or in none",
    "description": "Service groups: named, ordered sections of an environment's board (cloud-core migrations 0027, 0035). They organise the board only.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "grp": {
          "type": "string",
          "description": "a group of the service's environment; null: no group"
         },
         "position": {
          "type": "integer",
          "description": "0-based place among the section's services and volumes (the group's, or the ungrouped ones on top); absent: last"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ServiceGroupSet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "svc": {
           "type": "string"
          },
          "grp": {
           "type": "string",
           "description": "null: no group"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}": {
   "get": {
    "operationId": "clients_api_project_get",
    "summary": "Get project",
    "description": "One project, as cloud-core answers it (X-project-get), with its place on the projects page, last deploy, card issue and teardown progress.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Project",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Project"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "delete": {
    "operationId": "clients_api_project_delete",
    "summary": "Delete project",
    "description": "Customer deletes a project PERMANENTLY: it cannot be undone. cloud-core tears it down in six steps (stop services; remove groups and environments; delete volumes and their backups; release domains; remove variables, keys and the webhook; close billing), retrying a failed step. The project leaves the switcher at once and stays in the projects list with its deletion progress until it is purged. Its API tokens held here are revoked. confirm must be true.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "confirm": {
          "type": "boolean",
          "description": "must be true"
         },
         "step_up_proof": {
          "type": "string",
          "description": "SECRET: recent-authentication proof (not older than 5 minutes), never logged"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ProjectDeleteAccepted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectDeleteAccepted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "patch": {
    "operationId": "clients_api_project_update",
    "summary": "Update project settings",
    "description": "Project settings > General: rename and describe a project (project admin). The projects page: move a project to a 0-based position among the organisation's live projects, shared by everyone (project developer; past the end means last). At least one field. The project id is read-only and shown on the page. The region has its own confirmed flow (C-clients-api-project-region); the project's organisation does not change.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "optional; 1 to 64 characters; project admin"
         },
         "description": {
          "type": "string",
          "description": "optional; up to 500 characters; project admin"
         },
         "position": {
          "type": "integer",
          "minimum": 0,
          "description": "optional; the project's new 0-based place on the projects page; project developer"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ProjectUpdated",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ProjectUpdated"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/activity": {
   "get": {
    "operationId": "clients_api_activity_list",
    "summary": "Project and environment activity",
    "description": "Activity feed of a project or one environment: deploys, failures and out-of-memory kills, config changes, backups, cron runs, with the actor.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "env",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "optional env_"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor, empty for the first page"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 100"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ActivityList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ActivityList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/projects/{prj}/delete-preview": {
   "get": {
    "operationId": "clients_api_project_delete_preview",
    "summary": "What deleting a project removes",
    "description": "The Delete project dialog: the services, groups, volumes (sizes and backups), environments and custom domains the delete removes, and the counts of generated addresses, variables, webhooks and API keys. cloud-core's answer passed through; api_keys adds the project's working API tokens held here. Project admin.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "DeletePreview",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DeletePreview"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/environments": {
   "post": {
    "operationId": "clients_api_env_create",
    "summary": "Create environment",
    "description": "Customer adds an environment (staging, preview, any name) to a project. Every project already has `production`, created with the project and not deletable.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "customer-chosen name, unique within the project"
         },
         "copy_from": {
          "type": "string",
          "description": "env_ to copy services and variable references from, empty for an empty environment"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "EnvironmentCreated",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/EnvironmentCreated"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "get": {
    "operationId": "clients_api_env_list",
    "summary": "List environments of a project",
    "description": "Environment switcher and project settings: every environment of one project, with service counts and a roll-up status.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor, empty for the first page"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 100"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "EnvironmentList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/EnvironmentList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/projects/{prj}/logs": {
   "get": {
    "operationId": "clients_api_logs_list",
    "summary": "Project logs",
    "description": "A project's own output (build, post-deploy and live container lines), newest first. Read only through the project the caller was authorised on: no request field selects a file, a project or a tag. The range is mandatory in effect (last 7 days when from is absent), paging is by cursor, the total is exact up to total_cap.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "from",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "RFC 3339 start of the range (inclusive); default the last 7 days"
      }
     },
     {
      "name": "to",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "RFC 3339 end of the range (exclusive)"
      }
     },
     {
      "name": "level",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "one level, or several separated by commas"
      }
     },
     {
      "name": "svc",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "narrow to one service of the project (a value from facets.svcs); letters, digits, dot, colon, dash, underscore, at most 64 characters"
      }
     },
     {
      "name": "dep",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "narrow to one deployment of the project (a value from facets.deployments); same alphabet as svc"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "search text, at most 200 characters"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor from next_cursor, empty for the first page"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 200, default 50"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "LogPage",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "additionalProperties": true
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/projects/{prj}/logs/facets": {
   "get": {
    "operationId": "clients_api_logs_facets",
    "summary": "Project log facets",
    "description": "The services, levels, environments, service ids (svcs) and deployment ids (deployments) the project's lines of the last 7 days have used, for the filter menus.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "LogFacets",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "additionalProperties": true
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/projects/{prj}/services": {
   "post": {
    "operationId": "clients_api_service_create",
    "summary": "Create service",
    "description": "Create a service: name, repo link, limits; API generates the stable hostname.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "env": {
          "type": "string",
          "description": "environment the service belongs to"
         },
         "name": {
          "type": "string",
          "description": "customer-chosen service name"
         },
         "repo_id": {
          "type": "string",
          "description": "git host repo id, empty for CLI upload. git ingest checks that it is in the installation's repository list NOW (not at link time) and that the installation is linked to this project's team; otherwise API_REPO_NOT_LINKED"
         },
         "branch": {
          "type": "string",
          "description": "branch to auto-deploy"
         },
         "cpu_millis": {
          "type": "integer",
          "description": "ceiling chosen on the slider"
         },
         "memory_mb": {
          "type": "integer",
          "description": "ceiling chosen on the slider"
         },
         "disk_mb": {
          "type": "integer",
          "minimum": 1024,
          "maximum": 102400,
          "multipleOf": 1024,
          "description": "optional, default 1024; temporary disk quota of each replica in MB: whole GB, 1024 to 102400 (1 to 100 GB), a multiple of 1024; covers every write the app makes, wiped on every deploy or restart, billed by allocated size x time"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ServiceCreated",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceCreated"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/undelete": {
   "post": {
    "operationId": "clients_api_project_undelete",
    "summary": "Undelete a project",
    "description": "Restores a project deleted BEFORE the permanent teardown rule, inside its old 7-day window: routes come back, services restart from their last live deployment. A project deleted since cannot be restored: refused 409 not_restorable.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "step_up_proof": {
          "type": "string",
          "description": "SECRET: recent-authentication proof, never logged"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Undeleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Undeleted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhooks": {
   "get": {
    "operationId": "clients_api_webhook_list",
    "summary": "List webhooks",
    "description": "Webhooks of a project with the state of the last delivery.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor, empty for the first page"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 100"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "WebhookList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WebhookList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhooks/{whk}": {
   "delete": {
    "operationId": "clients_api_webhook_delete",
    "summary": "Delete a webhook",
    "description": "Remove a webhook; deliveries stop at once.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "whk",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "WebhookDeleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WebhookDeleted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "put": {
    "operationId": "clients_api_webhook_set",
    "summary": "Create or update a webhook",
    "description": "Project settings > Webhooks: an HTTPS endpoint that receives project events (deploy completed, failed, crashed, out of memory), signed with a per-webhook secret returned once. The URL is refused if it resolves to a private, link-local or mesh address.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "whk",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string",
          "description": "https only"
         },
         "events": {
          "type": "array",
          "items": {
           "type": "object",
           "additionalProperties": true
          },
          "description": "noun.verb event names this endpoint subscribes to"
         },
         "enabled": {
          "type": "string"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "WebhookSet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/WebhookSet"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhooks/{whk}/deliveries": {
   "get": {
    "operationId": "clients_api_webhook_deliveries",
    "summary": "List webhook deliveries",
    "description": "The last 100 deliveries of a webhook (event, response code, duration, attempt): to debug the customer's endpoint. No payload bodies.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "whk",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor, empty for the first page"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 100"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "DeliveryList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DeliveryList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}": {
   "delete": {
    "operationId": "clients_api_service_delete",
    "summary": "Delete service",
    "description": "Customer deletes one service (not the project): the API starts a teardown job for that service (stop, drop its routes), then removes its generated hostname and its custom domains' records through domain.record.requested and domain.remove.completed in the same job (G-LE-19). Its volumes are detached and kept: a volume is an object of the environment, with its own data, backups and key, and is deleted on its own (DELETE /v1/cloud/volumes/{vol}).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "confirm": {
          "type": "boolean",
          "description": "must be true; the dashboard says that the service's volumes are detached and kept"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "DeleteAccepted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DeleteAccepted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "get": {
    "operationId": "clients_api_status",
    "summary": "Service and deployment status",
    "description": "Read-only status for the dashboard and CLI: deployment state, desired_node/observed_node, limits, domains.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceStatus",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceStatus"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/deployments": {
   "post": {
    "operationId": "clients_api_deploy",
    "summary": "Deploy, redeploy or roll back",
    "description": "Customer triggers a deploy of the linked repo, redeploys, or rolls back to a previous deployment (by image digest).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "action": {
          "type": "string",
          "description": "deploy, redeploy or rollback"
         },
         "rollback_to_dep": {
          "type": "string",
          "description": "previous deployment, only for rollback"
         },
         "upload_ref": {
          "type": "string",
          "description": "opaque pointer from a CLI upload, only for source=upload"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "DeployAccepted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DeployAccepted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "deploy"
   },
   "get": {
    "operationId": "clients_api_deployment_list",
    "summary": "List deployments of a service",
    "description": "Deployments tab: history of one service, newest first. Carries repo, branch and SHA only (the commit message and author are customer content and are not held by the control plane; the app reads them from GitHub through the user's own installation).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "optional filter on the deployment state"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor, empty for the first page"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 100"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "DeploymentList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DeploymentList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/domains": {
   "post": {
    "operationId": "clients_api_domain_add",
    "summary": "Add custom domain",
    "description": "Customer adds a custom domain (a subdomain: a CNAME to the service; a zone apex: A records to the edges). Answers the domain object with the exact records to create, plus cname_target, txt_name, txt_value and apex_ips. Checked automatically from then on.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "domain": {
          "type": "string",
          "description": "customer's domain name"
         },
         "port": {
          "type": "integer",
          "description": "the container port the domain forwards to, 1 to 65535; absent = 8080"
         },
         "preview_token": {
          "type": "string",
          "description": "the preview_token of POST domains/preview for the same domain (within its hour); the domain then gets the TXT value the preview showed"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "DomainAdded",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/DomainAdded"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/domains/preview": {
   "post": {
    "operationId": "clients_api_domain_preview",
    "summary": "Preview a custom domain's records",
    "description": "Add your domain, before adding: the exact records the domain will need (routing and the TXT ownership proof), its DNS provider and whether the provider applies the Dispra Domain Connect template. Nothing is added; the TXT value is held for an hour under preview_token, which POST domains takes so the records stay the same. Refused like adding a domain (invalid_domain, domain_taken).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "domain": {
          "type": "string",
          "description": "customer's domain name"
         },
         "port": {
          "type": "integer",
          "description": "the container port, 1 to 65535; absent = 8080"
         }
        },
        "required": [
         "domain"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "DomainPreview",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/endpoints/name": {
   "get": {
    "operationId": "clients_api_endpoint_name_check",
    "summary": "Check a generated address",
    "description": "Generate a Dispra domain: whether <name>.dispracloud.app can be this service's address. reason invalid (3 to 40 of a-z, 0-9 and dashes, starting with a letter), reserved, or taken (names are never given out twice).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "name",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "NameCheck",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/detected-port": {
   "get": {
    "operationId": "clients_api_detected_port",
    "summary": "The port the service's image exposes",
    "description": "Generate a Dispra domain and Add your domain pre-fill the port: the TCP ports the live deployment's image exposes (EXPOSE). port is the lowest, null when the image says nothing (or is not in the platform registry).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "DetectedPort",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/health-test": {
   "post": {
    "operationId": "clients_api_health_test",
    "summary": "Test a health check path",
    "description": "Settings > Deploy > Health check > Test: the node agent of one running replica probes the path the way its health checks do and answers {available, ok, status, latency_ms, error, cell, slot, tested_at}. available false (with error) when no replica runs or its node can't test yet. Changes nothing.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "path": {
          "type": "string",
          "description": "starts with /, no spaces, up to 512 characters"
         }
        },
        "required": [
         "path"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "HealthTest",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/source/file": {
   "get": {
    "operationId": "clients_api_source_file",
    "summary": "Whether a file is on the branch",
    "description": "Settings > Build: whether a path (the root directory joined with the Dockerfile path) is in the service's GitHub repository on a branch (default the service's). {path, branch, found, checked}; found null and checked false when the service isn't built from GitHub or GitHub can't be asked.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "path",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "branch",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SourceFile",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/limits": {
   "put": {
    "operationId": "clients_api_limit_set",
    "summary": "Set service limit",
    "description": "Slider to stored desired state (limit lifecycle steps 1-3); validated against the plan limit and the one-node ceiling.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "cpu_millis": {
          "type": "integer"
         },
         "memory_mb": {
          "type": "integer"
         },
         "disk_mb": {
          "type": "integer",
          "minimum": 1024,
          "maximum": 102400,
          "multipleOf": 1024,
          "description": "optional; temporary disk quota of each replica in MB: whole GB, 1024 to 102400 (1 to 100 GB), a multiple of 1024; covers every write the app makes, wiped on every deploy or restart, billed by allocated size x time; raising applies live, lowering at the next deploy"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "LimitSet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/LimitSet"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/restore": {
   "post": {
    "operationId": "clients_api_restore",
    "summary": "Restore a backup",
    "description": "Owner restores a backup of a stateful service into a new volume (PDF 2.3 note: offer user-facing restore). No client contract for it existed (found walking L-2.3).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "bkp": {
          "type": "string"
         },
         "confirm": {
          "type": "boolean",
          "description": "explicit confirmation that the service moves to a new volume"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "RestoreAccepted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/RestoreAccepted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/variables": {
   "get": {
    "operationId": "clients_api_variables_list",
    "summary": "List a service's variables",
    "description": "Service panel > Variables: names, scopes and set-times only, never a value (a value comes back only through the reveal).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VariableList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "variables": {
           "type": "array",
           "description": "list of {name, kind, scope, version, has_value, ref_svc, ref_name, created_at, updated_at}",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/variables/{name}": {
   "put": {
    "operationId": "clients_api_variable_set",
    "summary": "Set a variable",
    "description": "Creates or replaces one variable. The value is sealed by cloud-core: builds get build and both values, the running service runtime and both values. It takes effect with the next deploy.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "value": {
          "type": "string",
          "description": "the value, at most 1 MiB; never returned by the list"
         },
         "scope": {
          "type": "string",
          "description": "runtime, build or both; absent: runtime for a new variable, unchanged otherwise"
         },
         "kind": {
          "type": "string",
          "description": "value (default) or shared: the variable takes the value of the environment's project variable ref_name"
         },
         "ref_name": {
          "type": "string",
          "description": "kind shared: the project variable's name"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "VariableSet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "scope": {
           "type": "string"
          },
          "version": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "delete": {
    "operationId": "clients_api_variable_delete",
    "summary": "Delete a variable",
    "description": "Removes the variable and its sealed value. It takes effect with the next deploy.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Deleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/variables/{name}/reveal": {
   "post": {
    "operationId": "clients_api_variable_reveal",
    "summary": "Reveal a variable's value",
    "description": "The only route that returns a value: audited, rate limited, no-store; cloud-core allows a developer or higher with access to the environment (viewers keep masked values).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VariableValue",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "scope": {
           "type": "string"
          },
          "version": {
           "type": "integer"
          },
          "value": {
           "type": "string"
          },
          "set_at": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/variables": {
   "get": {
    "operationId": "clients_api_shared_variables_list",
    "summary": "List the project variables of an environment",
    "description": "Project variables: names, versions, set-times and the services that use each (never a value), and every variable of the environment's services that takes its value from elsewhere (the graph).",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SharedVariableList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "variables": {
           "type": "array",
           "description": "list of {name, version, has_value, created_at, updated_at, used_by[{svc, service_name, name}]}",
           "items": {
            "type": "object"
           }
          },
          "links": {
           "type": "array",
           "description": "list of {svc, service_name, name, kind shared|reference, ref_svc, ref_name}",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/environments/{env}/variables/{name}": {
   "put": {
    "operationId": "clients_api_shared_variable_set",
    "summary": "Set a project variable",
    "description": "Creates or replaces a project variable (sealed; a developer or higher with access to the environment). The services that use it get it with their next deploy, at build and at run time.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "value": {
          "type": "string",
          "description": "at most 1 MiB"
         }
        },
        "required": [
         "value"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "SharedVariableSet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "version": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "delete": {
    "operationId": "clients_api_shared_variable_delete",
    "summary": "Delete a project variable",
    "description": "Refused while a service uses it.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Deleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/variables/{name}/reveal": {
   "post": {
    "operationId": "clients_api_shared_variable_reveal",
    "summary": "Reveal a project variable's value",
    "description": "Audited, rate limited, no-store; a developer or higher with access to the environment (viewers keep masked values).",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "SharedVariableValue",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "name": {
           "type": "string"
          },
          "version": {
           "type": "integer"
          },
          "value": {
           "type": "string"
          },
          "set_at": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/variables/reveal": {
   "post": {
    "operationId": "clients_api_variables_reveal_all",
    "summary": "Reveal every value of a service",
    "description": "The raw editor's reveal: every variable of the service with its value, in one call. Audited once, counted once against the reveal limits, no-store; a developer or higher with access to the environment.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VariableValues",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "variables": {
           "type": "array",
           "description": "list of {name, scope, version, value, set_at, kind, external}: a link's value is its {{ owner.NAME }} text; a value kept in the region's secrets service has value null and external true",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/shared-variables/reveal": {
   "post": {
    "operationId": "clients_api_shared_variables_reveal_all",
    "summary": "Reveal every project variable of an environment",
    "description": "The raw editor's reveal of the project variables: every value in one call. Audited once, counted once against the reveal limits, no-store; a developer or higher with access to the environment.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VariableValues",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "variables": {
           "type": "array",
           "description": "list of {name, scope, version, value, set_at, kind, external}: a link's value is its {{ owner.NAME }} text; a value kept in the region's secrets service has value null and external true",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/variables/graph": {
   "get": {
    "operationId": "clients_api_variables_graph",
    "summary": "The variables graph of an environment",
    "description": "Every owner (the project variables, then each service by name) with its variables (names, kinds, sections and places, links and the references in templates; never a value), the built-ins of each service (non-secret hosts and URLs), every reference as an edge (referenced variable to consuming variable and service) and the references that do not resolve as things stand. The Variables page's Form (\"Used by\") and Graph come from it. cloud-core's answer passed through.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VariablesGraph",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "owners": {
           "type": "array",
           "description": "list of {owner (project or the service name), kind project|service, svc, variables [{name, kind value|reference|shared, scope, version, group, position, has_value, external, template, link {owner, name} or null, refs [{owner, name, ref, problem}], created_at, updated_at}], builtins [{name, available, value, reason}]}",
           "items": {
            "type": "object"
           }
          },
          "edges": {
           "type": "array",
           "description": "list of {owner, name, svc, consumer, consumer_svc, variable, linked}",
           "items": {
            "type": "object"
           }
          },
          "issues": {
           "type": "array",
           "description": "list of {owner, variable, code, ref, message}",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/environments/{env}/variables/validate": {
   "post": {
    "operationId": "clients_api_variables_validate",
    "summary": "Check the raw editor's text",
    "description": "The raw editor's text of one owner (svc, or the project variables when absent): NAME=value lines, `# ` section headings, values bare or quoted, the mask (eight bullets) keeping a stored value. Answers per-line diagnostics (invalid line or name, duplicate, reserved DISPRA_ name, unknown owner or name in a {{ owner.NAME }} reference, cycle, too deep, text that looks like a reference and is not one) and the completion list (owners, then their names and the built-ins). Nothing is saved.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "svc": {
          "type": "string",
          "description": "a service of the environment; absent: the project variables"
         },
         "text": {
          "type": "string",
          "description": "at most 4 MiB"
         }
        },
        "required": [
         "text"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "VariablesValidation",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "diagnostics": {
           "type": "array",
           "description": "list of {line, start, end, severity error|warning, code, message}",
           "items": {
            "type": "object"
           }
          },
          "completions": {
           "type": "object",
           "description": "{owners: [{owner, kind, svc, names}]}"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/variables/batch": {
   "post": {
    "operationId": "clients_api_variables_batch",
    "summary": "Save several variables at once",
    "description": "Applies 1 to 500 changes in one transaction, all or nothing: the raw editor's save (adds, changes, removals, sections and order) and Share into... (one linked variable in each chosen service). A change is {svc (absent: a project variable), name, value | delete: true, scope, group, position}; with neither value nor delete only the section and place change. Answers the results and the warnings of the variables it set.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "changes": {
          "type": "array",
          "description": "1 to 500 of {svc, name, value, delete, scope, group, position}",
          "items": {
           "type": "object"
          }
         }
        },
        "required": [
         "changes"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "VariablesBatch",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "results": {
           "type": "array",
           "description": "per change: {svc, name, status set|deleted|placed, kind, version}",
           "items": {
            "type": "object"
           }
          },
          "warnings": {
           "type": "array",
           "description": "list of {code, var, ref, owner, name, message}",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/commits": {
   "get": {
    "operationId": "clients_api_service_commits",
    "summary": "Commit headlines for the deployments list",
    "description": "The headline and author of commits of the service's GitHub repository, read from GitHub when asked and never stored (cloud-core decision X1). Anyone who can see the project.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "sha",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "1 to 30 full commit SHAs, comma separated"
     }
    ],
    "responses": {
     "200": {
      "description": "CommitList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "commits": {
           "type": "array",
           "description": "list of {sha, message, author_name, author_login, committed_at}; a SHA GitHub does not know is left out",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/deployments/{dep}": {
   "get": {
    "operationId": "clients_api_deployment_get",
    "summary": "One deployment of a service, with its steps",
    "description": "Service panel > Deployments > a deployment: what it was built from, how it ended (failure_reason) and its applied state changes oldest first (transitions, for the Build / Deploy / Health check / Live steps and their durations). A deployment of another service is not found.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "dep",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "DeploymentDetail",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "dep": {
           "type": "string"
          },
          "svc": {
           "type": "string"
          },
          "state": {
           "type": "string"
          },
          "branch": {
           "type": "string"
          },
          "sha": {
           "type": "string"
          },
          "trigger": {
           "type": "string",
           "description": "what started it: dashboard, github (a push to the connected branch), dispra_yaml (an apply or a CLI deploy), api (a developer key)"
          },
          "action": {
           "type": "string",
           "description": "deploy, redeploy or rollback"
          },
          "created_at": {
           "type": "integer"
          },
          "finished_at": {
           "type": "integer"
          },
          "error_code": {
           "type": "string"
          },
          "failure_reason": {
           "type": "string",
           "nullable": true
          },
          "transitions": {
           "type": "array",
           "description": "list of {state, at (unix seconds)}, oldest first",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/deployments/{dep}/cancel": {
   "post": {
    "operationId": "clients_api_deployment_cancel",
    "summary": "Cancel a deployment that is on its way",
    "description": "Deployment page > Cancel: stops a queued, building or starting deployment; the running version keeps serving. Developers and up. A deployment that has already finished (live, failed, superseded, rolled back) is refused with 409 deployment_finished.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "dep",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "DeploymentCancelled",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "dep": {
           "type": "string"
          },
          "state": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "deploy"
   }
  },
  "/v1/cloud/services/{svc}/restart": {
   "post": {
    "operationId": "clients_api_service_restart",
    "summary": "Restart a service",
    "description": "Service menu > Restart, dcloud restart: its replicas start again from the live deployment, no build. A service with a volume stops, then starts (never two copies). Developers and up; developer keys with deploy access. A service that is not running is refused with 409 not_running.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "202": {
      "description": "Restart",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "svc": {
           "type": "string"
          },
          "status": {
           "type": "string",
           "description": "restarting"
          },
          "stateful": {
           "type": "boolean",
           "description": "the service has a volume, so it is stopped, then started"
          },
          "already_pending": {
           "type": "boolean",
           "description": "a restart was still on its way, so no second one was queued"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "deploy"
   }
  },
  "/v1/cloud/services/{svc}/uploads": {
   "post": {
    "operationId": "clients_api_upload_create",
    "summary": "Create an upload",
    "description": "dcloud deploy of a service deployed from a dispra.yaml file: the link to send the folder's source archive (a gzip tar) straight to the uploads bucket. PUT the archive to upload_url with exactly the headers answered (Content-Length is signed; at most 512 MiB), then deploy it with Create a deployment {action: deploy, upload_ref}. The link is valid 15 minutes. Developers and up; developer keys with deploy access.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "sha256",
         "size_bytes"
        ],
        "properties": {
         "sha256": {
          "type": "string",
          "description": "the archive's SHA-256, 64 hex characters"
         },
         "size_bytes": {
          "type": "integer",
          "description": "the archive's size, 1 byte to 512 MiB"
         }
        }
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Upload link",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "upload_ref": {
           "type": "string",
           "description": "uploads/<svc>/<sha256>.tar.gz, what Create a deployment takes as upload_ref"
          },
          "upload_url": {
           "type": "string",
           "description": "a presigned PUT for exactly this archive and size, valid 15 minutes (a secret)"
          },
          "method": {
           "type": "string",
           "description": "PUT"
          },
          "headers": {
           "type": "object",
           "description": "the headers the PUT must carry (Content-Type, Content-Length)"
          },
          "expires_at": {
           "type": "string"
          },
          "max_bytes": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "deploy"
   }
  },
  "/v1/cloud/services/{svc}/stop": {
   "post": {
    "operationId": "clients_api_service_stop",
    "summary": "Stop a service",
    "description": "Service menu > Stop, dcloud stop: the service (and its copies in other regions) stops and stays stopped until started; its place on the node is kept, so start needs no build. Developers and up; developer keys with deploy access. Stopping it again answers the same. A service Dispra stopped is refused with 409 not_running.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Stop",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "svc": {
           "type": "string"
          },
          "state": {
           "type": "string",
           "description": "stopped"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "deploy"
   }
  },
  "/v1/cloud/services/{svc}/start": {
   "post": {
    "operationId": "clients_api_service_start",
    "summary": "Start a stopped service",
    "description": "Service menu > Start, dcloud start: a service its owner stopped runs again. Developers and up; developer keys with deploy access. Starting a running service answers the same. A service Dispra stopped (out of credits, a hold, a volume restore) is refused with 409 not_startable; it starts again by itself once that is resolved.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Start",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "svc": {
           "type": "string"
          },
          "state": {
           "type": "string",
           "description": "active"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "deploy"
   }
  },
  "/v1/cloud/services/{svc}/console": {
   "post": {
    "operationId": "clients_api_service_console",
    "summary": "Open a terminal shell in a service (dcloud ssh)",
    "description": "dcloud ssh: mints a 5-minute, single-use token for one shell in one running replica. The CLI opens a WebSocket to ws_url (cell_endpoint + /v1/console/connect?token=...), without a browser Origin: a page can never use this token. Binary frames carry the terminal, text frames {\"t\":\"resize\",\"cols\":n,\"rows\":n}. Developers and up; developer keys with full access. 409 console_unavailable while the region's console is not open yet, 409 not_running without a running replica.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ConsoleToken",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "token": {
           "type": "string",
           "description": "secret, single use, 5 minutes"
          },
          "cell_endpoint": {
           "type": "string"
          },
          "ws_url": {
           "type": "string",
           "description": "the WebSocket to open, token included"
          },
          "expires_at": {
           "type": "string"
          },
          "idle_timeout_s": {
           "type": "integer"
          },
          "max_session_s": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/metrics": {
   "get": {
    "operationId": "clients_api_service_metrics",
    "summary": "A service's metrics, per replica and in all",
    "description": "Service panel > Metrics: CPU, memory and network out per replica and for the service over a range, from the agents' one-minute usage windows, and the disk of its volumes. Requests and latency are not measured yet (not_measured says so).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "range",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "1h",
        "3h",
        "24h",
        "7d",
        "30d"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceMetrics",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "range": {
           "type": "string"
          },
          "step_s": {
           "type": "integer"
          },
          "since": {
           "type": "string"
          },
          "limits": {
           "type": "object"
          },
          "series": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "replicas": {
           "type": "array",
           "items": {
            "type": "object"
           }
          },
          "disk": {
           "type": "object"
          },
          "not_measured": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/settings": {
   "get": {
    "operationId": "clients_api_service_settings_read",
    "summary": "Read service settings",
    "description": "Service panel > Settings: source, build, deploy and resource settings in force, plus the values the platform derives and the customer cannot set (health path from the image, stop grace).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceSettings",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceSettings"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "patch": {
    "operationId": "clients_api_service_update",
    "summary": "Update service settings",
    "description": "Commit the staged settings changes of a service in one atomic update, under optimistic concurrency. The answer says whether the change applied now or needs a redeploy (which the API starts through the normal deploy path when the caller asked for it).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "a new name for the service: unique in its environment, 1 to 63 characters (letters, digits, space . _ -), not \"project\". References to it by name ({{ name.NAME }}) in the environment's variables are rewritten in the same change."
         },
         "base_generation": {
          "type": "string",
          "description": "the generation the client edited; a stale one is refused with API_STALE_GENERATION"
         },
         "redeploy": {
          "type": "string",
          "description": "0 or 1: start a deploy when the change needs one"
         },
         "source_kind": {
          "type": "string",
          "description": "repo or image; omit to leave unchanged"
         },
         "repo_id": {
          "type": "string",
          "description": "the linked repository (id), changed only through the repository picker; omit to leave unchanged"
         },
         "branch": {
          "type": "string",
          "description": "omit to leave unchanged"
         },
         "root_dir": {
          "type": "string",
          "description": "monorepo root directory; omit to leave unchanged"
         },
         "watch_paths": {
          "type": "array",
          "items": {
           "type": "object",
           "additionalProperties": true
          },
          "description": "paths whose changes trigger a deploy; omit to leave unchanged"
         },
         "image_ref": {
          "type": "string",
          "description": "Docker image source (registry/name:tag), when source_kind is image; omit to leave unchanged"
         },
         "builder": {
          "type": "string",
          "description": "railpack, dockerfile or image; omit to leave unchanged"
         },
         "dockerfile_path": {
          "type": "string",
          "description": "omit to leave unchanged"
         },
         "build_cmd": {
          "type": "string",
          "description": "optional override of the detected build command; omit to leave unchanged"
         },
         "start_cmd": {
          "type": "string",
          "description": "optional override of the image or detected start command; omit to leave unchanged"
         },
         "restart_policy": {
          "type": "string",
          "description": "always, on_failure or never; omit to leave unchanged"
         },
         "max_restarts": {
          "type": "string",
          "description": "for on_failure; 0 = unlimited with backoff; omit to leave unchanged"
         },
         "cpu_millis": {
          "type": "string",
          "description": "omit to leave unchanged"
         },
         "memory_mb": {
          "type": "string",
          "description": "omit to leave unchanged"
         },
         "disk_mb": {
          "type": "integer",
          "minimum": 1024,
          "maximum": 102400,
          "multipleOf": 1024,
          "description": "temporary disk quota of each replica in MB: whole GB, 1024 to 102400 (1 to 100 GB), a multiple of 1024; covers every write the app makes, wiped on every deploy or restart, billed by allocated size x time; raising applies live, lowering at the next deploy; omit to leave unchanged"
         },
         "replicas": {
          "type": "integer",
          "description": "1 to 10, effective on the next deployment (needs_redeploy); more than 1 is refused with service_replicas_volume while the service has a volume; omit to leave unchanged"
         },
         "concurrency_per_replica": {
          "type": "integer",
          "description": "1 to 100000, or null to clear; applies at once (a global application publishes replicas x this as the member's capacity); omit to leave unchanged"
         },
         "healthcheck_path": {
          "type": "string",
          "description": "the path the node agent probes (starts with /, no spaces, up to 512 characters); null or \"\" clears it (the image's or the agent's default applies again); applies at once; omit to leave unchanged"
         },
         "healthcheck_port": {
          "type": "integer",
          "nullable": true,
          "description": "the port the check probes when it is not the service's, 1 to 65535; null clears it (the default applies again); applies at once; omit to leave unchanged"
         },
         "healthcheck_start_period_s": {
          "type": "integer",
          "nullable": true,
          "description": "seconds after start before failed checks count, 0 to 600 (default 5); null clears it (the default applies again); applies at once; omit to leave unchanged"
         },
         "healthcheck_interval_s": {
          "type": "integer",
          "nullable": true,
          "description": "seconds between checks, 1 to 300 (default 5); null clears it (the default applies again); applies at once; omit to leave unchanged"
         },
         "healthcheck_timeout_s": {
          "type": "integer",
          "nullable": true,
          "description": "seconds before one check fails, 1 to 60 and below the interval (default 3); null clears it (the default applies again); applies at once; omit to leave unchanged"
         },
         "healthcheck_failure_threshold": {
          "type": "integer",
          "nullable": true,
          "description": "consecutive failures before the service is unhealthy, 1 to 20 (default 3); null clears it (the default applies again); applies at once; omit to leave unchanged"
         },
         "healthcheck_restart_after": {
          "type": "integer",
          "nullable": true,
          "description": "consecutive failures while unhealthy before one restart, 1 to 20 (default never); null clears it (the default applies again); applies at once; omit to leave unchanged"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ServiceSettingsUpdated",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceSettingsUpdated"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/regions": {
   "get": {
    "operationId": "clients_api_service_regions",
    "summary": "Regions of a service",
    "description": "Service panel > Settings > Scale: the regions the service runs in, its own (the primary) first, then each regional copy (cloud-core GET /v1/services/{svc}/regions). A copy's id answers for its primary.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceRegionList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceRegionList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "post": {
    "operationId": "clients_api_service_region_add",
    "summary": "Add a region to a service",
    "description": "Runs a service without a volume in one more region: a regional copy with the same source, settings, limits and variables, joined to the service's global application (made on the first added region). Refused with region_not_eligible (it has a volume), region_exists, region_unavailable, region_references (reference variables point at services that do not run there) or region_copy (addressed to a copy).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "region": {
          "type": "string",
          "description": "india or us"
         },
         "replicas": {
          "type": "integer",
          "description": "1 to 10; absent = the primary's replica count"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "ServiceRegionAdded",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceRegionAdded"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/regions/{region}": {
   "patch": {
    "operationId": "clients_api_service_region_set",
    "summary": "Set one region's replica count",
    "description": "The replica count of the service in one region (its own region too); effective on the next deployment (apply needs_redeploy) unless unchanged (applied_now).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "region",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "india or us"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "replicas": {
          "type": "integer",
          "description": "1 to 10"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "ServiceRegionSet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceRegionSet"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "delete": {
    "operationId": "clients_api_service_region_remove",
    "summary": "Remove a region from a service",
    "description": "Deletes the service's regional copy in that region like any service (a 7-day window). Any region can go while another one runs the service, the service's own region too (it then runs no replicas there: it reads with replicas 0, and adding the region again deploys it there). The only region it runs in cannot go (region_last): delete the service instead.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "region",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "india or us"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "ServiceRegionRemoved",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/ServiceRegionRemoved"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/endpoints": {
   "get": {
    "operationId": "clients_api_endpoints_list",
    "summary": "Endpoints of a service",
    "description": "Service panel > Settings > Networking: every way into the service in one list (cloud-core GET /v1/services/{svc}/endpoints): public HTTP and public TCP names, private names (the whole service, or one replica), and its custom domains (custom true). The service's own first, then the replicas'.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "EndpointList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/EndpointList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "post": {
    "operationId": "clients_api_endpoint_create",
    "summary": "Generate an endpoint",
    "description": "Service panel > Settings > Networking > Generate domain: a new generated name forwarding to a container port. public_http answers https://<name>.dispracloud.app; public_tcp gets its own public port (open to the internet); private is reachable only from the project's own services, for the whole service (load balanced) or one running replica (scope replica, with its cell and slot; 404 when no such replica runs). Refused with endpoint_port_taken (the same type, scope and container port exists; a replica's: the same replica), tcp_ports_exhausted, or region_copy (addressed to a regional copy).",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string",
          "description": "public_http, public_tcp or private"
         },
         "port": {
          "type": "integer",
          "description": "the container port, 1 to 65535"
         },
         "scope": {
          "type": "string",
          "description": "service (the default) or replica: replica is only for private"
         },
         "cell": {
          "type": "string",
          "description": "scope replica only, the cell the replica runs in"
         },
         "slot": {
          "type": "integer",
          "description": "scope replica only, the replica's slot, 0 to 9"
         },
         "name": {
          "type": "string",
          "description": "public_http and public_tcp only, optional: the address to use, <name>.dispracloud.app (3 to 40 of a-z, 0-9 and dashes, starting with a letter); absent = a generated name. Check it first with GET endpoints/name"
         }
        },
        "required": [
         "type",
         "port"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Endpoint",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Endpoint"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/endpoints/{id}": {
   "patch": {
    "operationId": "clients_api_endpoint_update",
    "summary": "Change an endpoint's container port",
    "description": "The container port the endpoint forwards to; takes effect without a redeploy and keeps the id and name. Refused with endpoint_port_taken or region_copy.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "the endpoint's id (stable across a port change, new on regenerate)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "port": {
          "type": "integer",
          "description": "the container port, 1 to 65535"
         }
        },
        "required": [
         "port"
        ],
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Endpoint",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Endpoint"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "delete": {
    "operationId": "clients_api_endpoint_remove",
    "summary": "Remove an endpoint",
    "description": "The endpoint stops answering at once. Refused with region_copy.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "the endpoint's id (stable across a port change, new on regenerate)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "EndpointRemoved",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/EndpointRemoved"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/services/{svc}/endpoints/{id}/regenerate": {
   "post": {
    "operationId": "clients_api_endpoint_regenerate",
    "summary": "Regenerate an endpoint",
    "description": "A new id and random name (and, for public_tcp, a new public port) for the endpoint; the old ones stop working at once and whatever used them needs the new address. Nothing is redeployed. Refused with endpoint_not_regenerable (a custom domain) or region_copy.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "the endpoint's id (stable across a port change, new on regenerate)"
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "description": "empty",
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Endpoint",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Endpoint"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/environments/{env}/volumes": {
   "get": {
    "operationId": "clients_api_env_volumes",
    "summary": "Volumes of an environment",
    "description": "Board > Volumes row: the environment's volumes (live ones, and deleted ones in their 7-day window), each with its attachments, size, used bytes and last backup (cloud-core GET /v1/environments/{env}/volumes).",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VolumeList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "post": {
    "operationId": "clients_api_volume_create",
    "summary": "Create a volume",
    "description": "Board > New volume: a standalone volume in the environment (on one machine of the environment's region, encrypted, with its key). It is attached to services separately. Refused with volume_name_taken.",
    "parameters": [
     {
      "name": "env",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "1 to 63 characters: lowercase letters, digits and hyphens"
         },
         "size_bytes": {
          "type": "integer",
          "description": "1 GiB to 1 TiB"
         },
         "recordsize_kind": {
          "type": "string",
          "description": "general (default) or db"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Volume",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Volume"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/volumes/{vol}": {
   "get": {
    "operationId": "clients_api_volume_get",
    "summary": "Volume",
    "description": "Volume panel: one volume with its attachments, node, region, size, used bytes, state and backup policy.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Volume",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Volume"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "patch": {
    "operationId": "clients_api_volume_update",
    "summary": "Change a volume",
    "description": "Volume panel > Settings: rename, resize (a shrink needs confirm) and the backup policy.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "new name"
         },
         "size_bytes": {
          "type": "integer",
          "description": "new size, 1 GiB to 1 TiB"
         },
         "confirm": {
          "type": "boolean",
          "description": "true to shrink"
         },
         "backup_policy": {
          "type": "object",
          "description": "{enabled?, interval_s?, retention?}"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Volume",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Volume"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   },
   "delete": {
    "operationId": "clients_api_volume_delete",
    "summary": "Delete a volume",
    "description": "Deletes a volume with a 7-day window (undelete brings it back). Refused with volume_attached while any service uses it: detach it first.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VolumeDeleted",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeDeleted"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/volumes/{vol}/undelete": {
   "post": {
    "operationId": "clients_api_volume_undelete",
    "summary": "Undelete a volume",
    "description": "Brings back a deleted volume within its 7-day window.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Volume",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/Volume"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/volumes/{vol}/attachments": {
   "post": {
    "operationId": "clients_api_volume_attach",
    "summary": "Attach a volume to a service",
    "description": "Service panel > Settings > Volumes: mounts the volume in a service of the same environment at mount_path, from the service's next deployment (needs_redeploy; the call does not deploy). Refused with volume_not_eligible (more than one replica, or several regions), volume_mount_taken or volume_node_conflict.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "svc": {
          "type": "string",
          "description": "a service of the volume's environment"
         },
         "mount_path": {
          "type": "string",
          "description": "absolute, not / and not under /proc, /sys, /dev or /run; at most 255 characters"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "VolumeAttachment",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeAttachment"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/volumes/{vol}/attachments/{svc}": {
   "delete": {
    "operationId": "clients_api_volume_detach",
    "summary": "Detach a volume from a service",
    "description": "Unmounts the volume from the service from its next deployment (needs_redeploy). The volume and its data stay.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VolumeDetached",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeDetached"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/volumes/{vol}/backups": {
   "get": {
    "operationId": "clients_api_volume_backups",
    "summary": "Backups of a volume",
    "description": "Volume panel > Deployments: the volume's backups, newest first.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VolumeBackupList",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeBackupList"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   },
   "post": {
    "operationId": "clients_api_volume_backup",
    "summary": "Back up a volume now",
    "description": "Volume panel > Deployments > Back up now: requests a backup of the volume.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "VolumeBackupRequested",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeBackupRequested"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/volumes/{vol}/restores": {
   "post": {
    "operationId": "clients_api_volume_restore",
    "summary": "Restore a backup into a new volume",
    "description": "Restores a backup (the newest by default) into a NEW volume in the same environment, named <name>-restore-N. The live volume is untouched.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "bkp": {
          "type": "string",
          "description": "the backup; absent = the newest"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "VolumeRestored",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeRestored"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/volumes/{vol}/activity": {
   "get": {
    "operationId": "clients_api_volume_activity",
    "summary": "Activity of a volume",
    "description": "Volume panel > Deployments: what happened to the volume (create, rename, resize, backup policy, attach, detach, backup, restore, delete, undelete), newest first, at most 100.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "VolumeActivity",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeActivity"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/volumes/{vol}/metrics": {
   "get": {
    "operationId": "clients_api_volume_metrics",
    "summary": "Metrics of a volume",
    "description": "Volume panel > Metrics: used and provisioned bytes over a range. Reads and writes are not measured yet.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "range",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "1h, 3h, 24h, 7d or 30d (default 1h)"
     }
    ],
    "responses": {
     "200": {
      "description": "VolumeMetrics",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "$ref": "#/components/schemas/VolumeMetrics"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/volumes/{vol}/group": {
   "put": {
    "operationId": "clients_api_volume_group_set",
    "summary": "Put a volume in a group, or in none",
    "description": "Service groups: named, ordered sections of an environment's board (cloud-core migrations 0027, 0035). They organise the board only. A volume is a board item like a service: it shares its section's order with the services. A group of another environment is not found (404).",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "grp": {
          "type": "string",
          "description": "a group of the volume's environment; null: no group"
         },
         "position": {
          "type": "integer",
          "minimum": 0,
          "description": "0-based place among the section's services and volumes (the group's, or the ungrouped ones on top); absent: last"
         }
        },
        "additionalProperties": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "VolumeGroupSet",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object",
           "properties": {
            "vol": {
             "type": "string"
            },
            "grp": {
             "type": "string",
             "description": "null: no group"
            },
            "position": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/api-calls": {
   "get": {
    "operationId": "clients_api_api_calls_list",
    "summary": "Calls made with the project's keys",
    "description": "Developer > API calls: every call made with the project's keys (refused and rate-limited ones too), kept 30 days, with the last 24 hours' summary. Slow is 1 s or more. Project admin.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "key",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "a tok_ to narrow to one key"
      }
     },
     {
      "name": "filter",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "errors, slow or all"
      }
     },
     {
      "name": "endpoint",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "a route template"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "request id, path or IP"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "RFC 3339"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "page size, 1 to 100"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "cloud-core's answer, passed through",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhook-secret": {
   "get": {
    "operationId": "clients_api_webhook_secret_get",
    "summary": "The project's webhook signing secret, masked",
    "description": "One signing secret per project signs every delivery (X-Dispra-Signature). Project admin.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "cloud-core's answer, passed through",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhook-secret/reveal": {
   "post": {
    "operationId": "clients_api_webhook_secret_reveal",
    "summary": "Reveal the webhook signing secret",
    "description": "Answers the secret in full; audited. Project admin.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "cloud-core's answer, passed through",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhook-secret/rotate": {
   "post": {
    "operationId": "clients_api_webhook_secret_rotate",
    "summary": "Rotate the webhook signing secret",
    "description": "A new secret signs every delivery from now on; answered once. Project admin.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "cloud-core's answer, passed through",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhooks/{whk}/test": {
   "post": {
    "operationId": "clients_api_webhook_test",
    "summary": "Send a test delivery",
    "description": "Queues a webhook.test delivery to the endpoint. Project admin.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "whk",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "cloud-core's answer, passed through",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/projects/{prj}/webhook-deliveries": {
   "get": {
    "operationId": "clients_api_project_webhook_deliveries",
    "summary": "Deliveries of every webhook of the project",
    "description": "Newest first; failed deliveries are retried 5 times over 1 hour, then given up. Project admin.",
    "parameters": [
     {
      "name": "prj",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "state",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "failed to narrow to failed deliveries"
      }
     },
     {
      "name": "event",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "an event type"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "opaque paging cursor"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "cloud-core's answer, passed through",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "data": {
           "type": "object"
          }
         }
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "full"
   }
  },
  "/v1/cloud/deployments/{dep}/logs/stream": {
   "get": {
    "operationId": "clients_api_deployment_logs_stream",
    "summary": "Stream a deployment's logs",
    "description": "Server-Sent Events: event line {at, level, message, replica?}, a heartbeat comment every 15 s; kind=build ends with event end {state} when the deployment reaches a terminal state. since (RFC 3339) or Last-Event-ID resumes; svc names the deployment's service when the caller belongs to several organisations.",
    "parameters": [
     {
      "name": "dep",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "build or live (default build)"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "RFC 3339: only lines after it"
      }
     },
     {
      "name": "svc",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "the deployment's service (optional)"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "event stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/services/{svc}/logs/stream": {
   "get": {
    "operationId": "clients_api_service_logs_stream",
    "summary": "Stream a service's live logs",
    "description": "Server-Sent Events of the live output of the service's active deployment: event line {at, level, message, replica?}, a heartbeat comment every 15 s. since or Last-Event-ID resumes.",
    "parameters": [
     {
      "name": "svc",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "RFC 3339: only lines after it"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "event stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  },
  "/v1/cloud/volumes/{vol}/events/stream": {
   "get": {
    "operationId": "clients_api_volume_events_stream",
    "summary": "Stream a volume's events",
    "description": "Server-Sent Events of the volume's backups, restores, attaches and detaches: event line {at, level, message}, a heartbeat comment every 15 s. since or Last-Event-ID resumes.",
    "parameters": [
     {
      "name": "vol",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "since",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "RFC 3339: only events after it"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "event stream",
      "content": {
       "text/event-stream": {
        "schema": {
         "type": "string"
        }
       }
      }
     },
     "default": {
      "description": "error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    },
    "x-key-access": "read"
   }
  }
 },
 "components": {
  "schemas": {
   "SearchResult": {
    "type": "object",
    "properties": {
     "items": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {kind (project, service, volume, group), id, name, prj, project_name, env, env_name (empty for a project), grp and group_name (the group a service or volume is in, and a group itself; else null), and by kind: project and group {service_count, volume_count} (live ones), service {state (active, stopped), replicas, dep_state (its latest deployment's state, or null)}, volume {size_bytes, used_bytes (null until reported)}}, best match first"
     },
     "counts": {
      "type": "object",
      "additionalProperties": true,
      "description": "{project, service, volume, group}: how many items of each kind match the query, before kind and limit"
     }
    },
    "required": [
     "items",
     "counts"
    ]
   },
   "Onboarding": {
    "type": "object",
    "properties": {
     "done": {
      "type": "boolean"
     },
     "completed_at": {
      "type": "string",
      "nullable": true,
      "description": "RFC3339, when it was first marked done"
     },
     "via": {
      "type": "string",
      "nullable": true,
      "description": "later or service"
     }
    },
    "required": [
     "done"
    ]
   },
   "ActivityList": {
    "type": "object",
    "properties": {
     "events": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {evt, at, kind (deploy, error, config, backup), action, svc, vol, name (the service or volume name), dep, actor, actor_name (who, in words), summary (a sentence)}; deploy steps are left out"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "events",
     "next_cursor"
    ]
   },
   "AiLogsToken": {
    "type": "object",
    "properties": {
     "token": {
      "type": "string",
      "description": "SECRET: Factory run token (scope ai:runs, row-level predicate bound), 15 minutes"
     },
     "factory_endpoint": {
      "type": "string"
     },
     "predicate": {
      "type": "string",
      "description": "the predicate in force, as ids only: cell + prj + svc list + window"
     },
     "expires_at": {
      "type": "string"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "token",
     "factory_endpoint",
     "predicate",
     "expires_at"
    ]
   },
   "ConsoleToken": {
    "type": "object",
    "properties": {
     "token": {
      "type": "string",
      "description": "SECRET: signed, 5 minutes, scope console, bound to usr, prj, svc and cell"
     },
     "cell_endpoint": {
      "type": "string"
     },
     "expires_at": {
      "type": "string"
     },
     "idle_timeout_s": {
      "type": "string",
      "description": "600"
     },
     "max_session_s": {
      "type": "string",
      "description": "3600"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "token",
     "cell_endpoint",
     "expires_at",
     "idle_timeout_s",
     "max_session_s"
    ]
   },
   "DeployAccepted": {
    "type": "object",
    "properties": {
     "dep": {
      "type": "string",
      "description": "deployment id, also the correlation id"
     },
     "status": {
      "type": "string",
      "description": "accepted, refused_suspended, refused_unverified"
     }
    },
    "required": [
     "dep",
     "status"
    ]
   },
   "DeploymentList": {
    "type": "object",
    "properties": {
     "deployments": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {dep, state, branch, sha, trigger (what started it - dashboard, github, dispra_yaml or api), action (deploy, redeploy or rollback), created_at, finished_at, error_code, failure_reason (health_check_timeout, crash_on_start, oom_on_start, other; null unless failed)}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "deployments",
     "next_cursor"
    ]
   },
   "DomainAdded": {
    "type": "object",
    "properties": {
     "dom": {
      "type": "string"
     },
     "cname_target": {
      "type": "string",
      "description": "our generated hostname"
     },
     "txt_name": {
      "type": "string",
      "description": "verification record name"
     },
     "txt_value": {
      "type": "string",
      "description": "random proof token"
     },
     "apex_ips": {
      "type": "string",
      "description": "cell reserved IPs for apex A records"
     }
    },
    "required": [
     "dom",
     "cname_target",
     "txt_name",
     "txt_value",
     "apex_ips"
    ]
   },
   "DomainList": {
    "type": "object",
    "properties": {
     "domains": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of domain objects (CustomDomain)"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "domains",
     "next_cursor"
    ]
   },
   "DomainRemoved": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "removed (route revoked in the control plane; the edge applies it on the next table version)"
     }
    },
    "required": [
     "status"
    ]
   },
   "DomainUpdated": {
    "type": "object",
    "properties": {
     "dom": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "dom",
     "status"
    ]
   },
   "CustomDomain": {
    "type": "object",
    "properties": {
     "dom": {
      "type": "string"
     },
     "domain": {
      "type": "string"
     },
     "svc": {
      "type": "string"
     },
     "prj": {
      "type": "string"
     },
     "env": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "pending_dns, verifying, issuing_certificate, active or failed"
     },
     "reason": {
      "type": "string",
      "description": "why it failed (dns_timeout, dns_lapsed, certificate) or empty"
     },
     "message": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "description": "the row (pending, verified, failed, lapsed)"
     },
     "port": {
      "type": "integer"
     },
     "apex": {
      "type": "boolean",
      "description": "a zone apex (A records, no CNAME)"
     },
     "global": {
      "type": "boolean",
      "description": "served by every region's edge"
     },
     "target": {
      "type": "string",
      "description": "the CNAME target"
     },
     "edge_ips": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "records": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {type, name, relative_name, value, purpose (routing|ownership), ok (null before the first check), found, message}"
     },
     "provider": {
      "type": "object",
      "additionalProperties": true,
      "description": "{id (cloudflare, route53, godaddy, namecheap, google, ..., other), name, zone, nameservers} or null"
     },
     "proxied": {
      "type": "boolean"
     },
     "cert": {
      "type": "object",
      "additionalProperties": true,
      "description": "{state (none, issuing, active, failed), checked_at, not_after, since, edges [{ip, ok, not_after, issuer, error}]}"
     },
     "certificate": {
      "type": "string",
      "description": "none, issuing, active or failed"
     },
     "next_check_at": {
      "type": "string"
     },
     "last_checked_at": {
      "type": "string"
     },
     "verified_at": {
      "type": "string"
     },
     "connect": {
      "type": "object",
      "additionalProperties": true,
      "description": "{supported (true only while the domain is unverified and its DNS provider offers Domain Connect with the Dispra template), provider_id, provider_name (the DNS provider's display name, e.g. Cloudflare, GoDaddy; both empty when not supported)}"
     }
    },
    "required": [
     "dom",
     "domain",
     "status",
     "records"
    ]
   },
   "DomainConnect": {
    "type": "object",
    "properties": {
     "url": {
      "type": "string",
      "description": "the signed Domain Connect apply URL at the DNS provider"
     },
     "state": {
      "type": "string",
      "description": "random, passed back by the provider on the redirect"
     },
     "provider_id": {
      "type": "string"
     },
     "provider_name": {
      "type": "string"
     },
     "domain": {
      "type": "string",
      "description": "the zone the template is applied to"
     },
     "host": {
      "type": "string",
      "description": "the label(s) under the zone, empty for the zone apex"
     },
     "service_id": {
      "type": "string",
      "description": "customdomain or customdomain-apex"
     },
     "width": {
      "type": "integer",
      "description": "the provider's preferred popup width (default 750)"
     },
     "height": {
      "type": "integer",
      "description": "the provider's preferred popup height (default 750)"
     }
    },
    "required": [
     "url",
     "state",
     "provider_id",
     "provider_name",
     "domain",
     "host",
     "service_id"
    ]
   },
   "EnvironmentCreated": {
    "type": "object",
    "properties": {
     "env": {
      "type": "string",
      "description": "new environment"
     },
     "status": {
      "type": "string",
      "description": "created or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "env",
     "status"
    ]
   },
   "EnvironmentDeleted": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "scheduled or refused"
     },
     "recoverable_until": {
      "type": "integer",
      "description": "unix time"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "status",
     "recoverable_until"
    ]
   },
   "EnvironmentList": {
    "type": "object",
    "properties": {
     "environments": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {env, name, is_production, service_count, status (ok, deploying, needs_attention, empty), created_at}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "environments",
     "next_cursor"
    ]
   },
   "LimitSet": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "applied, refused_plan_limit or refused_node_size"
     },
     "generation": {
      "type": "integer",
      "description": "desired-state generation that carries the new limit"
     }
    },
    "required": [
     "status",
     "generation"
    ]
   },
   "ProjectCreated": {
    "type": "object",
    "properties": {
     "prj": {
      "type": "string",
      "description": "new project"
     },
     "env": {
      "type": "string",
      "description": "its `production` environment, created with the project"
     },
     "cell": {
      "type": "string",
      "description": "cell the project is pinned to"
     },
     "status": {
      "type": "string",
      "description": "created or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_GATE_REFUSED etc, else empty"
     }
    },
    "required": [
     "prj",
     "env",
     "cell",
     "status"
    ]
   },
   "DeleteAccepted": {
    "type": "object",
    "properties": {
     "job": {
      "type": "string",
      "description": "teardown job scoped to the service"
     },
     "status": {
      "type": "string",
      "description": "accepted, or refused when confirm is not true"
     }
    },
    "required": [
     "job",
     "status"
    ]
   },
   "ProjectDeleteAccepted": {
    "type": "object",
    "properties": {
     "prj": {
      "type": "string"
     },
     "job": {
      "type": "string",
      "description": "always empty (the teardown runs in cloud-core; its progress is the project's deletion)"
     },
     "status": {
      "type": "string",
      "description": "deleting"
     },
     "error_code": {
      "type": "string",
      "description": "empty"
     }
    },
    "required": [
     "prj",
     "job",
     "status"
    ]
   },
   "Project": {
    "type": "object",
    "properties": {
     "prj": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "description": {
      "type": "string"
     },
     "region": {
      "type": "string"
     },
     "cell": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "description": "cloud-core's project state (active, deleting)"
     },
     "created_at": {
      "type": "string",
      "description": "RFC3339"
     },
     "position": {
      "type": "integer",
      "nullable": true,
      "minimum": 0,
      "description": "its 0-based place on the projects page; null after the placed ones"
     },
     "last_deploy_at": {
      "type": "string",
      "nullable": true,
      "description": "RFC3339 when a deployment of any of its services last went live"
     },
     "issue": {
      "$ref": "#/components/schemas/ProjectIssue"
     },
     "deletion": {
      "$ref": "#/components/schemas/ProjectDeletion"
     }
    },
    "required": [
     "prj",
     "name"
    ]
   },
   "ProjectIssue": {
    "type": "object",
    "nullable": true,
    "description": "the most important problem to show on a project's card, or null",
    "properties": {
     "kind": {
      "type": "string",
      "enum": [
       "deploy_failed",
       "volume_full",
       "crashing"
      ],
      "description": "deploy_failed (the latest deployment of service name failed), volume_full (volume name is percent used, 80 or more), crashing (service name is crashing)"
     },
     "name": {
      "type": "string",
      "description": "the service or volume"
     },
     "percent": {
      "type": "integer",
      "description": "volume_full only"
     }
    },
    "required": [
     "kind",
     "name"
    ]
   },
   "ProjectDeletion": {
    "type": "object",
    "nullable": true,
    "description": "the progress of a project's permanent teardown while it is being deleted, or null",
    "properties": {
     "step": {
      "type": "integer",
      "minimum": 1,
      "maximum": 6,
      "description": "the current step, 1-based"
     },
     "total": {
      "type": "integer",
      "description": "6"
     },
     "label": {
      "type": "string",
      "description": "the current step's label"
     },
     "retrying": {
      "type": "boolean",
      "description": "the current step failed and will be retried"
     },
     "error": {
      "type": "string",
      "nullable": true,
      "description": "why the last try failed"
     },
     "steps": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/DeletionStep"
      }
     }
    },
    "required": [
     "step",
     "total",
     "label",
     "retrying",
     "error",
     "steps"
    ]
   },
   "DeletionStep": {
    "type": "object",
    "properties": {
     "label": {
      "type": "string",
      "description": "past tense when done, present tense while pending or running"
     },
     "state": {
      "type": "string",
      "enum": [
       "pending",
       "running",
       "done",
       "failed"
      ]
     },
     "detail": {
      "type": "string",
      "description": "optional, e.g. 6.1 of 9.3 GB"
     },
     "done_bytes": {
      "type": "integer",
      "format": "int64",
      "description": "optional (step 3)"
     },
     "total_bytes": {
      "type": "integer",
      "format": "int64",
      "description": "optional (step 3)"
     }
    },
    "required": [
     "label",
     "state"
    ]
   },
   "DeletePreview": {
    "type": "object",
    "properties": {
     "services": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "svc": {
         "type": "string"
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "groups": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "grp": {
         "type": "string"
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "volumes": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "vol": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "size_bytes": {
         "type": "integer",
         "format": "int64"
        },
        "used_bytes": {
         "type": "integer",
         "format": "int64"
        },
        "backups": {
         "type": "integer"
        },
        "backup_bytes": {
         "type": "integer",
         "format": "int64"
        }
       }
      }
     },
     "environments": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "env": {
         "type": "string"
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "domains": {
      "type": "array",
      "description": "the custom domains, whose DNS records the customer must remove",
      "items": {
       "type": "object",
       "properties": {
        "name": {
         "type": "string"
        }
       }
      }
     },
     "generated_addresses": {
      "type": "integer",
      "description": "every generated endpoint (public HTTPS, TCP and private)"
     },
     "variables": {
      "type": "integer"
     },
     "webhooks": {
      "type": "integer"
     },
     "api_keys": {
      "type": "integer",
      "description": "cloud-core's project-scoped keys plus the project's working API tokens held here"
     }
    },
    "required": [
     "services",
     "groups",
     "volumes",
     "environments",
     "domains",
     "generated_addresses",
     "variables",
     "webhooks",
     "api_keys"
    ]
   },
   "ProjectList": {
    "type": "object",
    "properties": {
     "projects": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {prj, name, region, cell, status (ok, deploying, needs_attention, empty, deleting), service_count, environments (names), deleted_until (only a project deleted before the teardown rule, in its old recovery window), created_at, position (its 0-based place on the organisation's projects page, shared by everyone; null after the placed ones), last_deploy_at (RFC3339 when a deployment of any of its services last went live, or null), issue (null or a ProjectIssue, the problem to show on its card), deletion (null or a ProjectDeletion, the teardown's progress while it is being deleted)}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "projects",
     "next_cursor"
    ]
   },
   "RegionChangeAccepted": {
    "type": "object",
    "properties": {
     "job": {
      "type": "string",
      "description": "orchestrator job"
     },
     "status": {
      "type": "string",
      "description": "accepted or refused"
     }
    },
    "required": [
     "job",
     "status"
    ]
   },
   "ProjectStatus": {
    "type": "object",
    "properties": {
     "prj": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "description": "ok, needs_attention, stopped or deleting"
     },
     "region": {
      "type": "string"
     },
     "environments": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {env, name, state, services:[{svc, name, state (running, building, deploying, failed, crashed, stopped, waiting_for_capacity), reason (crash_loop, oom, build_failed, health_check_failed, no_capacity, suspended, none), last_deploy_at}]}"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "prj",
     "state",
     "region",
     "environments"
    ]
   },
   "Undeleted": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "restored (a refusal is an error, e.g. not_restorable)"
     },
     "job": {
      "type": "string",
      "description": "always empty"
     }
    },
    "required": [
     "status",
     "job"
    ]
   },
   "ProjectUpdated": {
    "type": "object",
    "properties": {
     "prj": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "prj",
     "status"
    ]
   },
   "QueryToken": {
    "type": "object",
    "properties": {
     "token": {
      "type": "string",
      "description": "signed, short-lived, scoped to prj + cell + scope"
     },
     "usr_claim": {
      "type": "string",
      "description": "the usr_ placed in the token claims (the cell API logs it as usr)"
     },
     "cell_endpoint": {
      "type": "string",
      "description": "regional cell API host"
     },
     "expires_at": {
      "type": "string"
     }
    },
    "required": [
     "token",
     "usr_claim",
     "cell_endpoint",
     "expires_at"
    ]
   },
   "RestoreAccepted": {
    "type": "object",
    "properties": {
     "job": {
      "type": "string"
     },
     "status": {
      "type": "string"
     }
    },
    "required": [
     "job",
     "status"
    ]
   },
   "ServiceCreated": {
    "type": "object",
    "properties": {
     "svc": {
      "type": "string"
     },
     "hostname": {
      "type": "string",
      "description": "generated dispracloud.app hostname"
     },
     "status": {
      "type": "string",
      "description": "created or refused (plan limit)"
     }
    },
    "required": [
     "svc",
     "hostname",
     "status"
    ]
   },
   "ServiceList": {
    "type": "object",
    "properties": {
     "services": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {svc, name, source_kind (repo, image), dep, dep_state, cpu_millis, memory_mb, domains (count), updated_at, group (its service group grp_, or null), position (its 0-based place in its section of the board, or null when not placed yet)}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "services",
     "next_cursor"
    ]
   },
   "ServiceSettings": {
    "type": "object",
    "properties": {
     "source": {
      "type": "string",
      "description": "where the service comes from: git (a GitHub repository and branch) or dispra_yaml (deployed from a dispra.yaml file with the dcloud CLI: an uploaded folder, or an image the file names)"
     },
     "source_kind": {
      "type": "string",
      "description": "cloud-core's kind: repo, image, or empty (a folder the CLI uploaded)"
     },
     "repo_id": {
      "type": "string",
      "description": "the linked repository (id), changed only through the repository picker"
     },
     "branch": {
      "type": "string"
     },
     "root_dir": {
      "type": "string",
      "description": "monorepo root directory"
     },
     "watch_paths": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "paths whose changes trigger a deploy"
     },
     "image_ref": {
      "type": "string",
      "description": "Docker image source (registry/name:tag), when source_kind is image"
     },
     "builder": {
      "type": "string",
      "description": "railpack, dockerfile or image"
     },
     "dockerfile_path": {
      "type": "string"
     },
     "build_cmd": {
      "type": "string",
      "description": "optional override of the detected build command"
     },
     "start_cmd": {
      "type": "string",
      "description": "optional override of the image or detected start command"
     },
     "restart_policy": {
      "type": "string",
      "description": "always, on_failure or never"
     },
     "max_restarts": {
      "type": "string",
      "description": "for on_failure; 0 = unlimited with backoff"
     },
     "cpu_millis": {
      "type": "string"
     },
     "memory_mb": {
      "type": "string"
     },
     "disk_mb": {
      "type": "integer",
      "description": "temporary disk quota of each replica in MB: whole GB, 1024 to 102400 (1 to 100 GB), a multiple of 1024; covers every write the app makes, wiped on every deploy or restart, billed by allocated size x time; 1024 when never set"
     },
     "healthcheck_path": {
      "type": "string",
      "description": "the path the node agent probes, or empty (the image's or the agent's default)"
     },
     "healthcheck_port": {
      "type": "integer",
      "nullable": true,
      "description": "the port the check probes when it is not the service's, 1 to 65535; null: the default"
     },
     "healthcheck_start_period_s": {
      "type": "integer",
      "nullable": true,
      "description": "seconds after start before failed checks count, 0 to 600 (default 5); null: the default"
     },
     "healthcheck_interval_s": {
      "type": "integer",
      "nullable": true,
      "description": "seconds between checks, 1 to 300 (default 5); null: the default"
     },
     "healthcheck_timeout_s": {
      "type": "integer",
      "nullable": true,
      "description": "seconds before one check fails, 1 to 60 and below the interval (default 3); null: the default"
     },
     "healthcheck_failure_threshold": {
      "type": "integer",
      "nullable": true,
      "description": "consecutive failures before the service is unhealthy, 1 to 20 (default 3); null: the default"
     },
     "healthcheck_restart_after": {
      "type": "integer",
      "nullable": true,
      "description": "consecutive failures while unhealthy before one restart, 1 to 20 (default never); null: the default"
     },
     "stop_grace_s": {
      "type": "string",
      "description": "READ-ONLY: 10, or 30 with a volume"
     },
     "generation": {
      "type": "string",
      "description": "settings generation, for optimistic concurrency"
     },
     "replicas": {
      "type": "integer",
      "description": "instances a deployment runs, 1 to 10"
     },
     "concurrency_per_replica": {
      "type": "integer",
      "description": "requests one instance takes (1 to 100000), or null: a global application then routes by nearest region only"
     },
     "has_volume": {
      "type": "boolean",
      "description": "READ-ONLY: a volume is attached to the service, so it runs one replica in one region"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "source_kind",
     "repo_id",
     "branch",
     "root_dir",
     "watch_paths",
     "image_ref",
     "builder",
     "dockerfile_path",
     "build_cmd",
     "start_cmd",
     "restart_policy",
     "max_restarts",
     "cpu_millis",
     "memory_mb",
     "disk_mb",
     "healthcheck_path",
     "stop_grace_s",
     "generation",
     "replicas",
     "concurrency_per_replica",
     "has_volume"
    ]
   },
   "ServiceSettingsUpdated": {
    "type": "object",
    "properties": {
     "generation": {
      "type": "string"
     },
     "apply": {
      "type": "string",
      "description": "applied_now, needs_redeploy or deploy_started"
     },
     "dep": {
      "type": "string",
      "description": "set when a deploy was started"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "generation",
     "apply",
     "dep",
     "status"
    ]
   },
   "ServiceStatus": {
    "type": "object",
    "properties": {
     "svc": {
      "type": "string"
     },
     "env": {
      "type": "string",
      "description": "environment the service belongs to"
     },
     "name": {
      "type": "string"
     },
     "dep": {
      "type": "string",
      "description": "latest deployment"
     },
     "dep_state": {
      "type": "string",
      "description": "the orchestrator's enum (C-orchestrator-api-deployment-state) plus deleting, which the API adds itself while a project or service delete is pending (7-day recoverable window, then torn down)"
     },
     "desired_node": {
      "type": "string",
      "description": "scheduler's value"
     },
     "observed_node": {
      "type": "string",
      "description": "agent's report; shown, falling back to desired_node during a deploy or move"
     },
     "cpu_millis": {
      "type": "integer"
     },
     "memory_mb": {
      "type": "integer"
     },
     "hostname": {
      "type": "string",
      "description": "the generated regional name (<label>.in|us.<zone>), the edges' internal route"
     },
     "global_hostname": {
      "type": "string",
      "description": "the public URL when the service is in a global application, else empty"
     },
     "domains": {
      "type": "string",
      "description": "the generated regional name and the custom domains, each with dom, name, kind (generated|custom) and state"
     },
     "replicas": {
      "type": "integer",
      "description": "the service's replica count (the setting; the next deployment runs that many)"
     },
     "replica_states": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "the placed slots of its own region: {slot (0..9), role (current|candidate), node (or null), dep (or null), state (healthy, a deployment state, or placed)}; current slots first, by slot"
     }
    },
    "required": [
     "svc",
     "env",
     "name",
     "dep",
     "dep_state",
     "desired_node",
     "observed_node",
     "cpu_millis",
     "memory_mb",
     "hostname",
     "domains",
     "replicas",
     "replica_states"
    ]
   },
   "EndpointList": {
    "type": "object",
    "properties": {
     "endpoints": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Endpoint"
      },
      "description": "every endpoint of the service, custom domains included; the service's own first, then the replicas'"
     }
    },
    "required": [
     "endpoints"
    ]
   },
   "Endpoint": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "opaque; stable across a port change, new on regenerate"
     },
     "type": {
      "type": "string",
      "description": "public_http, public_tcp or private"
     },
     "scope": {
      "type": "string",
      "description": "replica only for a private endpoint of one replica, else service"
     },
     "cell": {
      "type": "string",
      "nullable": true,
      "description": "scope replica only"
     },
     "slot": {
      "type": "integer",
      "nullable": true,
      "description": "scope replica only, 0 to 9"
     },
     "region": {
      "type": "string",
      "nullable": true,
      "description": "scope replica only"
     },
     "city": {
      "type": "string",
      "nullable": true,
      "description": "scope replica only"
     },
     "address": {
      "type": "string",
      "description": "the hostname, without a port"
     },
     "url": {
      "type": "string",
      "description": "what to copy: https://host (public_http), host:public_port (public_tcp), host:port (private)"
     },
     "port": {
      "type": "integer",
      "description": "the container port, 1 to 65535"
     },
     "public_port": {
      "type": "integer",
      "nullable": true,
      "description": "public_tcp only, the port open on the internet"
     },
     "global": {
      "type": "boolean",
      "description": "the name resolves to every edge (a service in several regions; public HTTP and TCP)"
     },
     "transport": {
      "type": "string",
      "description": "tcp"
     },
     "custom": {
      "type": "boolean",
      "description": "a custom domain added by the customer; it can't be regenerated"
     },
     "verified": {
      "type": "boolean",
      "nullable": true,
      "description": "custom domains only, whether its DNS is verified"
     },
     "state": {
      "type": "string",
      "description": "active, or pending (a custom domain whose DNS isn't verified yet)"
     },
     "created_at": {
      "type": "string",
      "description": "RFC3339"
     }
    },
    "required": [
     "id",
     "type",
     "scope",
     "cell",
     "slot",
     "region",
     "city",
     "address",
     "url",
     "port",
     "public_port",
     "global",
     "transport",
     "custom",
     "verified",
     "state",
     "created_at"
    ]
   },
   "EndpointRemoved": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "removed"
     }
    },
    "required": [
     "id",
     "status"
    ]
   },
   "TokenCallList": {
    "type": "object",
    "properties": {
     "calls": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {at, method, route, status, duration_ms, origin}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "calls",
     "next_cursor"
    ]
   },
   "WebhookDeleted": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "status"
    ]
   },
   "DeliveryList": {
    "type": "object",
    "properties": {
     "deliveries": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {evt, at, event, status_code, duration_ms, attempt}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "deliveries",
     "next_cursor"
    ]
   },
   "WebhookList": {
    "type": "object",
    "properties": {
     "webhooks": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {whk, url, events, enabled, last_status, last_delivery_at}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "webhooks",
     "next_cursor"
    ]
   },
   "WebhookSet": {
    "type": "object",
    "properties": {
     "whk": {
      "type": "string"
     },
     "secret": {
      "type": "string",
      "description": "SECRET: HMAC signing secret, shown once on create"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "whk",
     "secret",
     "status"
    ]
   },
   "AccountDeleted": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "accepted or refused"
     },
     "delete_after": {
      "type": "string"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "status",
     "delete_after"
    ]
   },
   "AuditList": {
    "type": "object",
    "properties": {
     "events": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {evt, at, actor, action, subject, prj, env, detail}; detail never holds variable values or secrets"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "events",
     "next_cursor"
    ]
   },
   "ExportQueued": {
    "type": "object",
    "properties": {
     "exp": {
      "type": "string",
      "description": "exp_ export job"
     },
     "status": {
      "type": "string",
      "description": "queued or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "exp",
     "status"
    ]
   },
   "ExportState": {
    "type": "object",
    "properties": {
     "exp": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "description": "queued, building, ready, failed or expired"
     },
     "download_path": {
      "type": "string",
      "description": "signed link, empty until ready"
     },
     "expires_at": {
      "type": "string"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "exp",
     "state",
     "download_path",
     "expires_at"
    ]
   },
   "InviteAccepted": {
    "type": "object",
    "properties": {
     "tm": {
      "type": "string"
     },
     "role": {
      "type": "string",
      "description": "owner, admin, developer or viewer"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     }
    },
    "required": [
     "tm",
     "role",
     "status"
    ]
   },
   "MemberList": {
    "type": "object",
    "properties": {
     "members": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {usr, name, username (a member's Dispra Labs username; absent on an invitation), email, org_role (owner, admin, member), project_roles (list of {prj, role, envs (an invitation's environments, absent for all)}), status (active, invited), joined_at}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "members",
     "next_cursor"
    ]
   },
   "OwnerChanged": {
    "type": "object",
    "properties": {
     "tm": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "proposed, transferred, cancelled or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "tm",
     "status"
    ]
   },
   "ProjectRoleSet": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "status"
    ]
   },
   "TeamDeleted": {
    "type": "object",
    "properties": {
     "tm": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "accepted, restored or refused"
     },
     "delete_after": {
      "type": "string",
      "description": "ISO time the purge runs; empty after a restore"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "tm",
     "status",
     "delete_after"
    ]
   },
   "TeamLeft": {
    "type": "object",
    "properties": {
     "tm": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "tm",
     "status"
    ]
   },
   "TeamUpdated": {
    "type": "object",
    "properties": {
     "tm": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "slug": {
      "type": "string",
      "description": "the stored slug"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "tm",
     "status",
     "slug"
    ]
   },
   "TeamState": {
    "type": "object",
    "properties": {
     "tm": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "tok": {
      "type": "string",
      "description": "tok_ id of the created token (action create_token only); the id is how a token is listed and revoked later"
     },
     "token": {
      "type": "string",
      "description": "SECRET: the new API token, returned ONCE in the answer to create_token and never again (auth stores only its hash); the client shows it once and must not log it. Named token with a SECRET note per conventions 5; no event may carry it (the lint rejects secret-named event fields). A repeat with the same idempotency_key returns tok and the metadata but token empty"
     },
     "scope": {
      "type": "string",
      "description": "team, read-only or deploy (create_token only)"
     },
     "expires_at": {
      "type": "string",
      "description": "timestamp (create_token only)"
     }
    },
    "required": [
     "tm",
     "status",
     "tok",
     "token",
     "scope",
     "expires_at"
    ]
   },
   "TokenCreated": {
    "type": "object",
    "properties": {
     "tok": {
      "type": "string"
     },
     "token": {
      "type": "string",
      "description": "SECRET: the token value, shown once and stored only as a hash"
     },
     "prefix": {
      "type": "string",
      "description": "the first characters, shown in lists"
     },
     "expires_at": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "tok",
     "token",
     "prefix",
     "expires_at",
     "status"
    ]
   },
   "TokenList": {
    "type": "object",
    "properties": {
     "tokens": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {tok, name, prefix, scope (team, project), prj, role, created_at, last_used_at, expires_at, revoked_at}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "tokens",
     "next_cursor"
    ]
   },
   "TokenRevoked": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "revoked or refused"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "status"
    ]
   },
   "BillingAccount": {
    "type": "object",
    "properties": {
     "plan": {
      "type": "string",
      "description": "prepaid in Phase 1"
     },
     "currency": {
      "type": "string"
     },
     "balance_minor": {
      "type": "string"
     },
     "runway_hours": {
      "type": "string"
     },
     "state": {
      "type": "string",
      "description": "active, low, exhausted or suspended (prepaid credits)"
     },
     "auto_recharge": {
      "type": "string",
      "description": "0 or 1"
     },
     "recharge_threshold_minor": {
      "type": "string"
     },
     "recharge_amount_minor": {
      "type": "string"
     },
     "card_brand": {
      "type": "string"
     },
     "card_last4": {
      "type": "string"
     },
     "card_expiry": {
      "type": "string",
      "description": "MM/YY"
     },
     "billing_email": {
      "type": "string"
     },
     "spend_limit_minor": {
      "type": "string",
      "description": "0 = none"
     },
     "alert_thresholds_pct": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of usage alert percentages of the spend limit"
     },
     "alert_recipients": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "emails"
     },
     "state_since": {
      "type": "integer"
     },
     "suspend_at": {
      "type": "integer",
      "description": "exhausted accounts, when services stop (0 otherwise)"
     },
     "delete_at": {
      "type": "integer",
      "description": "exhausted or suspended accounts, when every service of the workspace is deleted (14 days after the credits ran out; 0 otherwise)"
     },
     "enforced": {
      "type": "boolean",
      "description": "whether a suspended account's services are stopped"
     },
     "low_balance_minor": {
      "type": "integer"
     },
     "spent_today_minor": {
      "type": "integer"
     },
     "spent_month_minor": {
      "type": "integer"
     },
     "burn_per_day_minor": {
      "type": "integer",
      "description": "usage charged in the last 24 hours"
     },
     "charge_from": {
      "type": "integer"
     },
     "min_top_up_minor": {
      "type": "integer"
     },
     "max_top_up_minor": {
      "type": "integer"
     },
     "gst_percent": {
      "type": "integer"
     },
     "gateway": {
      "type": "string"
     },
     "avg_per_day_minor": {
      "type": "integer",
      "description": "this month's daily average"
     },
     "avg_days": {
      "type": "integer"
     },
     "bought_minor": {
      "type": "integer",
      "description": "every credit bought"
     },
     "billing_name": {
      "type": "string"
     },
     "gstin": {
      "type": "string"
     },
     "billing_address": {
      "type": "string"
     },
     "price_book": {
      "type": "string"
     },
     "rates": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {resource, label, unit, paise_per_unit}"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "plan",
     "currency",
     "balance_minor",
     "runway_hours",
     "state",
     "auto_recharge",
     "recharge_threshold_minor",
     "recharge_amount_minor",
     "card_brand",
     "card_last4",
     "card_expiry",
     "billing_email",
     "spend_limit_minor",
     "alert_thresholds_pct",
     "alert_recipients"
    ]
   },
   "BillingPayment": {
    "type": "object",
    "properties": {
     "pay": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "created, paid or failed"
     },
     "gateway": {
      "type": "string",
      "description": "mock or razorpay"
     },
     "gateway_order_id": {
      "type": "string"
     },
     "gateway_payment_id": {
      "type": "string"
     },
     "credits_minor": {
      "type": "integer",
      "description": "credits added, paise, ex GST"
     },
     "gst_minor": {
      "type": "integer"
     },
     "total_minor": {
      "type": "integer",
      "description": "what is paid, credits + GST"
     },
     "currency": {
      "type": "string"
     },
     "receipt_no": {
      "type": "string",
      "description": "DSP-CR/2026-27/000001 once paid"
     },
     "failure_reason": {
      "type": "string"
     },
     "created_at": {
      "type": "integer"
     },
     "paid_at": {
      "type": "integer"
     },
     "checkout": {
      "type": "object",
      "additionalProperties": true,
      "description": "on create, what the browser needs to open the gateway checkout"
     },
     "balance_minor": {
      "type": "integer",
      "description": "on verify of a paid payment, the balance after it"
     }
    },
    "required": [
     "pay",
     "status",
     "gateway",
     "credits_minor",
     "gst_minor",
     "total_minor"
    ]
   },
   "BillingPaymentList": {
    "type": "object",
    "properties": {
     "payments": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BillingPayment"
      }
     },
     "next_cursor": {
      "type": "string"
     }
    },
    "required": [
     "payments",
     "next_cursor"
    ]
   },
   "BillingTransaction": {
    "type": "object",
    "properties": {
     "id": {
      "type": "integer"
     },
     "kind": {
      "type": "string",
      "description": "purchase, usage, promo, adjustment or refund"
     },
     "label": {
      "type": "string"
     },
     "amount_minor": {
      "type": "integer",
      "description": "+ credit, − usage, paise"
     },
     "balance_after_minor": {
      "type": "integer"
     },
     "pay": {
      "type": "string"
     },
     "period_from": {
      "type": "integer"
     },
     "period_to": {
      "type": "integer"
     },
     "note": {
      "type": "string"
     },
     "created_at": {
      "type": "integer"
     }
    },
    "required": [
     "id",
     "kind",
     "amount_minor",
     "balance_after_minor",
     "created_at"
    ]
   },
   "BillingTransactionList": {
    "type": "object",
    "properties": {
     "transactions": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/BillingTransaction"
      }
     },
     "next_cursor": {
      "type": "string"
     }
    },
    "required": [
     "transactions",
     "next_cursor"
    ]
   },
   "BillingView": {
    "type": "object",
    "properties": {
     "balance_minor": {
      "type": "integer"
     },
     "currency": {
      "type": "string"
     },
     "runway_hours": {
      "type": "integer"
     },
     "state": {
      "type": "string",
      "description": "active, grace, suspended, deletion_scheduled"
     },
     "gateway_order_id": {
      "type": "string",
      "description": "hosted checkout order, only on top_up"
     },
     "inv": {
      "type": "string",
      "description": "latest invoice"
     }
    },
    "required": [
     "balance_minor",
     "currency",
     "runway_hours",
     "state",
     "gateway_order_id",
     "inv"
    ]
   },
   "AlertsSet": {
    "type": "object",
    "properties": {
     "status": {
      "type": "string",
      "description": "applied or refused"
     },
     "spend_limit_minor": {
      "type": "string"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "status",
     "spend_limit_minor"
    ]
   },
   "InvoiceList": {
    "type": "object",
    "properties": {
     "invoices": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {inv, period, currency, total_minor, status, issued_at, pdf_path}"
     },
     "next_cursor": {
      "type": "string",
      "description": "empty on the last page"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "invoices",
     "next_cursor"
    ]
   },
   "UsageRows": {
    "type": "object",
    "properties": {
     "rows": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {id, name, cpu_core_hours, memory_gb_hours (reserved), volume_gb_hours, disk_gb_hours (allocated per-replica temporary disk, GB x hours), egress_gb, cost_minor, cpu_minor, memory_minor, disk_minor, volume_minor, egress_minor (what each resource cost), project, service_ids, services (names)}"
     },
     "currency": {
      "type": "string"
     },
     "projection_minor": {
      "type": "integer",
      "description": "projected spend this month (spent + the daily average for each day left)"
     },
     "from": {
      "type": "integer",
      "description": "the month covered (IST), start"
     },
     "to": {
      "type": "integer"
     },
     "current": {
      "type": "boolean"
     },
     "spent_minor": {
      "type": "integer"
     },
     "avg_per_day_minor": {
      "type": "integer"
     },
     "avg_days": {
      "type": "integer"
     },
     "days": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "every day of the month, {day, amount_minor}"
     },
     "resources": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "{resource, label, quantity, unit, amount_minor, paise_per_unit, rate_unit} per resource of the price book"
     },
     "price_book": {
      "type": "string"
     },
     "months": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "months with a billing account, newest first (2026-12)"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "rows",
     "currency",
     "projection_minor"
    ]
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "code": {
        "type": "string"
       },
       "message": {
        "type": "string"
       },
       "request_id": {
        "type": "string"
       }
      }
     }
    }
   },
   "GlobalAppDetail": {
    "type": "object",
    "properties": {
     "gap": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "hostname": {
      "type": "string",
      "description": "<name>-<8 characters>.global.<zone>: the stable global name (never reissued)"
     },
     "url": {
      "type": "string",
      "description": "https://<hostname>"
     },
     "state": {
      "type": "string",
      "description": "active or deleted"
     },
     "generation": {
      "type": "integer",
      "description": "policy version"
     },
     "members": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {svc, cell, region, service_name, prj, concurrency_limit (null: capacity_unknown), capacity (validated|unknown), limit_set_at, status{healthy, in_flight, streams, load_state (ok|busy|recovering|unknown), busy_ratio, observed_at, stale}}: status only on the single-group read"
     },
     "spill_enabled": {
      "type": "boolean",
      "description": "every member has a validated concurrency limit and there are at least two"
     },
     "created_at": {
      "type": "string"
     },
     "decisions": {
      "type": "string",
      "description": "reason code -> requests the edges routed for this group since their last start (nearest, spill_busy, all_busy_default, default_unavailable, capacity_unknown, peer_rejected, no_healthy_member)"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "gap",
     "name",
     "hostname",
     "url",
     "state",
     "generation",
     "members",
     "spill_enabled",
     "created_at",
     "decisions"
    ]
   },
   "GlobalMemberRemoved": {
    "type": "object",
    "properties": {
     "gap": {
      "type": "string"
     },
     "svc": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "removed"
     },
     "generation": {
      "type": "integer"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "gap",
     "svc",
     "status",
     "generation"
    ]
   },
   "GlobalAppList": {
    "type": "object",
    "properties": {
     "global_apps": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {gap, name, hostname, url, state, generation, members[{svc, cell, region, service_name, prj, concurrency_limit, capacity}], spill_enabled, created_at}"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "global_apps"
    ]
   },
   "GlobalMember": {
    "type": "object",
    "properties": {
     "gap": {
      "type": "string"
     },
     "svc": {
      "type": "string"
     },
     "cell": {
      "type": "string"
     },
     "region": {
      "type": "string"
     },
     "concurrency_limit": {
      "type": "integer",
      "description": "null: capacity_unknown"
     },
     "capacity": {
      "type": "string",
      "description": "validated or unknown"
     },
     "created": {
      "type": "boolean",
      "description": "true: the service joined the group with this call"
     },
     "generation": {
      "type": "integer",
      "description": "the group's policy version after the call"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "gap",
     "svc",
     "cell",
     "region",
     "concurrency_limit",
     "capacity",
     "created",
     "generation"
    ]
   },
   "ServiceRegionList": {
    "type": "object",
    "properties": {
     "svc": {
      "type": "string",
      "description": "the primary service"
     },
     "regions": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {cell, region, primary, svc, replicas, state, dep_state, live_dep, commit_sha, hostname}: the primary first"
     }
    },
    "required": [
     "svc",
     "regions"
    ]
   },
   "ServiceRegionAdded": {
    "type": "object",
    "properties": {
     "svc": {
      "type": "string",
      "description": "the new regional copy"
     },
     "primary": {
      "type": "string"
     },
     "region": {
      "type": "string"
     },
     "cell": {
      "type": "string"
     },
     "replicas": {
      "type": "integer"
     },
     "hostname": {
      "type": "string",
      "description": "the copy's regional hostname"
     },
     "gap": {
      "type": "string",
      "description": "the global application the primary and its copies are members of"
     },
     "global_hostname": {
      "type": "string"
     },
     "deployment": {
      "type": "string",
      "description": "the copy's first deployment (at the primary's live commit), or null"
     }
    },
    "required": [
     "svc",
     "primary",
     "region",
     "cell",
     "replicas",
     "hostname",
     "gap",
     "global_hostname",
     "deployment"
    ]
   },
   "ServiceRegionSet": {
    "type": "object",
    "properties": {
     "svc": {
      "type": "string",
      "description": "the service that runs that region (the primary or its copy)"
     },
     "region": {
      "type": "string"
     },
     "cell": {
      "type": "string"
     },
     "replicas": {
      "type": "integer"
     },
     "generation": {
      "type": "integer"
     },
     "apply": {
      "type": "string",
      "description": "applied_now (unchanged) or needs_redeploy"
     }
    },
    "required": [
     "svc",
     "region",
     "cell",
     "replicas",
     "generation",
     "apply"
    ]
   },
   "ServiceRegionRemoved": {
    "type": "object",
    "properties": {
     "svc": {
      "type": "string",
      "description": "the removed copy"
     },
     "primary": {
      "type": "string"
     },
     "region": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "deleting"
     },
     "purge_at": {
      "type": "string"
     }
    },
    "required": [
     "svc",
     "primary",
     "region",
     "status",
     "purge_at"
    ]
   },
   "GlobalAppDeleted": {
    "type": "object",
    "properties": {
     "gap": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "deleted"
     },
     "members_removed": {
      "type": "integer"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "gap",
     "status",
     "members_removed"
    ]
   },
   "GlobalApp": {
    "type": "object",
    "properties": {
     "gap": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "hostname": {
      "type": "string",
      "description": "<name>-<8 characters>.global.<zone>: the stable global name (never reissued)"
     },
     "url": {
      "type": "string",
      "description": "https://<hostname>"
     },
     "state": {
      "type": "string",
      "description": "active or deleted"
     },
     "generation": {
      "type": "integer",
      "description": "policy version"
     },
     "members": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {svc, cell, region, service_name, prj, concurrency_limit (null: capacity_unknown), capacity (validated|unknown), limit_set_at, status{healthy, in_flight, streams, load_state (ok|busy|recovering|unknown), busy_ratio, observed_at, stale}}: status only on the single-group read"
     },
     "spill_enabled": {
      "type": "boolean",
      "description": "every member has a validated concurrency limit and there are at least two"
     },
     "created_at": {
      "type": "string"
     },
     "error_code": {
      "type": "string",
      "description": "API_NOT_FOUND etc, else empty"
     }
    },
    "required": [
     "gap",
     "name",
     "hostname",
     "url",
     "state",
     "generation",
     "members",
     "spill_enabled",
     "created_at"
    ]
   },
   "VolumeList": {
    "type": "object",
    "properties": {
     "volumes": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of Volume objects"
     }
    },
    "required": [
     "volumes"
    ]
   },
   "Volume": {
    "type": "object",
    "properties": {
     "vol": {
      "type": "string"
     },
     "name": {
      "type": "string"
     },
     "env": {
      "type": "string"
     },
     "prj": {
      "type": "string"
     },
     "cell": {
      "type": "string"
     },
     "region": {
      "type": "string"
     },
     "city": {
      "type": "string"
     },
     "size_bytes": {
      "type": "integer"
     },
     "used_bytes": {
      "type": "integer",
      "description": "null when not measured yet"
     },
     "state": {
      "type": "string",
      "description": "creating, ready, detached, moving, restoring, soft_deleted or deleting"
     },
     "node": {
      "type": "string",
      "description": "null while unplaced"
     },
     "recordsize_kind": {
      "type": "string",
      "description": "general or db"
     },
     "encrypted": {
      "type": "boolean"
     },
     "backup_policy": {
      "type": "object",
      "description": "{enabled, interval_s, retention}"
     },
     "last_backup_at": {
      "type": "string",
      "description": "RFC3339 or null"
     },
     "attachments": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {svc, name, mount_path}"
     },
     "created_at": {
      "type": "string",
      "description": "RFC3339"
     },
     "soft_deleted_at": {
      "type": "string",
      "description": "RFC3339 or null"
     },
     "purge_after": {
      "type": "string",
      "description": "RFC3339 or null"
     },
     "grp": {
      "type": "string",
      "description": "its board group (grp_), or null: ungrouped"
     },
     "position": {
      "type": "integer",
      "description": "its 0-based place in its board section, shared with the section's services; null: not placed yet (after the placed ones)"
     }
    },
    "required": [
     "vol",
     "name",
     "env",
     "state",
     "size_bytes",
     "attachments"
    ]
   },
   "VolumeDeleted": {
    "type": "object",
    "properties": {
     "vol": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "soft_deleted"
     },
     "purge_after": {
      "type": "string",
      "description": "RFC3339"
     }
    },
    "required": [
     "vol",
     "status"
    ]
   },
   "VolumeAttachment": {
    "type": "object",
    "properties": {
     "vol": {
      "type": "string"
     },
     "svc": {
      "type": "string"
     },
     "mount_path": {
      "type": "string"
     },
     "needs_redeploy": {
      "type": "boolean",
      "description": "always true: it applies at the next deployment"
     }
    },
    "required": [
     "vol",
     "svc",
     "mount_path",
     "needs_redeploy"
    ]
   },
   "VolumeDetached": {
    "type": "object",
    "properties": {
     "vol": {
      "type": "string"
     },
     "svc": {
      "type": "string"
     },
     "needs_redeploy": {
      "type": "boolean"
     }
    },
    "required": [
     "vol",
     "svc",
     "needs_redeploy"
    ]
   },
   "VolumeBackupList": {
    "type": "object",
    "properties": {
     "backups": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {bkp, state, kind, size_bytes, taken_at, created_at}, newest first"
     }
    },
    "required": [
     "backups"
    ]
   },
   "VolumeBackupRequested": {
    "type": "object",
    "properties": {
     "bkp": {
      "type": "string"
     },
     "status": {
      "type": "string",
      "description": "requested"
     }
    },
    "required": [
     "bkp",
     "status"
    ]
   },
   "VolumeRestored": {
    "type": "object",
    "properties": {
     "vol": {
      "type": "string",
      "description": "the new volume"
     },
     "name": {
      "type": "string"
     },
     "status": {
      "type": "string"
     }
    },
    "required": [
     "vol",
     "name",
     "status"
    ]
   },
   "VolumeActivity": {
    "type": "object",
    "properties": {
     "events": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {at, action, actor}, newest first, at most 100"
     }
    },
    "required": [
     "events"
    ]
   },
   "VolumeMetrics": {
    "type": "object",
    "properties": {
     "range": {
      "type": "string"
     },
     "step_s": {
      "type": "integer"
     },
     "since": {
      "type": "string"
     },
     "size_bytes": {
      "type": "integer"
     },
     "used_bytes": {
      "type": "integer"
     },
     "series": {
      "type": "array",
      "items": {
       "type": "object",
       "additionalProperties": true
      },
      "description": "list of {t, used_bytes, size_bytes}"
     }
    },
    "required": [
     "range",
     "series"
    ]
   }
  },
  "securitySchemes": {
   "key": {
    "type": "http",
    "scheme": "bearer",
    "description": "dsp_live_... (production) or dsp_dev_... (development)"
   }
  }
 }
}
