openapi: 3.0.3
info:
  title: Wodby 2.0 Public API
  version: 1.0.0
  description: |
    Public REST API for customer SDKs and code integrations.
    GraphQL remains internal for the dashboard. This contract is the versioned public surface.
servers:
  - url: /v1
security:
  - apiKeyHeader: []
  - accessTokenHeader: []
tags:
  - name: orgs
  - name: projects
  - name: apps
  - name: app-instances
  - name: app-services
  - name: app-deployments
  - name: app-builds
  - name: clusters
  - name: databases
  - name: integrations
  - name: integration-kinds
  - name: providers
  - name: services
  - name: stacks
  - name: backups
  - name: imports
  - name: tasks
  - name: task-steps
  - name: app-routes
  - name: envs
paths:
  /openapi.yaml:
    get:
      summary: Get OpenAPI YAML
      security: []
      responses:
        '200':
          description: OpenAPI YAML
          content:
            application/yaml:
              schema:
                type: string
  /openapi.json:
    get:
      summary: Get OpenAPI JSON
      security: []
      responses:
        '200':
          description: OpenAPI JSON
          content:
            application/json:
              schema:
                type: object
  /orgs:
    get:
      tags:
        - orgs
      summary: List orgs
      responses:
        '200':
          description: List of orgs
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Org'
    post:
      tags:
        - orgs
      summary: Create org
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrgRequest'
      responses:
        '201':
          description: Created org
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Org'
  /orgs/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    put:
      tags:
        - orgs
      summary: Update org
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrgRequest'
      responses:
        '200':
          description: Updated org
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Org'
    delete:
      tags:
        - orgs
      summary: Delete org
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /projects:
    get:
      tags:
        - projects
      summary: List projects
      parameters:
        - $ref: '#/components/parameters/OrgId'
      responses:
        '200':
          description: List of projects
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Project'
    post:
      tags:
        - projects
      summary: Create project
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewProjectInput'
      responses:
        '201':
          description: Created project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /projects/by-name/{name}:
    get:
      tags:
        - projects
      summary: Get project by name
      parameters:
        - $ref: '#/components/parameters/Name'
        - $ref: '#/components/parameters/OrgId'
      responses:
        '200':
          description: Project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /projects/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    put:
      tags:
        - projects
      summary: Update project
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProjectInput'
      responses:
        '200':
          description: Updated project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
    delete:
      tags:
        - projects
      summary: Delete project
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /apps:
    get:
      tags:
        - apps
      summary: List apps
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - $ref: '#/components/parameters/ClusterApp'
      responses:
        '200':
          description: List of apps
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/App'
    post:
      tags:
        - apps
      summary: Create app
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewAppInput'
      responses:
        '201':
          description: Created app
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/App'
  /apps/by-name/{name}:
    get:
      tags:
        - apps
      summary: Get app by name
      parameters:
        - $ref: '#/components/parameters/Name'
        - $ref: '#/components/parameters/OrgId'
      responses:
        '200':
          description: App
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/App'
  /apps/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - apps
      summary: Get app
      responses:
        '200':
          description: App
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/App'
    put:
      tags:
        - apps
      summary: Update app
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTitleRequest'
      responses:
        '200':
          description: Updated app
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/App'
    delete:
      tags:
        - apps
      summary: Delete app
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /app-instances:
    get:
      tags:
        - app-instances
      summary: List app instances
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - $ref: '#/components/parameters/AppId'
        - $ref: '#/components/parameters/ClusterId'
        - $ref: '#/components/parameters/ClusterAppOptional'
      responses:
        '200':
          description: List of app instances
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppInstance'
    post:
      tags:
        - app-instances
      summary: Create app instance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewAppInstanceInput'
      responses:
        '201':
          description: Created app instance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstance'
  /app-instances/by-name/{appName}/{instanceName}:
    get:
      tags:
        - app-instances
      summary: Get app instance by app and instance name
      parameters:
        - name: appName
          in: path
          required: true
          schema:
            type: string
        - name: instanceName
          in: path
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/OrgId'
      responses:
        '200':
          description: App instance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstance'
  /app-instances/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - app-instances
      summary: Get app instance
      responses:
        '200':
          description: App instance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstance'
    put:
      tags:
        - app-instances
      summary: Update app instance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTitleRequest'
      responses:
        '200':
          description: Updated app instance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppInstance'
    delete:
      tags:
        - app-instances
      summary: Delete app instance
      parameters:
        - $ref: '#/components/parameters/Force'
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /app-services:
    get:
      tags:
        - app-services
      summary: List app services
      parameters:
        - $ref: '#/components/parameters/AppInstanceId'
      responses:
        '200':
          description: List of app services
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppService'
  /app-services/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - app-services
      summary: Get app service
      responses:
        '200':
          description: App service
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppService'
    put:
      tags:
        - app-services
      summary: Update app service
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppServiceInput'
      responses:
        '200':
          description: Updated app service
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppService'
  /app-services/{id}/actions/{name}:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/Name'
    post:
      tags:
        - app-services
      summary: Run app service action
      responses:
        '201':
          description: Action task result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /app-deployments:
    get:
      tags:
        - app-deployments
      summary: List app deployments
      parameters:
        - $ref: '#/components/parameters/AppInstanceId'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: List of deployments
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppDeploymentsResponse'
    post:
      tags:
        - app-deployments
      summary: Create deployment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDeploymentRequest'
      responses:
        '201':
          description: Created deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppDeployment'
  /app-deployments/from-ci:
    post:
      tags:
        - app-deployments
      summary: Create deployment from CI
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentFromCIInput'
      responses:
        '201':
          description: Created deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppDeployment'
  /app-deployments/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - app-deployments
      summary: Get deployment
      responses:
        '200':
          description: Deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppDeployment'
  /app-deployments/{id}/redeploy:
    parameters:
      - $ref: '#/components/parameters/Id'
    post:
      tags:
        - app-deployments
      summary: Redeploy deployment
      responses:
        '201':
          description: Created deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppDeployment'
  /app-builds:
    get:
      tags:
        - app-builds
      summary: List app builds
      parameters:
        - $ref: '#/components/parameters/AppInstanceId'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: List of builds
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppBuildsResponse'
    post:
      tags:
        - app-builds
      summary: Create build
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBuildRequest'
      responses:
        '201':
          description: Created build list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppBuild'
  /app-builds/from-ci:
    post:
      tags:
        - app-builds
      summary: Create build from CI
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewBuildFromCIInput'
      responses:
        '201':
          description: Created build
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppBuild'
  /app-builds/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - app-builds
      summary: Get build
      responses:
        '200':
          description: Build
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppBuild'
  /app-builds/{id}/docker-registry-credentials:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - app-builds
      summary: Get Docker registry credentials for build
      responses:
        '200':
          description: Docker registry credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DockerRegistryCredentials'
  /app-builds/{id}/deploy:
    parameters:
      - $ref: '#/components/parameters/Id'
    post:
      tags:
        - app-builds
      summary: Deploy build
      responses:
        '201':
          description: Created deployment
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppDeployment'
  /app-builds/{id}/void:
    parameters:
      - $ref: '#/components/parameters/Id'
    post:
      tags:
        - app-builds
      summary: Void build images
      responses:
        '200':
          description: Updated build
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppBuild'
  /clusters:
    get:
      tags:
        - clusters
      summary: List clusters
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - $ref: '#/components/parameters/IntegrationId'
      responses:
        '200':
          description: List of clusters
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Cluster'
    post:
      tags:
        - clusters
      summary: Create cluster
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewClusterInput'
      responses:
        '201':
          description: Created cluster
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cluster'
  /clusters/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - clusters
      summary: Get cluster
      responses:
        '200':
          description: Cluster
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cluster'
    put:
      tags:
        - clusters
      summary: Update cluster
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTitleRequest'
      responses:
        '200':
          description: Updated cluster
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cluster'
    delete:
      tags:
        - clusters
      summary: Delete cluster
      parameters:
        - $ref: '#/components/parameters/Force'
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /databases:
    get:
      tags:
        - databases
      summary: List databases
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - name: kind
          in: query
          schema:
            type: string
      responses:
        '200':
          description: List of databases
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Database'
    post:
      tags:
        - databases
      summary: Create database
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewDatabaseInput'
      responses:
        '201':
          description: Created database
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
  /databases/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - databases
      summary: Get database
      responses:
        '200':
          description: Database
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
    put:
      tags:
        - databases
      summary: Update database
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTitleRequest'
      responses:
        '200':
          description: Updated database
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
    delete:
      tags:
        - databases
      summary: Delete database
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /integrations:
    get:
      tags:
        - integrations
      summary: List integrations
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - name: labels
          in: query
          schema:
            type: string
          description: Comma-separated labels
      responses:
        '200':
          description: List of integrations
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Integration'
    post:
      tags:
        - integrations
      summary: Create integration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewIntegrationInput'
      responses:
        '201':
          description: Created integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Integration'
  /integrations/by-name/{name}:
    get:
      tags:
        - integrations
      summary: Get integration by name
      parameters:
        - $ref: '#/components/parameters/Name'
        - $ref: '#/components/parameters/OrgId'
      responses:
        '200':
          description: Integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Integration'
  /integrations/{id}/scopes:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integrations
      summary: List integration scopes
      responses:
        '200':
          description: Integration scopes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IntegrationScope'
  /integrations/{id}/remote-git-repos:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integrations
      summary: List remote Git repositories
      responses:
        '200':
          description: Remote Git repositories
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RemoteGitRepo'
  /integrations/{id}/remote-git-repo-branches:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/RemoteGitRepoId'
    get:
      tags:
        - integrations
      summary: List remote Git repository branches
      responses:
        '200':
          description: Branch names
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
  /integrations/{id}/remote-git-repo-tags:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/RemoteGitRepoId'
    get:
      tags:
        - integrations
      summary: List remote Git repository tags
      responses:
        '200':
          description: Tag names
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
  /integrations/{id}/kube-regions:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integrations
      summary: List Kubernetes regions
      responses:
        '200':
          description: Kubernetes regions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GenericObject'
  /integrations/{id}/kube-zones:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integrations
      summary: List Kubernetes zones
      responses:
        '200':
          description: Kubernetes zones
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GenericObject'
  /integrations/{id}/kube-machine-types:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/Location'
    get:
      tags:
        - integrations
      summary: List Kubernetes machine types
      responses:
        '200':
          description: Kubernetes machine types
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GenericObject'
  /integrations/{id}/kube-versions:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/Location'
    get:
      tags:
        - integrations
      summary: List Kubernetes versions
      responses:
        '200':
          description: Kubernetes versions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/KubeVersion'
  /integrations/{id}/kube-settings:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integrations
      summary: Get Kubernetes settings
      responses:
        '200':
          description: Kubernetes settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericObject'
  /integrations/{id}/storage-buckets:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integrations
      summary: List storage buckets
      responses:
        '200':
          description: Bucket names
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
  /integrations/{id}/storage-classes:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integrations
      summary: List storage classes
      responses:
        '200':
          description: Storage class names
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
  /integrations/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    put:
      tags:
        - integrations
      summary: Update integration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateIntegrationInput'
      responses:
        '200':
          description: Updated integration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Integration'
    delete:
      tags:
        - integrations
      summary: Delete integration
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /integration-kinds/{id}/database-types:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - integration-kinds
      summary: List database types
      responses:
        '200':
          description: Database types
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DatabaseType'
  /integration-kinds/{id}/database-regions:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/DbType'
      - $ref: '#/components/parameters/DatabaseVersion'
      - $ref: '#/components/parameters/HighAvailability'
    get:
      tags:
        - integration-kinds
      summary: List database regions
      responses:
        '200':
          description: Database regions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GenericObject'
  /integration-kinds/{id}/database-versions:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/DbType'
    get:
      tags:
        - integration-kinds
      summary: List database versions
      responses:
        '200':
          description: Database versions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DatabaseVersion'
  /integration-kinds/{id}/database-machine-types:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/DbType'
      - $ref: '#/components/parameters/DatabaseVersion'
      - $ref: '#/components/parameters/HighAvailability'
      - name: region
        in: query
        schema:
          type: string
      - name: zone
        in: query
        schema:
          type: string
    get:
      tags:
        - integration-kinds
      summary: List database machine types
      responses:
        '200':
          description: Database machine types
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GenericObject'
  /integration-kinds/{id}/database-settings:
    parameters:
      - $ref: '#/components/parameters/Id'
      - $ref: '#/components/parameters/DbType'
    get:
      tags:
        - integration-kinds
      summary: Get database settings
      responses:
        '200':
          description: Database settings
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericObject'
  /providers:
    get:
      tags:
        - providers
      summary: List providers
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - name: excludePublic
          in: query
          schema:
            type: boolean
        - $ref: '#/components/parameters/Search'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Providers response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProvidersResponse'
  /providers/by-name/{name}:
    get:
      tags:
        - providers
      summary: Get provider by name
      parameters:
        - $ref: '#/components/parameters/Name'
      responses:
        '200':
          description: Provider
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Provider'
  /provider-revisions/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - providers
      summary: Get provider revision
      responses:
        '200':
          description: Provider revision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProviderRevision'
  /services:
    get:
      tags:
        - services
      summary: List services
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - $ref: '#/components/parameters/Search'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Services response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServicesResponse'
  /services/by-name/{name}:
    get:
      tags:
        - services
      summary: Get service by name
      parameters:
        - $ref: '#/components/parameters/Name'
        - $ref: '#/components/parameters/RevNumber'
      responses:
        '200':
          description: Service
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Service'
  /services/{name}/link-candidates:
    parameters:
      - $ref: '#/components/parameters/Name'
    get:
      tags:
        - services
      summary: List service link candidates
      responses:
        '200':
          description: Service link candidates
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GenericObject'
  /service-revisions/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - services
      summary: Get service revision
      responses:
        '200':
          description: Service revision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceRevision'
  /stacks:
    get:
      tags:
        - stacks
      summary: List stacks
      parameters:
        - $ref: '#/components/parameters/OrgId'
        - $ref: '#/components/parameters/ProjectIds'
        - $ref: '#/components/parameters/Search'
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Stacks response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StacksResponse'
  /stacks/by-name/{name}:
    get:
      tags:
        - stacks
      summary: Get stack by name
      parameters:
        - $ref: '#/components/parameters/Name'
        - $ref: '#/components/parameters/RevNumber'
      responses:
        '200':
          description: Stack
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stack'
  /stack-revisions/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - stacks
      summary: Get stack revision
      responses:
        '200':
          description: Stack revision
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StackRevision'
  /stack-revisions/{id}/services:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - stacks
      summary: List stack services
      responses:
        '200':
          description: Stack services
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/StackService'
  /backups:
    get:
      tags:
        - backups
      summary: List backups
      parameters:
        - $ref: '#/components/parameters/AppInstanceIdOptional'
        - $ref: '#/components/parameters/AppServiceIdOptional'
        - $ref: '#/components/parameters/DatabaseIdOptional'
        - $ref: '#/components/parameters/DatabaseDbIdOptional'
        - name: backupName
          in: query
          schema:
            type: string
      responses:
        '200':
          description: List of backups
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Backup'
    post:
      tags:
        - backups
      summary: Create backup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewBackupInput'
      responses:
        '201':
          description: Backup task result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /backups/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - backups
      summary: Get backup
      responses:
        '200':
          description: Backup
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Backup'
  /imports:
    get:
      tags:
        - imports
      summary: List imports
      parameters:
        - $ref: '#/components/parameters/AppInstanceIdOptional'
        - $ref: '#/components/parameters/AppServiceIdOptional'
        - $ref: '#/components/parameters/DatabaseIdOptional'
        - $ref: '#/components/parameters/DatabaseDbIdOptional'
      responses:
        '200':
          description: List of imports
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Import'
    post:
      tags:
        - imports
      summary: Create import
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewImportInput'
      responses:
        '201':
          description: Import task result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /imports/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - imports
      summary: Get import
      responses:
        '200':
          description: Import
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Import'
  /tasks:
    get:
      tags:
        - tasks
      summary: List tasks
      parameters:
        - name: scope
          in: query
          schema:
            type: string
            enum:
              - project_and_org
              - org_only
              - user_only
        - $ref: '#/components/parameters/OrgIdOptional'
        - $ref: '#/components/parameters/ProjectIds'
        - name: withoutOrigin
          in: query
          schema:
            type: boolean
        - name: statuses
          in: query
          schema:
            type: string
          description: Comma-separated task statuses
        - $ref: '#/components/parameters/Search'
        - $ref: '#/components/parameters/AppIdOptional'
        - $ref: '#/components/parameters/AppInstanceIdOptional'
        - name: stackId
          in: query
          schema:
            type: integer
        - $ref: '#/components/parameters/DatabaseIdOptional'
        - $ref: '#/components/parameters/ClusterIdOptional'
        - $ref: '#/components/parameters/ServiceIdOptional'
        - $ref: '#/components/parameters/IntegrationIdOptional'
        - name: providerId
          in: query
          schema:
            type: integer
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: Tasks response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TasksResponse'
  /tasks/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - tasks
      summary: Get task
      responses:
        '200':
          description: Task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
  /tasks/{id}/cancel:
    parameters:
      - $ref: '#/components/parameters/Id'
    post:
      tags:
        - tasks
      summary: Cancel task
      responses:
        '200':
          description: Cancel result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /tasks/{id}/repeat:
    parameters:
      - $ref: '#/components/parameters/Id'
    post:
      tags:
        - tasks
      summary: Repeat task
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RepeatTaskRequest'
      responses:
        '201':
          description: Repeat task result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /task-steps/{id}/logs:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - task-steps
      summary: Get task step logs
      responses:
        '200':
          description: Task step logs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskStepLogs'
  /task-steps/{id}/log-url:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - task-steps
      summary: Get task step log URL
      responses:
        '200':
          description: Task step log URL
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/URLResponse'
  /app-routes:
    get:
      tags:
        - app-routes
      summary: List app routes
      parameters:
        - $ref: '#/components/parameters/AppInstanceId'
      responses:
        '200':
          description: List of app routes
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AppRoute'
    post:
      tags:
        - app-routes
      summary: Create app route
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewAppRouteInput'
      responses:
        '201':
          description: Created app route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppRoute'
  /app-routes/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - app-routes
      summary: Get app route
      responses:
        '200':
          description: App route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppRoute'
    put:
      tags:
        - app-routes
      summary: Update app route
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAppRouteInput'
      responses:
        '200':
          description: Updated app route
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppRoute'
    delete:
      tags:
        - app-routes
      summary: Delete app route
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
  /envs:
    get:
      tags:
        - envs
      summary: List envs
      parameters:
        - $ref: '#/components/parameters/OrgId'
      responses:
        '200':
          description: List of envs
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Env'
    post:
      tags:
        - envs
      summary: Create env
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEnvRequest'
      responses:
        '201':
          description: Created env
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Env'
  /envs/{id}:
    parameters:
      - $ref: '#/components/parameters/Id'
    get:
      tags:
        - envs
      summary: Get env
      responses:
        '200':
          description: Env
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Env'
    put:
      tags:
        - envs
      summary: Update env
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEnvRequest'
      responses:
        '200':
          description: Updated env
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Env'
    delete:
      tags:
        - envs
      summary: Delete env
      responses:
        '200':
          description: Delete result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResult'
