{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ownkube-io/json-schema/ownkube-io-deployment-schema.json",
  "title": "Deployment",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ownkube-io-openapi.json#/components/schemas/Deployment",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "displayName": {
      "type": [
        "string",
        "null"
      ]
    },
    "clusterId": {
      "type": [
        "string",
        "null"
      ]
    },
    "region": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Ownkube Compute region this deployment runs in (an id from list_regions, e.g. `europe`). Null when it runs on your own cluster."
    },
    "environmentId": {
      "type": [
        "string",
        "null"
      ]
    },
    "registryId": {
      "type": [
        "string",
        "null"
      ]
    },
    "resourceType": {
      "type": "string",
      "enum": [
        "web",
        "worker",
        "job",
        "database",
        "cache",
        "function",
        "workspace"
      ]
    },
    "status": {
      "type": "string"
    },
    "statusMessage": {
      "type": [
        "string",
        "null"
      ]
    },
    "publicHostname": {
      "type": [
        "string",
        "null"
      ]
    },
    "autoDeployEnabled": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "source": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "git",
            "upload",
            "image"
          ],
          "description": "git: built from a connected repository on every push. upload: built from uploaded source. image: runs a prebuilt image."
        },
        "provider": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "github",
            "gitlab",
            null
          ],
          "description": "The repository's host, for git sources."
        },
        "repository": {
          "type": [
            "string",
            "null"
          ],
          "description": "The repository path, e.g. owner/repo or group/sub/project."
        },
        "branch": {
          "type": [
            "string",
            "null"
          ],
          "description": "The branch pushes deploy from, for git sources."
        },
        "connectionId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The repository connection this app builds through."
        },
        "buildContext": {
          "type": [
            "string",
            "null"
          ],
          "description": "Root directory the build runs in; null is the repo root."
        },
        "dockerfilePath": {
          "type": [
            "string",
            "null"
          ],
          "description": "Dockerfile path inside the root directory; null is default."
        },
        "autoDeploy": {
          "type": "boolean",
          "description": "Whether pushes deploy automatically."
        },
        "waitForChecks": {
          "type": "boolean",
          "description": "Whether push builds wait for the commit's checks to pass."
        },
        "watchPaths": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "Globs a push must touch to build; null means every push builds."
        }
      },
      "required": [
        "type",
        "provider",
        "repository",
        "branch",
        "connectionId",
        "buildContext",
        "dockerfilePath",
        "autoDeploy",
        "waitForChecks",
        "watchPaths"
      ],
      "description": "Where the code comes from (repository, upload or image). Null for databases, caches and functions."
    },
    "templateInstanceId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Set when this deployment is part of a marketplace app: every piece one marketplace deploy created shares it. Pass it to delete_marketplace_app to remove the whole app."
    },
    "templateSlug": {
      "type": [
        "string",
        "null"
      ],
      "description": "The marketplace app this deployment came from, e.g. `n8n`."
    },
    "appConfig": {
      "nullable": true
    },
    "createdAt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "format": "date-time"
        }
      ]
    },
    "updatedAt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "string",
          "format": "date-time"
        }
      ]
    }
  },
  "required": [
    "id",
    "name",
    "clusterId",
    "environmentId",
    "registryId",
    "resourceType",
    "status",
    "statusMessage",
    "publicHostname"
  ]
}