components:
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY
    accessTokenHeader:
      type: apiKey
      in: header
      name: X-ACCESS-TOKEN
  parameters:
    Id:
      name: id
      in: path
      required: true
      schema:
        type: integer
    Name:
      name: name
      in: path
      required: true
      schema:
        type: string
    OrgId:
      name: orgId
      in: query
      required: true
      schema:
        type: integer
    OrgIdOptional:
      name: orgId
      in: query
      schema:
        type: integer
    ProjectIds:
      name: projectIds
      in: query
      schema:
        type: string
      description: Comma-separated project ids
    Search:
      name: search
      in: query
      schema:
        type: string
    RevNumber:
      name: revNumber
      in: query
      schema:
        type: integer
    Page:
      name: page
      in: query
      schema:
        type: integer
        minimum: 1
      description: Page number, defaults to 1
    PageSize:
      name: pageSize
      in: query
      schema:
        type: integer
        minimum: 1
      description: Page size, defaults to 30
    ClusterApp:
      name: clusterApp
      in: query
      schema:
        type: boolean
    ClusterAppOptional:
      name: clusterApp
      in: query
      schema:
        type: boolean
    AppId:
      name: appId
      in: query
      schema:
        type: integer
    AppIdOptional:
      name: appId
      in: query
      schema:
        type: integer
    ClusterId:
      name: clusterId
      in: query
      schema:
        type: integer
    ClusterIdOptional:
      name: clusterId
      in: query
      schema:
        type: integer
    Force:
      name: force
      in: query
      schema:
        type: boolean
        default: false
    IntegrationId:
      name: integrationId
      in: query
      schema:
        type: integer
    IntegrationIdOptional:
      name: integrationId
      in: query
      schema:
        type: integer
    ServiceIdOptional:
      name: serviceId
      in: query
      schema:
        type: integer
    RemoteGitRepoId:
      name: remoteGitRepoId
      in: query
      required: true
      schema:
        type: string
    Location:
      name: location
      in: query
      required: true
      schema:
        type: string
    DbType:
      name: dbType
      in: query
      required: true
      schema:
        type: string
    DatabaseVersion:
      name: version
      in: query
      required: true
      schema:
        type: string
    HighAvailability:
      name: ha
      in: query
      schema:
        type: boolean
        default: false
    AppInstanceId:
      name: appInstanceId
      in: query
      required: true
      schema:
        type: integer
    AppInstanceIdOptional:
      name: appInstanceId
      in: query
      schema:
        type: integer
    AppServiceIdOptional:
      name: appServiceId
      in: query
      schema:
        type: integer
    DatabaseIdOptional:
      name: databaseId
      in: query
      schema:
        type: integer
    DatabaseDbIdOptional:
      name: databaseDbId
      in: query
      schema:
        type: integer
  schemas:
    OperationResult:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
        taskId:
          type: integer
          nullable: true
    Org:
      type: object
      required:
        - id
        - name
        - title
        - domain
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        domain:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Project:
      type: object
      required:
        - id
        - name
        - title
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    App:
      type: object
      required:
        - id
        - name
        - title
        - status
        - clusterApp
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        status:
          type: string
        clusterApp:
          type: boolean
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    AppInstance:
      type: object
      required:
        - id
        - name
        - title
        - status
        - appId
        - clusterId
        - envId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        status:
          type: string
        mainDomain:
          type: string
          nullable: true
        appId:
          type: integer
        clusterId:
          type: integer
        envId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    AppDeployment:
      type: object
      required:
        - id
        - number
        - status
        - skipRollback
        - appInstanceId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        number:
          type: integer
        status:
          type: string
        skipRollback:
          type: boolean
        appInstanceId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
    AppDeploymentsResponse:
      type: object
      required:
        - items
        - totalCount
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AppDeployment'
        totalCount:
          type: integer
        nextPage:
          type: integer
          nullable: true
    AppBuild:
      type: object
      required:
        - id
        - number
        - status
        - appInstanceId
        - appServiceId
        - gitRefType
        - gitRef
        - commitHash
        - commitMessage
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        number:
          type: integer
        status:
          type: string
        appInstanceId:
          type: integer
        appServiceId:
          type: integer
        gitRefType:
          type: string
        gitRef:
          type: string
        commitHash:
          type: string
        commitMessage:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
    AppBuildsResponse:
      type: object
      required:
        - items
        - totalCount
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/AppBuild'
        totalCount:
          type: integer
        nextPage:
          type: integer
          nullable: true
    Cluster:
      type: object
      required:
        - id
        - name
        - title
        - status
        - serverless
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        status:
          type: string
        serverless:
          type: boolean
        version:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
        zone:
          type: string
          nullable: true
        integrationId:
          type: integer
          nullable: true
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Database:
      type: object
      required:
        - id
        - name
        - title
        - type
        - kind
        - status
        - version
        - envId
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        type:
          type: string
        kind:
          type: string
        status:
          type: string
        version:
          type: string
        region:
          type: string
          nullable: true
        zone:
          type: string
          nullable: true
        integrationId:
          type: integer
          nullable: true
        envId:
          type: integer
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Integration:
      type: object
      required:
        - id
        - name
        - title
        - status
        - providerRevId
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        status:
          type: string
        scope:
          type: string
          nullable: true
        auth:
          type: string
          nullable: true
        providerRevId:
          type: integer
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Backup:
      type: object
      required:
        - id
        - name
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        status:
          type: string
        appInstanceId:
          type: integer
          nullable: true
        appServiceId:
          type: integer
          nullable: true
        databaseId:
          type: integer
          nullable: true
        databaseDbId:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Task:
      type: object
      required:
        - id
        - name
        - title
        - status
        - progress
        - silent
        - system
        - userId
        - jobs
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        status:
          type: string
        progress:
          type: integer
        silent:
          type: boolean
        system:
          type: boolean
        userId:
          type: integer
        orgId:
          type: integer
          nullable: true
        projectIds:
          type: array
          items:
            type: integer
        appId:
          type: integer
          nullable: true
        appInstanceId:
          type: integer
          nullable: true
        clusterId:
          type: integer
          nullable: true
        integrationId:
          type: integer
          nullable: true
        serviceId:
          type: integer
          nullable: true
        stackId:
          type: integer
          nullable: true
        providerId:
          type: integer
          nullable: true
        originTaskId:
          type: integer
          nullable: true
        spawnedTaskIds:
          type: array
          items:
            type: integer
        repeatedTaskId:
          type: integer
          nullable: true
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/TaskJob'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
    TaskJob:
      type: object
      required:
        - id
        - name
        - title
        - status
        - timeout
        - isSystem
        - statusTitle
        - steps
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        status:
          type: string
        after:
          type: array
          items:
            type: string
        timeout:
          type: integer
        isSystem:
          type: boolean
        statusTitle:
          type: string
        steps:
          type: array
          items:
            $ref: '#/components/schemas/TaskStep'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
    TaskStep:
      type: object
      required:
        - id
        - name
        - status
        - logStatus
        - isSystem
      properties:
        id:
          type: integer
        name:
          type: string
        status:
          type: string
        logStatus:
          type: string
        isSystem:
          type: boolean
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
    AppRoute:
      type: object
      required:
        - id
        - host
        - path
        - pathType
        - action
        - status
        - disabled
        - main
        - primary
        - private
        - appInstanceId
        - appServiceId
        - portId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        host:
          type: string
        path:
          type: string
        pathType:
          type: string
        action:
          type: string
        redirectScheme:
          type: string
          nullable: true
        redirectHost:
          type: string
          nullable: true
        redirectPath:
          type: string
          nullable: true
        redirectStatusCode:
          type: integer
          nullable: true
        status:
          type: string
        disabled:
          type: boolean
        main:
          type: boolean
        primary:
          type: boolean
        private:
          type: boolean
        appInstanceId:
          type: integer
        appServiceId:
          type: integer
        portId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        lastSyncedAt:
          type: string
          format: date-time
          nullable: true
    Env:
      type: object
      required:
        - id
        - name
        - title
        - type
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        type:
          type: string
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Provider:
      type: object
      required:
        - id
        - name
        - title
        - status
        - public
        - revId
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        status:
          type: string
        public:
          type: boolean
        revId:
          type: integer
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ProviderRevision:
      type: object
      required:
        - id
        - name
        - title
        - number
        - version
        - providerId
        - createdAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        number:
          type: integer
        version:
          type: string
        providerId:
          type: integer
        manifest:
          $ref: '#/components/schemas/GenericObject'
        createdAt:
          type: string
          format: date-time
    ProvidersResponse:
      type: object
      required:
        - items
        - totalCount
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Provider'
        totalCount:
          type: integer
        nextPage:
          type: integer
          nullable: true
    Service:
      type: object
      required:
        - id
        - name
        - title
        - type
        - status
        - external
        - public
        - revId
        - latestRevNumber
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        type:
          type: string
        status:
          type: string
        external:
          type: boolean
        public:
          type: boolean
        revId:
          type: integer
        latestRevNumber:
          type: integer
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ServiceRevision:
      type: object
      required:
        - id
        - name
        - title
        - type
        - external
        - number
        - version
        - serviceId
        - createdAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        type:
          type: string
        external:
          type: boolean
        number:
          type: integer
        version:
          type: string
        serviceId:
          type: integer
        manifest:
          $ref: '#/components/schemas/GenericObject'
        createdAt:
          type: string
          format: date-time
    ServicesResponse:
      type: object
      required:
        - items
        - totalCount
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Service'
        totalCount:
          type: integer
        nextPage:
          type: integer
          nullable: true
    Stack:
      type: object
      required:
        - id
        - name
        - title
        - icon
        - status
        - public
        - revId
        - latestRevNumber
        - orgId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        icon:
          type: string
        status:
          type: string
        public:
          type: boolean
        revId:
          type: integer
        latestRevNumber:
          type: integer
        orgId:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    StackRevision:
      type: object
      required:
        - id
        - name
        - title
        - icon
        - number
        - draft
        - version
        - stackId
        - manifest
        - createdAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        icon:
          type: string
        number:
          type: integer
        draft:
          type: boolean
        version:
          type: string
        stackId:
          type: integer
        manifest:
          type: string
        createdAt:
          type: string
          format: date-time
    StackService:
      type: object
      required:
        - id
        - name
        - title
        - type
        - main
        - disabled
        - required
        - replicas
        - serviceRevId
        - serviceRevName
        - serviceRevTitle
        - serviceRevVersion
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        type:
          type: string
        main:
          type: boolean
        disabled:
          type: boolean
        required:
          type: boolean
        replicas:
          type: integer
        serviceRevId:
          type: integer
        serviceRevName:
          type: string
        serviceRevTitle:
          type: string
        serviceRevVersion:
          type: string
        buildSourceIntegrationId:
          type: integer
          nullable: true
        buildSourceRemoteRepoId:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    StacksResponse:
      type: object
      required:
        - items
        - totalCount
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Stack'
        totalCount:
          type: integer
        nextPage:
          type: integer
          nullable: true
    AppService:
      type: object
      required:
        - id
        - name
        - title
        - type
        - status
        - replicas
        - version
        - main
        - disabled
        - external
        - required
        - needsRebuild
        - needsRedeploy
        - configurationReady
        - appInstanceId
        - serviceRevId
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        title:
          type: string
        type:
          type: string
        status:
          type: string
        replicas:
          type: integer
        version:
          type: string
        main:
          type: boolean
        disabled:
          type: boolean
        external:
          type: boolean
        required:
          type: boolean
        needsRebuild:
          type: boolean
        needsRedeploy:
          type: boolean
        configurationReady:
          type: boolean
        appInstanceId:
          type: integer
        serviceRevId:
          type: integer
        parentAppServiceId:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Import:
      type: object
      required:
        - id
        - name
        - source
        - status
        - createdAt
        - updatedAt
      properties:
        id:
          type: integer
        name:
          type: string
        source:
          type: string
        status:
          type: string
        appInstanceId:
          type: integer
          nullable: true
        appServiceId:
          type: integer
          nullable: true
        databaseId:
          type: integer
          nullable: true
        databaseDbId:
          type: integer
          nullable: true
        appServiceDeploymentId:
          type: integer
          nullable: true
        taskId:
          type: integer
          nullable: true
        backupId:
          type: integer
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        startedAt:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
    TasksResponse:
      type: object
      required:
        - items
        - totalCount
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Task'
        totalCount:
          type: integer
        nextPage:
          type: integer
          nullable: true
    TaskStepLogs:
      type: object
      required:
        - lines
      properties:
        streamId:
          type: integer
          nullable: true
        lines:
          type: array
          items:
            $ref: '#/components/schemas/LogLine'
    LogLine:
      type: object
      required:
        - sequenceId
        - level
        - message
      properties:
        sequenceId:
          type: integer
        level:
          type: string
        message:
          type: string
    URLResponse:
      type: object
      required:
        - url
      properties:
        url:
          type: string
    RemoteGitRepo:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
    IntegrationScope:
      type: object
      required:
        - name
        - title
      properties:
        name:
          type: string
        title:
          type: string
    CloudRegion:
      $ref: '#/components/schemas/GenericObject'
    CloudZone:
      $ref: '#/components/schemas/GenericObject'
    CloudMachineType:
      $ref: '#/components/schemas/GenericObject'
    KubeVersion:
      type: object
      required:
        - name
        - title
      properties:
        name:
          type: string
        title:
          type: string
    KubeSettings:
      $ref: '#/components/schemas/GenericObject'
    DatabaseType:
      type: object
      required:
        - name
        - title
        - kind
      properties:
        name:
          type: string
        title:
          type: string
        kind:
          type: string
    DatabaseVersion:
      type: object
      required:
        - name
        - title
      properties:
        name:
          type: string
        title:
          type: string
    DatabaseSettings:
      $ref: '#/components/schemas/GenericObject'
    GenericObject:
      type: object
      additionalProperties: true
    CreateOrgRequest:
      type: object
      required:
        - name
        - title
      properties:
        name:
          type: string
        title:
          type: string
    UpdateOrgRequest:
      type: object
      required:
        - title
      properties:
        title:
          type: string
        registryIntegrationID:
          type: integer
          nullable: true
        ciIntegrationID:
          type: integer
          nullable: true
    UpdateTitleRequest:
      type: object
      required:
        - title
      properties:
        title:
          type: string
    CreateEnvRequest:
      type: object
      required:
        - orgId
        - name
        - title
        - type
      properties:
        orgId:
          type: integer
        name:
          type: string
        title:
          type: string
        type:
          type: string
    UpdateEnvRequest:
      type: object
      required:
        - name
        - title
        - type
      properties:
        name:
          type: string
        title:
          type: string
        type:
          type: string
    CreateDeploymentRequest:
      type: object
      required:
        - services
      properties:
        services:
          type: array
          items:
            $ref: '#/components/schemas/AppServiceDeploymentRequest'
        skipRollback:
          type: boolean
          nullable: true
    AppServiceDeploymentRequest:
      type: object
      required:
        - appServiceId
        - force
      properties:
        appServiceId:
          type: integer
        appServiceBuildId:
          type: integer
          nullable: true
        skipPostDeployment:
          type: boolean
          nullable: true
        force:
          type: boolean
    CreateBuildRequest:
      type: object
      properties:
        appServiceId:
          type: integer
        appServiceIds:
          type: array
          items:
            type: integer
      description: Specify either appServiceId for one service or appServiceIds for a multi-service build.
    NewBuildFromCIInput:
      type: object
      required:
        - appServiceID
        - gitCommitSHA
        - gitRef
        - gitRefType
        - buildNum
        - buildID
        - provider
      properties:
        appServiceID:
          type: integer
        gitCommitSHA:
          type: string
        gitRef:
          type: string
        gitRefType:
          type: string
        buildNum:
          type: integer
        buildID:
          type: string
        workflow:
          type: string
          nullable: true
        gitCommitAuthorName:
          type: string
          nullable: true
        gitCommitAuthorEmail:
          type: string
          nullable: true
        gitCommitMessage:
          type: string
          nullable: true
        provider:
          type: string
        postDeployment:
          type: string
          nullable: true
    DeploymentFromCIInput:
      type: object
      required:
        - appBuildID
        - services
        - skipPostDeployment
      properties:
        appBuildID:
          type: integer
        services:
          type: array
          items:
            $ref: '#/components/schemas/ServiceDeploymentInput'
        skipPostDeployment:
          type: boolean
    ServiceDeploymentInput:
      type: object
      required:
        - name
        - image
      properties:
        name:
          type: string
        image:
          type: string
    DockerRegistryCredentials:
      type: object
      required:
        - username
        - password
      properties:
        username:
          type: string
        password:
          type: string
    AppServiceInput:
      type: object
      properties:
        replicas:
          type: integer
          nullable: true
        version:
          type: string
          nullable: true
        disabled:
          type: boolean
          nullable: true
        main:
          type: boolean
          nullable: true
        buildSource:
          $ref: '#/components/schemas/BuildSourceInput'
    NewImportInput:
      type: object
      required:
        - import
      properties:
        appServiceID:
          type: integer
          nullable: true
        databaseDBID:
          type: integer
          nullable: true
        import:
          $ref: '#/components/schemas/ImportInput'
    RepeatTaskRequest:
      type: object
      required:
        - force
      properties:
        force:
          type: boolean
    NewProjectInput:
      type: object
      required:
        - orgID
        - name
        - title
      properties:
        orgID:
          type: integer
        name:
          type: string
        title:
          type: string
        teamIDs:
          type: array
          items:
            type: integer
        orgMembershipIDs:
          type: array
          items:
            type: integer
        role:
          type: string
    UpdateProjectInput:
      type: object
      required:
        - title
      properties:
        title:
          type: string
    NewAppInput:
      type: object
      required:
        - orgID
        - name
        - title
        - instanceName
        - instanceTitle
        - domain
        - stackRevID
        - services
        - envID
      properties:
        orgID:
          type: integer
        name:
          type: string
        title:
          type: string
        instanceName:
          type: string
        instanceTitle:
          type: string
        domain:
          type: string
        projectID:
          type: integer
          nullable: true
        stackRevID:
          type: integer
        services:
          type: array
          items:
            $ref: '#/components/schemas/NewAppServiceInput'
        clusterID:
          type: integer
          nullable: true
        newCluster:
          $ref: '#/components/schemas/NewManagedClusterInput'
        envID:
          type: integer
        ciIntegrationID:
          type: integer
          nullable: true
        registryIntegrationID:
          type: integer
          nullable: true
    NewAppInstanceInput:
      type: object
      required:
        - appID
        - instanceName
        - instanceTitle
        - domain
        - stackRevID
        - services
        - envID
      properties:
        appID:
          type: integer
        instanceName:
          type: string
        instanceTitle:
          type: string
        domain:
          type: string
        stackRevID:
          type: integer
        services:
          type: array
          items:
            $ref: '#/components/schemas/NewAppServiceInput'
        clusterID:
          type: integer
          nullable: true
        newCluster:
          $ref: '#/components/schemas/NewManagedClusterInput'
        envID:
          type: integer
        ciIntegrationID:
          type: integer
          nullable: true
        registryIntegrationID:
          type: integer
          nullable: true
    NewManagedClusterInput:
      type: object
      required:
        - demo
      properties:
        demo:
          type: boolean
        singleNode:
          type: boolean
          nullable: true
        region:
          type: string
          nullable: true
        machineType:
          type: string
          nullable: true
        minNodeCount:
          type: integer
          nullable: true
        maxNodeCount:
          type: integer
          nullable: true
    NewAppServiceInput:
      type: object
      required:
        - id
        - disabled
      properties:
        id:
          type: integer
        disabled:
          type: boolean
        version:
          type: string
          nullable: true
        buildSource:
          $ref: '#/components/schemas/BuildSourceInput'
        imports:
          type: array
          items:
            $ref: '#/components/schemas/ImportInput'
        volumes:
          type: array
          items:
            $ref: '#/components/schemas/VolumeSizeInput'
        integrations:
          type: array
          items:
            $ref: '#/components/schemas/AppServiceIntegrationInput'
        settings:
          type: array
          items:
            $ref: '#/components/schemas/AppServiceSettingInput'
        database:
          $ref: '#/components/schemas/AppServiceDatabaseInput'
        resources:
          $ref: '#/components/schemas/ResourcesInput'
        scalability:
          $ref: '#/components/schemas/ScalabilityInput'
    BuildSourceInput:
      type: object
      required:
        - buildSourceType
      properties:
        buildSourceType:
          type: string
        template:
          type: string
          nullable: true
        newRepoName:
          type: string
          nullable: true
        integrationID:
          type: integer
          nullable: true
        remoteGitRepoID:
          type: string
          nullable: true
        gitRef:
          type: string
          nullable: true
        gitRefType:
          type: string
          nullable: true
    ImportInput:
      type: object
      required:
        - source
      properties:
        importName:
          type: string
          nullable: true
        source:
          type: string
        url:
          type: string
          nullable: true
        backupID:
          type: integer
          nullable: true
        from:
          $ref: '#/components/schemas/ImportFromInput'
    ImportFromInput:
      type: object
      properties:
        databaseDBID:
          type: integer
          nullable: true
        appServiceID:
          type: integer
          nullable: true
        backupName:
          type: string
          nullable: true
    VolumeSizeInput:
      type: object
      required:
        - name
        - size
      properties:
        name:
          type: string
        size:
          type: integer
    AppServiceIntegrationInput:
      type: object
      required:
        - name
        - integrationIDs
      properties:
        name:
          type: string
        integrationIDs:
          type: array
          items:
            type: integer
    AppServiceSettingInput:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
        value:
          type: string
    AppServiceDatabaseInput:
      type: object
      required:
        - databaseID
      properties:
        databaseID:
          type: integer
        databaseDBID:
          type: integer
          nullable: true
    ResourcesInput:
      type: object
      properties:
        workload:
          type: string
          nullable: true
        container:
          type: string
          nullable: true
        requestCPU:
          type: integer
          nullable: true
        requestMem:
          type: integer
          nullable: true
        limitCPU:
          type: integer
          nullable: true
        limitMem:
          type: integer
          nullable: true
    ScalabilityInput:
      type: object
      required:
        - averageCPU
        - minReplicas
        - maxReplicas
      properties:
        averageCPU:
          type: integer
        minReplicas:
          type: integer
        maxReplicas:
          type: integer
    NewClusterInput:
      type: object
      required:
        - orgID
        - integrationID
        - name
        - title
        - serverless
        - disableMonitoring
      properties:
        orgID:
          type: integer
        projectID:
          type: integer
          nullable: true
        integrationID:
          type: integer
        name:
          type: string
        title:
          type: string
        serverless:
          type: boolean
        singleNode:
          type: boolean
          nullable: true
        version:
          type: string
          nullable: true
        machineType:
          type: string
          nullable: true
        minNodeCount:
          type: integer
          nullable: true
        maxNodeCount:
          type: integer
          nullable: true
        nodeDiskSize:
          type: integer
          nullable: true
        zone:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
        billingOption:
          type: string
          nullable: true
        disableMonitoring:
          type: boolean
    NewDatabaseInput:
      type: object
      required:
        - orgID
        - envID
        - name
        - title
        - integrationKindID
        - type
        - version
        - machineType
      properties:
        orgID:
          type: integer
        projectID:
          type: integer
          nullable: true
        envID:
          type: integer
        name:
          type: string
        title:
          type: string
        integrationKindID:
          type: integer
        type:
          type: string
        version:
          type: string
        machineType:
          type: string
        storageSize:
          type: integer
          nullable: true
        password:
          type: string
          nullable: true
        storageAutoscaling:
          type: boolean
          nullable: true
        highAvailability:
          type: boolean
          nullable: true
        region:
          type: string
          nullable: true
        zone:
          type: string
          nullable: true
        residedClusterID:
          type: integer
          nullable: true
        iops:
          type: integer
          nullable: true
    NewIntegrationInput:
      type: object
      required:
        - orgID
        - providerID
        - name
        - title
        - kinds
      properties:
        orgID:
          type: integer
        providerID:
          type: integer
        name:
          type: string
        title:
          type: string
        kinds:
          type: array
          items:
            type: string
        auth:
          type: string
          nullable: true
        projectID:
          type: integer
          nullable: true
        fieldsInput:
          type: array
          items:
            $ref: '#/components/schemas/FieldInput'
        scope:
          type: string
          nullable: true
    UpdateIntegrationInput:
      type: object
      required:
        - title
        - name
        - kinds
      properties:
        title:
          type: string
        name:
          type: string
        kinds:
          type: array
          items:
            type: string
        scope:
          type: string
          nullable: true
        fieldsInput:
          type: array
          items:
            $ref: '#/components/schemas/FieldInput'
    FieldInput:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
        value:
          type: string
    NewBackupInput:
      type: object
      required:
        - integrationID
        - bucket
      properties:
        appServiceID:
          type: integer
          nullable: true
        databaseDBID:
          type: integer
          nullable: true
        backupName:
          type: string
          nullable: true
        integrationID:
          type: integer
        bucket:
          type: string
        storageClass:
          type: string
          nullable: true
    NewAppRouteInput:
      type: object
      required:
        - appServiceID
        - main
        - primary
        - port
        - host
      properties:
        appServiceID:
          type: integer
        main:
          type: boolean
        primary:
          type: boolean
        port:
          type: integer
        host:
          type: string
        path:
          type: string
          nullable: true
        pathType:
          type: string
          nullable: true
          enum:
            - PREFIX
            - EXACT
        action:
          type: string
          nullable: true
          enum:
            - BACKEND
            - REDIRECT
        redirectScheme:
          type: string
          nullable: true
        redirectHost:
          type: string
          nullable: true
        redirectPath:
          type: string
          nullable: true
        redirectStatusCode:
          type: integer
          nullable: true
        letsencrypt:
          type: boolean
          nullable: true
        authLogin:
          type: string
          nullable: true
        authPassword:
          type: string
          nullable: true
        authID:
          type: integer
          nullable: true
        options:
          type: array
          items:
            $ref: '#/components/schemas/AppEndpointOptionInput'
    UpdateAppRouteInput:
      type: object
      properties:
        disabled:
          type: boolean
          nullable: true
        main:
          type: boolean
          nullable: true
        primary:
          type: boolean
          nullable: true
        path:
          type: string
          nullable: true
        pathType:
          type: string
          nullable: true
          enum:
            - PREFIX
            - EXACT
        action:
          type: string
          nullable: true
          enum:
            - BACKEND
            - REDIRECT
        redirectScheme:
          type: string
          nullable: true
        redirectHost:
          type: string
          nullable: true
        redirectPath:
          type: string
          nullable: true
        redirectStatusCode:
          type: integer
          nullable: true
        options:
          type: array
          items:
            $ref: '#/components/schemas/AppEndpointOptionInput'
    AppEndpointOptionInput:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
        value:
          type: string
