Ctrl K
ComunidadGuías…

openapi.yaml

Rama main · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
openapi: 3.1.0
info:
  title: Coolify
  version: '0.1'
servers:
  -
    url: 'https://app.coolify.io/api/v1'
    description: 'Coolify Cloud API. Change the host to your own instance if you are self-hosting.'
paths:
  '/applications/{uuid}/previews':
    get:
      tags:
        - Applications
      summary: 'List Preview Deployments'
      description: 'List the preview deployments of an application, newest pull request first.'
      operationId: list-preview-deployments-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'List of preview deployments.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApplicationPreview'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Applications
      summary: 'Create Preview Deployment'
      description: 'Open a preview deployment for a pull request and queue its deployment. When the preview already exists, it is redeployed. A token with the deploy permission can only redeploy an existing preview without changes; opening a preview, changing its pull request URL, git type, or docker tag, or choosing a commit also needs the write permission. Git based applications need git_type unless they use a GitHub or GitLab App source; Bitbucket also needs commit. Docker Image applications need docker_tag for a new preview.'
      operationId: create-preview-deployment-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - pull_request_id
              properties:
                pull_request_id:
                  type: integer
                  example: 42
                  maximum: 2147483647
                  minimum: 1
                pull_request_html_url:
                  type: [string, 'null']
                  example: 'https://github.com/org/repo/pull/42'
                git_type:
                  description: 'Git provider that hosts the pull request. Sets the ref Coolify fetches (pull/{id}/head or merge-requests/{id}/head).'
                  type: [string, 'null']
                  enum: [github, gitlab, gitea, bitbucket]
                commit:
                  description: 'Commit SHA to deploy. Required for a new Bitbucket preview. Needs the write permission.'
                  type: [string, 'null']
                docker_tag:
                  description: 'Docker image tag. Docker Image applications only.'
                  type: [string, 'null']
                force:
                  description: 'Rebuild without cache.'
                  type: boolean
                  default: false
                instant_deploy:
                  description: 'Queue a deployment. Set to false to only create the preview, for example to set its domains first.'
                  type: boolean
                  default: true
              type: object
      responses:
        '200':
          description: 'Existing preview deployment updated.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationPreviewDeployment'
        '201':
          description: 'Preview deployment created.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationPreviewDeployment'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Missing permissions. Opening or changing a preview needs the write permission.'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
        '429':
          description: 'Deployment queue is full.'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/previews/{pull_request_id}':
    get:
      tags:
        - Applications
      summary: 'Get Preview Deployment'
      description: 'Get a preview deployment by pull request ID.'
      operationId: get-preview-deployment-by-pull-request-id
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: pull_request_id
          in: path
          description: 'Pull request ID of the preview.'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: 'Preview deployment.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationPreview'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
    delete:
      tags:
        - Applications
      summary: 'Delete Preview Deployment'
      description: 'Delete a preview deployment for a pull request. Cancels active deployments, stops containers, removes volumes/networks, and deletes the preview record. Needs a token with the write and deploy permissions.'
      operationId: delete-preview-deployment-by-pull-request-id
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: pull_request_id
          in: path
          description: 'Pull request ID of the preview to delete.'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: 'Preview deletion queued.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
        '403':
          description: 'The token needs the write and deploy permissions.'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Applications
      summary: 'Update Preview Domains'
      description: 'Replace domains for a preview deployment. Use domains for regular applications or docker_compose_domains for Docker Compose applications. Ports are stored as internal overrides while public domains remain portless.'
      operationId: update-preview-domains-by-pull-request-id
      parameters:
        -
          name: uuid
          in: path
          required: true
          schema:
            type: string
        -
          name: pull_request_id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                domains:
                  type: [string, 'null']
                  example: 'https://pr.example.com:3000'
                docker_compose_domains:
                  type: [array, 'null']
                  items: { properties: { name: { type: string }, domain: { type: [string, 'null'] }, redirect: { type: [string, 'null'], enum: [www, non-www, both] } }, type: object }
                force_domain_override:
                  type: boolean
                  default: false
              type: object
      responses:
        '200':
          description: 'Preview domains updated.'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: 'Domain conflict.'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /applications:
    get:
      tags:
        - Applications
      summary: List
      description: 'List all applications.'
      operationId: list-applications
      parameters:
        -
          name: tag
          in: query
          description: 'Filter applications by tag name.'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: 'Get all applications.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Application'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
      security:
        -
          bearerAuth: []
  /applications/public:
    post:
      tags:
        - Applications
      summary: 'Create (Public)'
      description: 'Create new application based on a public git repository.'
      operationId: create-public-application
      requestBody:
        description: 'Application object that needs to be created.'
        required: true
        content:
          application/json:
            schema:
              required:
                - project_uuid
                - server_uuid
                - git_repository
                - git_branch
                - build_pack
              properties:
                project_uuid:
                  type: string
                  description: 'The project UUID.'
                server_uuid:
                  type: string
                  description: 'The server UUID.'
                environment_name:
                  type: string
                  description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
                git_repository:
                  type: string
                  description: 'The git repository URL.'
                git_branch:
                  type: string
                  description: 'The git branch.'
                git_https_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTPS access to a private repository on a custom Git host (not github.com).'
                git_https_password:
                  type: string
                  nullable: true
                  description: 'Password or access token for HTTPS access to a private repository on a custom Git host (not github.com). It is stored encrypted and never returned.'
                build_pack:
                  type: string
                  enum: [nixpacks, railpack, static, dockerfile, dockercompose]
                  description: 'The build pack type.'
                ports_exposes:
                  type: string
                  description: 'The ports to expose.'
                destination_uuid:
                  type: string
                  description: 'The destination UUID.'
                name:
                  type: string
                  description: 'The application name.'
                description:
                  type: string
                  description: 'The application description.'
                domains:
                  type: string
                  description: 'The application URLs in a comma-separated list.'
                noindex_domains:
                  type: array
                  items: { type: string }
                  description: 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header, keeping them out of search engines. Entries that are not among the application domains are ignored.'
                git_commit_sha:
                  type: string
                  description: 'The git commit SHA.'
                docker_registry_image_name:
                  type: string
                  description: 'The docker registry image name.'
                docker_registry_image_tag:
                  type: string
                  description: 'The docker registry image tag.'
                is_static:
                  type: boolean
                  description: 'The flag to indicate if the application is static.'
                is_spa:
                  type: boolean
                  description: 'The flag to indicate if the application is a single-page application (SPA). Only relevant when is_static is true.'
                is_auto_deploy_enabled:
                  type: boolean
                  description: 'The flag to indicate if auto-deploy is enabled on git push. Defaults to true.'
                is_force_https_enabled:
                  type: boolean
                  description: 'The flag to indicate if HTTPS is forced. Defaults to true.'
                is_preview_deployments_enabled:
                  type: boolean
                  description: 'Enable preview deployments for pull requests.'
                static_image:
                  type: string
                  enum: ['nginx:alpine']
                  description: 'The static image.'
                install_command:
                  type: string
                  description: 'The install command.'
                build_command:
                  type: string
                  description: 'The build command.'
                start_command:
                  type: string
                  description: 'The start command.'
                ports_mappings:
                  type: string
                  description: 'The ports mappings.'
                base_directory:
                  type: string
                  description: 'The base directory for all commands.'
                publish_directory:
                  type: string
                  description: 'The publish directory.'
                health_check_enabled:
                  type: boolean
                  description: 'Health check enabled.'
                health_check_path:
                  type: string
                  description: 'Health check path.'
                health_check_port:
                  type: string
                  nullable: true
                  description: 'Health check port.'
                health_check_host:
                  type: string
                  nullable: true
                  description: 'Health check host.'
                health_check_method:
                  type: string
                  description: 'Health check method.'
                health_check_return_code:
                  type: integer
                  description: 'Health check return code.'
                health_check_scheme:
                  type: string
                  description: 'Health check scheme.'
                health_check_response_text:
                  type: string
                  nullable: true
                  description: 'Health check response text.'
                health_check_interval:
                  type: integer
                  description: 'Health check interval in seconds.'
                health_check_timeout:
                  type: integer
                  description: 'Health check timeout in seconds.'
                health_check_retries:
                  type: integer
                  description: 'Health check retries count.'
                health_check_start_period:
                  type: integer
                  description: 'Health check start period in seconds.'
                limits_memory:
                  type: string
                  description: 'Memory limit.'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit.'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness.'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation.'
                limits_cpus:
                  type: string
                  description: 'CPU limit.'
                limits_cpuset:
                  type: string
                  nullable: true
                  description: 'CPU set.'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares.'
                custom_labels:
                  type: string
                  description: 'Custom labels.'
                custom_docker_run_options:
                  type: string
                  description: 'Custom docker run options.'
                post_deployment_command:
                  type: string
                  description: 'Post deployment command.'
                post_deployment_command_container:
                  type: string
                  description: 'Post deployment command container.'
                pre_deployment_command:
                  type: string
                  description: 'Pre deployment command.'
                pre_deployment_command_container:
                  type: string
                  description: 'Pre deployment command container.'
                manual_webhook_secret_github:
                  type: string
                  description: 'Manual webhook secret for Github. Needs the deploy ability.'
                manual_webhook_secret_gitlab:
                  type: string
                  description: 'Manual webhook secret for Gitlab. Needs the deploy ability.'
                manual_webhook_secret_bitbucket:
                  type: string
                  description: 'Manual webhook secret for Bitbucket. Needs the deploy ability.'
                manual_webhook_secret_gitea:
                  type: string
                  description: 'Manual webhook secret for Gitea. Needs the deploy ability.'
                redirect:
                  type: string
                  nullable: true
                  description: 'How to set redirect with Traefik / Caddy. www<->non-www.'
                  enum: [www, non-www, both]
                instant_deploy:
                  type: boolean
                  description: 'The flag to indicate if the application should be deployed instantly.'
                dockerfile:
                  type: string
                  description: 'The Dockerfile content.'
                dockerfile_location:
                  type: string
                  description: 'The Dockerfile location in the repository.'
                dockerfile_target_build:
                  type: string
                  nullable: true
                  description: 'The Docker build target (stage) in the Dockerfile.'
                docker_compose_location:
                  type: string
                  description: 'The Docker Compose location.'
                docker_compose_custom_start_command:
                  type: string
                  description: 'The Docker Compose custom start command.'
                docker_compose_custom_build_command:
                  type: string
                  description: 'The Docker Compose custom build command.'
                docker_compose_domains:
                  type: array
                  description: 'Array of URLs to be applied to containers of a dockercompose application.'
                  items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, domain: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io")' }, redirect: { type: string, nullable: true, description: 'Per-service www/non-www redirect for this compose service.', enum: [www, non-www, both] } }, type: object }
                watch_paths:
                  type: string
                  description: 'Watch path patterns, one per line (newline-separated). Commas do not separate patterns.'
                use_build_server:
                  type: boolean
                  nullable: true
                  description: 'Use build server.'
                use_build_secrets:
                  type: boolean
                  default: false
                  description: 'Use Docker Build Secrets for build-time environment variables.'
                is_git_submodules_enabled:
                  type: boolean
                  description: 'Clone Git submodules.'
                is_git_lfs_enabled:
                  type: boolean
                  description: 'Enable Git LFS.'
                is_git_shallow_clone_enabled:
                  type: boolean
                  description: 'Use a shallow Git clone.'
                is_auto_cancel_queued_deployments_enabled:
                  type: boolean
                  description: 'Cancel older queued webhook deployments when a newer push arrives. Default: true.'
                is_auto_cancel_building_deployments_enabled:
                  type: boolean
                  description: 'Also stop an older webhook deployment that is still building when a newer push arrives. A deployment that already started to replace containers always finishes. This also cancels queued webhook deployments. Default: false.'
                disable_build_cache:
                  type: boolean
                  description: 'Disable the build cache.'
                inject_build_args_to_dockerfile:
                  type: boolean
                  description: 'Inject build arguments into the Dockerfile build.'
                include_source_commit_in_build:
                  type: boolean
                  description: 'Include the source commit in the build.'
                include_network_hosts_in_build:
                  type: boolean
                  description: 'Add the containers of the destination network as build hosts.'
                is_env_sorting_enabled:
                  type: boolean
                  description: 'Sort environment variables.'
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  default: true
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Redeploy to apply it.'
                is_pr_deployments_public_enabled:
                  type: boolean
                  description: 'Make pull request deployments public.'
                stop_grace_period:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 3600
                  description: 'Container stop grace period in seconds.'
                rolling_update_drain_seconds:
                  type: integer
                  minimum: 0
                  maximum: 300
                  description: 'Seconds to wait after the new container is healthy before old containers stop during a rolling update. 0 turns the wait off. Default: 5.'
                docker_images_to_keep:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: 'Number of Docker images to retain.'
                is_gzip_enabled:
                  type: boolean
                  description: 'Enable gzip compression.'
                is_stripprefix_enabled:
                  type: boolean
                  description: 'Enable path prefix stripping.'
                is_permanent_redirect_enabled:
                  type: boolean
                  description: 'Use permanent redirects (301/308) instead of temporary (302/307) for the HTTP to HTTPS and www redirects. Defaults to false.'
                traefik_certificate_resolver:
                  type: string
                  nullable: true
                  description: 'Traefik certificate resolver for this application. Null uses the server setting, "none" uses no resolver.'
                is_container_label_readonly_enabled:
                  type: boolean
                  default: true
                  description: 'Let Coolify manage the container labels. True regenerates custom_labels from domains, redirect, and proxy settings. False keeps custom_labels as you set them: domains, redirect, and basic auth changes then do not change the labels.'
                is_raw_compose_deployment_enabled:
                  type: boolean
                  description: 'Deploy the raw Docker Compose definition.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Enable log drain for the application.'
                is_gpu_enabled:
                  type: boolean
                  description: 'Enable GPU support.'
                gpu_driver:
                  type: string
                  nullable: true
                  description: 'GPU driver name.'
                gpu_count:
                  type: string
                  nullable: true
                  description: 'Number of GPUs to allocate.'
                gpu_device_ids:
                  type: string
                  nullable: true
                  description: 'Comma-separated GPU device IDs.'
                gpu_options:
                  type: string
                  nullable: true
                  description: 'Additional GPU options.'
                is_consistent_container_name_enabled:
                  type: boolean
                  description: 'Use a consistent container name across deployments.'
                is_image_scan_enabled:
                  type: boolean
                  description: 'Scan the images of the application for vulnerabilities. Needs image scanning on the server. Default true.'
                custom_internal_name:
                  type: string
                  nullable: true
                  description: 'Custom internal container name. Turns is_consistent_container_name_enabled on when that field is not sent; sending it as false together with a name returns 422.'
                custom_container_name_prefix:
                  type: string
                  nullable: true
                  description: 'Prefix for generated container names (prefix-20260908T141530). Slugified and unique across the instance.'
                preview_url_template:
                  type: string
                  description: 'Preview URL template.'
                max_restart_count:
                  type: integer
                  minimum: 0
                  description: 'Maximum container restart count before stopping.'
                is_http_basic_auth_enabled:
                  type: boolean
                  description: 'HTTP Basic Authentication enabled.'
                http_basic_auth_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTP Basic Authentication'
                http_basic_auth_password:
                  type: string
                  nullable: true
                  description: 'Password for HTTP Basic Authentication'
                http_basic_auth_hash_algorithm:
                  type: string
                  enum: [bcrypt, argon2id]
                  default: bcrypt
                  description: 'Hash algorithm for the HTTP Basic Authentication password. Argon2id needs the Caddy proxy, version 2.11 or newer.'
                http_basic_auth_bcrypt_cost:
                  type: integer
                  minimum: 4
                  maximum: 14
                  default: 10
                  description: 'Bcrypt cost for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_memory_cost:
                  type: integer
                  minimum: 8192
                  maximum: 262144
                  default: 65536
                  description: 'Argon2id memory cost in KiB for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_time_cost:
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 4
                  description: 'Argon2id time cost (iterations) for the HTTP Basic Authentication password.'
                connect_to_docker_network:
                  type: boolean
                  description: 'The flag to connect the service to the predefined Docker network.'
                force_domain_override:
                  type: boolean
                  description: 'Force domain usage even if conflicts are detected. Default is false.'
                autogenerate_domain:
                  type: boolean
                  default: true
                  description: "If true and domains is empty, auto-generate a domain using the server's wildcard domain or sslip.io fallback. Ignored for the dockercompose build pack, which uses docker_compose_domains. Default: true."
                is_container_label_escape_enabled:
                  type: boolean
                  default: true
                  description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the application.'
                is_preserve_repository_enabled:
                  type: boolean
                  default: false
                  description: 'Preserve repository during deployment.'
              type: object
      responses:
        '201':
          description: 'Application created successfully.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to set a manual webhook secret.'
        '400':
          $ref: '#/components/responses/400'
        '409':
          description: 'Domain conflicts detected.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }
                  warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }
                  conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }
                type: object
      security:
        -
          bearerAuth: []
  /applications/private-github-app:
    post:
      tags:
        - Applications
      summary: 'Create (Private - GH App)'
      description: 'Create new application based on a private repository through a Github App.'
      operationId: create-private-github-app-application
      requestBody:
        description: 'Application object that needs to be created.'
        required: true
        content:
          application/json:
            schema:
              required:
                - project_uuid
                - server_uuid
                - github_app_uuid
                - git_repository
                - git_branch
                - build_pack
              properties:
                project_uuid:
                  type: string
                  description: 'The project UUID.'
                server_uuid:
                  type: string
                  description: 'The server UUID.'
                environment_name:
                  type: string
                  description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
                github_app_uuid:
                  type: string
                  description: 'The Github App UUID.'
                git_repository:
                  type: string
                  description: 'The git repository URL.'
                git_branch:
                  type: string
                  description: 'The git branch.'
                ports_exposes:
                  type: string
                  description: 'The ports to expose.'
                destination_uuid:
                  type: string
                  description: 'The destination UUID.'
                build_pack:
                  type: string
                  enum: [nixpacks, railpack, static, dockerfile, dockercompose]
                  description: 'The build pack type.'
                name:
                  type: string
                  description: 'The application name.'
                description:
                  type: string
                  description: 'The application description.'
                domains:
                  type: string
                  description: 'The application URLs in a comma-separated list.'
                noindex_domains:
                  type: array
                  items: { type: string }
                  description: 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header, keeping them out of search engines. Entries that are not among the application domains are ignored.'
                git_commit_sha:
                  type: string
                  description: 'The git commit SHA.'
                docker_registry_image_name:
                  type: string
                  description: 'The docker registry image name.'
                docker_registry_image_tag:
                  type: string
                  description: 'The docker registry image tag.'
                is_static:
                  type: boolean
                  description: 'The flag to indicate if the application is static.'
                is_spa:
                  type: boolean
                  description: 'The flag to indicate if the application is a single-page application (SPA). Only relevant when is_static is true.'
                is_auto_deploy_enabled:
                  type: boolean
                  description: 'The flag to indicate if auto-deploy is enabled on git push. Defaults to true.'
                is_force_https_enabled:
                  type: boolean
                  description: 'The flag to indicate if HTTPS is forced. Defaults to true.'
                is_preview_deployments_enabled:
                  type: boolean
                  description: 'Enable preview deployments for pull requests.'
                static_image:
                  type: string
                  enum: ['nginx:alpine']
                  description: 'The static image.'
                install_command:
                  type: string
                  description: 'The install command.'
                build_command:
                  type: string
                  description: 'The build command.'
                start_command:
                  type: string
                  description: 'The start command.'
                ports_mappings:
                  type: string
                  description: 'The ports mappings.'
                base_directory:
                  type: string
                  description: 'The base directory for all commands.'
                publish_directory:
                  type: string
                  description: 'The publish directory.'
                health_check_enabled:
                  type: boolean
                  description: 'Health check enabled.'
                health_check_path:
                  type: string
                  description: 'Health check path.'
                health_check_port:
                  type: string
                  nullable: true
                  description: 'Health check port.'
                health_check_host:
                  type: string
                  nullable: true
                  description: 'Health check host.'
                health_check_method:
                  type: string
                  description: 'Health check method.'
                health_check_return_code:
                  type: integer
                  description: 'Health check return code.'
                health_check_scheme:
                  type: string
                  description: 'Health check scheme.'
                health_check_response_text:
                  type: string
                  nullable: true
                  description: 'Health check response text.'
                health_check_interval:
                  type: integer
                  description: 'Health check interval in seconds.'
                health_check_timeout:
                  type: integer
                  description: 'Health check timeout in seconds.'
                health_check_retries:
                  type: integer
                  description: 'Health check retries count.'
                health_check_start_period:
                  type: integer
                  description: 'Health check start period in seconds.'
                limits_memory:
                  type: string
                  description: 'Memory limit.'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit.'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness.'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation.'
                limits_cpus:
                  type: string
                  description: 'CPU limit.'
                limits_cpuset:
                  type: string
                  nullable: true
                  description: 'CPU set.'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares.'
                custom_labels:
                  type: string
                  description: 'Custom labels.'
                custom_docker_run_options:
                  type: string
                  description: 'Custom docker run options.'
                post_deployment_command:
                  type: string
                  description: 'Post deployment command.'
                post_deployment_command_container:
                  type: string
                  description: 'Post deployment command container.'
                pre_deployment_command:
                  type: string
                  description: 'Pre deployment command.'
                pre_deployment_command_container:
                  type: string
                  description: 'Pre deployment command container.'
                manual_webhook_secret_github:
                  type: string
                  description: 'Manual webhook secret for Github. Needs the deploy ability.'
                manual_webhook_secret_gitlab:
                  type: string
                  description: 'Manual webhook secret for Gitlab. Needs the deploy ability.'
                manual_webhook_secret_bitbucket:
                  type: string
                  description: 'Manual webhook secret for Bitbucket. Needs the deploy ability.'
                manual_webhook_secret_gitea:
                  type: string
                  description: 'Manual webhook secret for Gitea. Needs the deploy ability.'
                redirect:
                  type: string
                  nullable: true
                  description: 'How to set redirect with Traefik / Caddy. www<->non-www.'
                  enum: [www, non-www, both]
                instant_deploy:
                  type: boolean
                  description: 'The flag to indicate if the application should be deployed instantly.'
                dockerfile:
                  type: string
                  description: 'The Dockerfile content.'
                dockerfile_location:
                  type: string
                  description: 'The Dockerfile location in the repository'
                dockerfile_target_build:
                  type: string
                  nullable: true
                  description: 'The Docker build target (stage) in the Dockerfile.'
                docker_compose_location:
                  type: string
                  description: 'The Docker Compose location.'
                docker_compose_custom_start_command:
                  type: string
                  description: 'The Docker Compose custom start command.'
                docker_compose_custom_build_command:
                  type: string
                  description: 'The Docker Compose custom build command.'
                docker_compose_domains:
                  type: array
                  description: 'Array of URLs to be applied to containers of a dockercompose application.'
                  items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, domain: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io")' }, redirect: { type: string, nullable: true, description: 'Per-service www/non-www redirect for this compose service.', enum: [www, non-www, both] } }, type: object }
                watch_paths:
                  type: string
                  description: 'Watch path patterns, one per line (newline-separated). Commas do not separate patterns.'
                use_build_server:
                  type: boolean
                  nullable: true
                  description: 'Use build server.'
                use_build_secrets:
                  type: boolean
                  default: false
                  description: 'Use Docker Build Secrets for build-time environment variables.'
                is_git_submodules_enabled:
                  type: boolean
                  description: 'Clone Git submodules.'
                is_git_lfs_enabled:
                  type: boolean
                  description: 'Enable Git LFS.'
                is_git_shallow_clone_enabled:
                  type: boolean
                  description: 'Use a shallow Git clone.'
                is_auto_cancel_queued_deployments_enabled:
                  type: boolean
                  description: 'Cancel older queued webhook deployments when a newer push arrives. Default: true.'
                is_auto_cancel_building_deployments_enabled:
                  type: boolean
                  description: 'Also stop an older webhook deployment that is still building when a newer push arrives. A deployment that already started to replace containers always finishes. This also cancels queued webhook deployments. Default: false.'
                disable_build_cache:
                  type: boolean
                  description: 'Disable the build cache.'
                inject_build_args_to_dockerfile:
                  type: boolean
                  description: 'Inject build arguments into the Dockerfile build.'
                include_source_commit_in_build:
                  type: boolean
                  description: 'Include the source commit in the build.'
                include_network_hosts_in_build:
                  type: boolean
                  description: 'Add the containers of the destination network as build hosts.'
                is_env_sorting_enabled:
                  type: boolean
                  description: 'Sort environment variables.'
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  default: true
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Redeploy to apply it.'
                is_pr_deployments_public_enabled:
                  type: boolean
                  description: 'Make pull request deployments public.'
                stop_grace_period:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 3600
                  description: 'Container stop grace period in seconds.'
                rolling_update_drain_seconds:
                  type: integer
                  minimum: 0
                  maximum: 300
                  description: 'Seconds to wait after the new container is healthy before old containers stop during a rolling update. 0 turns the wait off. Default: 5.'
                docker_images_to_keep:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: 'Number of Docker images to retain.'
                is_gzip_enabled:
                  type: boolean
                  description: 'Enable gzip compression.'
                is_stripprefix_enabled:
                  type: boolean
                  description: 'Enable path prefix stripping.'
                is_permanent_redirect_enabled:
                  type: boolean
                  description: 'Use permanent redirects (301/308) instead of temporary (302/307) for the HTTP to HTTPS and www redirects. Defaults to false.'
                traefik_certificate_resolver:
                  type: string
                  nullable: true
                  description: 'Traefik certificate resolver for this application. Null uses the server setting, "none" uses no resolver.'
                is_container_label_readonly_enabled:
                  type: boolean
                  default: true
                  description: 'Let Coolify manage the container labels. True regenerates custom_labels from domains, redirect, and proxy settings. False keeps custom_labels as you set them: domains, redirect, and basic auth changes then do not change the labels.'
                is_raw_compose_deployment_enabled:
                  type: boolean
                  description: 'Deploy the raw Docker Compose definition.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Enable log drain for the application.'
                is_gpu_enabled:
                  type: boolean
                  description: 'Enable GPU support.'
                gpu_driver:
                  type: string
                  nullable: true
                  description: 'GPU driver name.'
                gpu_count:
                  type: string
                  nullable: true
                  description: 'Number of GPUs to allocate.'
                gpu_device_ids:
                  type: string
                  nullable: true
                  description: 'Comma-separated GPU device IDs.'
                gpu_options:
                  type: string
                  nullable: true
                  description: 'Additional GPU options.'
                is_consistent_container_name_enabled:
                  type: boolean
                  description: 'Use a consistent container name across deployments.'
                is_image_scan_enabled:
                  type: boolean
                  description: 'Scan the images of the application for vulnerabilities. Needs image scanning on the server. Default true.'
                custom_internal_name:
                  type: string
                  nullable: true
                  description: 'Custom internal container name. Turns is_consistent_container_name_enabled on when that field is not sent; sending it as false together with a name returns 422.'
                custom_container_name_prefix:
                  type: string
                  nullable: true
                  description: 'Prefix for generated container names (prefix-20260908T141530). Slugified and unique across the instance.'
                preview_url_template:
                  type: string
                  description: 'Preview URL template.'
                max_restart_count:
                  type: integer
                  minimum: 0
                  description: 'Maximum container restart count before stopping.'
                is_http_basic_auth_enabled:
                  type: boolean
                  description: 'HTTP Basic Authentication enabled.'
                http_basic_auth_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTP Basic Authentication'
                http_basic_auth_password:
                  type: string
                  nullable: true
                  description: 'Password for HTTP Basic Authentication'
                http_basic_auth_hash_algorithm:
                  type: string
                  enum: [bcrypt, argon2id]
                  default: bcrypt
                  description: 'Hash algorithm for the HTTP Basic Authentication password. Argon2id needs the Caddy proxy, version 2.11 or newer.'
                http_basic_auth_bcrypt_cost:
                  type: integer
                  minimum: 4
                  maximum: 14
                  default: 10
                  description: 'Bcrypt cost for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_memory_cost:
                  type: integer
                  minimum: 8192
                  maximum: 262144
                  default: 65536
                  description: 'Argon2id memory cost in KiB for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_time_cost:
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 4
                  description: 'Argon2id time cost (iterations) for the HTTP Basic Authentication password.'
                connect_to_docker_network:
                  type: boolean
                  description: 'The flag to connect the service to the predefined Docker network.'
                force_domain_override:
                  type: boolean
                  description: 'Force domain usage even if conflicts are detected. Default is false.'
                autogenerate_domain:
                  type: boolean
                  default: true
                  description: "If true and domains is empty, auto-generate a domain using the server's wildcard domain or sslip.io fallback. Ignored for the dockercompose build pack, which uses docker_compose_domains. Default: true."
                is_container_label_escape_enabled:
                  type: boolean
                  default: true
                  description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the application.'
                is_preserve_repository_enabled:
                  type: boolean
                  default: false
                  description: 'Preserve repository during deployment.'
              type: object
      responses:
        '201':
          description: 'Application created successfully.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to set a manual webhook secret.'
        '400':
          $ref: '#/components/responses/400'
        '409':
          description: 'Domain conflicts detected.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }
                  warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }
                  conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }
                type: object
      security:
        -
          bearerAuth: []
  /applications/private-gitea-app:
    post:
      tags:
        - Applications
      summary: 'Create (Private - Gitea App)'
      description: 'Create new application based on a private repository through a Gitea App.'
      operationId: create-private-gitea-app-application
      requestBody:
        description: 'Application object that needs to be created.'
        required: true
        content:
          application/json:
            schema:
              required:
                - project_uuid
                - server_uuid
                - gitea_app_uuid
                - git_repository
                - git_branch
                - build_pack
              properties:
                project_uuid:
                  type: string
                  description: 'The project UUID.'
                server_uuid:
                  type: string
                  description: 'The server UUID.'
                environment_name:
                  type: string
                  description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
                gitea_app_uuid:
                  type: string
                  description: 'The Gitea App UUID. The source must be connected.'
                git_repository:
                  type: string
                  description: 'The repository as owner/name, or its URL on the Gitea instance.'
                git_branch:
                  type: string
                  description: 'The git branch.'
                ports_exposes:
                  type: string
                  description: 'The ports to expose.'
                destination_uuid:
                  type: string
                  description: 'The destination UUID.'
                build_pack:
                  type: string
                  enum: [nixpacks, railpack, static, dockerfile, dockercompose]
                  description: 'The build pack type.'
                name:
                  type: string
                  description: 'The application name.'
                description:
                  type: string
                  description: 'The application description.'
                domains:
                  type: string
                  description: 'The application URLs in a comma-separated list.'
                noindex_domains:
                  type: array
                  items: { type: string }
                  description: 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header, keeping them out of search engines. Entries that are not among the application domains are ignored.'
                git_commit_sha:
                  type: string
                  description: 'The git commit SHA.'
                docker_registry_image_name:
                  type: string
                  description: 'The docker registry image name.'
                docker_registry_image_tag:
                  type: string
                  description: 'The docker registry image tag.'
                is_static:
                  type: boolean
                  description: 'The flag to indicate if the application is static.'
                is_spa:
                  type: boolean
                  description: 'The flag to indicate if the application is a single-page application (SPA). Only relevant when is_static is true.'
                is_auto_deploy_enabled:
                  type: boolean
                  description: 'The flag to indicate if auto-deploy is enabled on git push. Defaults to true.'
                is_force_https_enabled:
                  type: boolean
                  description: 'The flag to indicate if HTTPS is forced. Defaults to true.'
                is_preview_deployments_enabled:
                  type: boolean
                  description: 'Enable preview deployments for pull requests.'
                static_image:
                  type: string
                  enum: ['nginx:alpine']
                  description: 'The static image.'
                install_command:
                  type: string
                  description: 'The install command.'
                build_command:
                  type: string
                  description: 'The build command.'
                start_command:
                  type: string
                  description: 'The start command.'
                ports_mappings:
                  type: string
                  description: 'The ports mappings.'
                base_directory:
                  type: string
                  description: 'The base directory for all commands.'
                publish_directory:
                  type: string
                  description: 'The publish directory.'
                health_check_enabled:
                  type: boolean
                  description: 'Health check enabled.'
                health_check_path:
                  type: string
                  description: 'Health check path.'
                health_check_port:
                  type: string
                  nullable: true
                  description: 'Health check port.'
                health_check_host:
                  type: string
                  nullable: true
                  description: 'Health check host.'
                health_check_method:
                  type: string
                  description: 'Health check method.'
                health_check_return_code:
                  type: integer
                  description: 'Health check return code.'
                health_check_scheme:
                  type: string
                  description: 'Health check scheme.'
                health_check_response_text:
                  type: string
                  nullable: true
                  description: 'Health check response text.'
                health_check_interval:
                  type: integer
                  description: 'Health check interval in seconds.'
                health_check_timeout:
                  type: integer
                  description: 'Health check timeout in seconds.'
                health_check_retries:
                  type: integer
                  description: 'Health check retries count.'
                health_check_start_period:
                  type: integer
                  description: 'Health check start period in seconds.'
                limits_memory:
                  type: string
                  description: 'Memory limit.'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit.'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness.'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation.'
                limits_cpus:
                  type: string
                  description: 'CPU limit.'
                limits_cpuset:
                  type: string
                  nullable: true
                  description: 'CPU set.'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares.'
                custom_labels:
                  type: string
                  description: 'Custom labels.'
                custom_docker_run_options:
                  type: string
                  description: 'Custom docker run options.'
                post_deployment_command:
                  type: string
                  description: 'Post deployment command.'
                post_deployment_command_container:
                  type: string
                  description: 'Post deployment command container.'
                pre_deployment_command:
                  type: string
                  description: 'Pre deployment command.'
                pre_deployment_command_container:
                  type: string
                  description: 'Pre deployment command container.'
                manual_webhook_secret_github:
                  type: string
                  description: 'Manual webhook secret for Github. Needs the deploy ability.'
                manual_webhook_secret_gitlab:
                  type: string
                  description: 'Manual webhook secret for Gitlab. Needs the deploy ability.'
                manual_webhook_secret_bitbucket:
                  type: string
                  description: 'Manual webhook secret for Bitbucket. Needs the deploy ability.'
                manual_webhook_secret_gitea:
                  type: string
                  description: 'Manual webhook secret for Gitea. Needs the deploy ability.'
                redirect:
                  type: string
                  nullable: true
                  description: 'How to set redirect with Traefik / Caddy. www<->non-www.'
                  enum: [www, non-www, both]
                instant_deploy:
                  type: boolean
                  description: 'The flag to indicate if the application should be deployed instantly.'
                dockerfile:
                  type: string
                  description: 'The Dockerfile content.'
                dockerfile_location:
                  type: string
                  description: 'The Dockerfile location in the repository'
                dockerfile_target_build:
                  type: string
                  nullable: true
                  description: 'The Docker build target (stage) in the Dockerfile.'
                docker_compose_location:
                  type: string
                  description: 'The Docker Compose location.'
                docker_compose_custom_start_command:
                  type: string
                  description: 'The Docker Compose custom start command.'
                docker_compose_custom_build_command:
                  type: string
                  description: 'The Docker Compose custom build command.'
                docker_compose_domains:
                  type: array
                  description: 'Array of URLs to be applied to containers of a dockercompose application.'
                  items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, domain: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io")' }, redirect: { type: string, nullable: true, description: 'Per-service www/non-www redirect for this compose service.', enum: [www, non-www, both] } }, type: object }
                watch_paths:
                  type: string
                  description: 'Watch path patterns, one per line (newline-separated). Commas do not separate patterns.'
                use_build_server:
                  type: boolean
                  nullable: true
                  description: 'Use build server.'
                use_build_secrets:
                  type: boolean
                  default: false
                  description: 'Use Docker Build Secrets for build-time environment variables.'
                is_git_submodules_enabled:
                  type: boolean
                  description: 'Clone Git submodules.'
                is_git_lfs_enabled:
                  type: boolean
                  description: 'Enable Git LFS.'
                is_git_shallow_clone_enabled:
                  type: boolean
                  description: 'Use a shallow Git clone.'
                is_auto_cancel_queued_deployments_enabled:
                  type: boolean
                  description: 'Cancel older queued webhook deployments when a newer push arrives. Default: true.'
                is_auto_cancel_building_deployments_enabled:
                  type: boolean
                  description: 'Also stop an older webhook deployment that is still building when a newer push arrives. A deployment that already started to replace containers always finishes. This also cancels queued webhook deployments. Default: false.'
                disable_build_cache:
                  type: boolean
                  description: 'Disable the build cache.'
                inject_build_args_to_dockerfile:
                  type: boolean
                  description: 'Inject build arguments into the Dockerfile build.'
                include_source_commit_in_build:
                  type: boolean
                  description: 'Include the source commit in the build.'
                include_network_hosts_in_build:
                  type: boolean
                  description: 'Add the containers of the destination network as build hosts.'
                is_env_sorting_enabled:
                  type: boolean
                  description: 'Sort environment variables.'
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  default: true
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Redeploy to apply it.'
                is_pr_deployments_public_enabled:
                  type: boolean
                  description: 'Make pull request deployments public.'
                stop_grace_period:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 3600
                  description: 'Container stop grace period in seconds.'
                rolling_update_drain_seconds:
                  type: integer
                  minimum: 0
                  maximum: 300
                  description: 'Seconds to wait after the new container is healthy before old containers stop during a rolling update. 0 turns the wait off. Default: 5.'
                docker_images_to_keep:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: 'Number of Docker images to retain.'
                is_gzip_enabled:
                  type: boolean
                  description: 'Enable gzip compression.'
                is_stripprefix_enabled:
                  type: boolean
                  description: 'Enable path prefix stripping.'
                is_permanent_redirect_enabled:
                  type: boolean
                  description: 'Use permanent redirects (301/308) instead of temporary (302/307) for the HTTP to HTTPS and www redirects. Defaults to false.'
                traefik_certificate_resolver:
                  type: string
                  nullable: true
                  description: 'Traefik certificate resolver for this application. Null uses the server setting, "none" uses no resolver.'
                is_container_label_readonly_enabled:
                  type: boolean
                  default: true
                  description: 'Let Coolify manage the container labels. True regenerates custom_labels from domains, redirect, and proxy settings. False keeps custom_labels as you set them: domains, redirect, and basic auth changes then do not change the labels.'
                is_raw_compose_deployment_enabled:
                  type: boolean
                  description: 'Deploy the raw Docker Compose definition.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Enable log drain for the application.'
                is_gpu_enabled:
                  type: boolean
                  description: 'Enable GPU support.'
                gpu_driver:
                  type: string
                  nullable: true
                  description: 'GPU driver name.'
                gpu_count:
                  type: string
                  nullable: true
                  description: 'Number of GPUs to allocate.'
                gpu_device_ids:
                  type: string
                  nullable: true
                  description: 'Comma-separated GPU device IDs.'
                gpu_options:
                  type: string
                  nullable: true
                  description: 'Additional GPU options.'
                is_consistent_container_name_enabled:
                  type: boolean
                  description: 'Use a consistent container name across deployments.'
                is_image_scan_enabled:
                  type: boolean
                  description: 'Scan the images of the application for vulnerabilities. Needs image scanning on the server. Default true.'
                custom_internal_name:
                  type: string
                  nullable: true
                  description: 'Custom internal container name. Turns is_consistent_container_name_enabled on when that field is not sent; sending it as false together with a name returns 422.'
                custom_container_name_prefix:
                  type: string
                  nullable: true
                  description: 'Prefix for generated container names (prefix-20260908T141530). Slugified and unique across the instance.'
                preview_url_template:
                  type: string
                  description: 'Preview URL template.'
                max_restart_count:
                  type: integer
                  minimum: 0
                  description: 'Maximum container restart count before stopping.'
                is_http_basic_auth_enabled:
                  type: boolean
                  description: 'HTTP Basic Authentication enabled.'
                http_basic_auth_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTP Basic Authentication'
                http_basic_auth_password:
                  type: string
                  nullable: true
                  description: 'Password for HTTP Basic Authentication'
                http_basic_auth_hash_algorithm:
                  type: string
                  enum: [bcrypt, argon2id]
                  default: bcrypt
                  description: 'Hash algorithm for the HTTP Basic Authentication password. Argon2id needs the Caddy proxy, version 2.11 or newer.'
                http_basic_auth_bcrypt_cost:
                  type: integer
                  minimum: 4
                  maximum: 14
                  default: 10
                  description: 'Bcrypt cost for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_memory_cost:
                  type: integer
                  minimum: 8192
                  maximum: 262144
                  default: 65536
                  description: 'Argon2id memory cost in KiB for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_time_cost:
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 4
                  description: 'Argon2id time cost (iterations) for the HTTP Basic Authentication password.'
                connect_to_docker_network:
                  type: boolean
                  description: 'The flag to connect the service to the predefined Docker network.'
                force_domain_override:
                  type: boolean
                  description: 'Force domain usage even if conflicts are detected. Default is false.'
                autogenerate_domain:
                  type: boolean
                  default: true
                  description: "If true and domains is empty, auto-generate a domain using the server's wildcard domain or sslip.io fallback. Ignored for the dockercompose build pack, which uses docker_compose_domains. Default: true."
                is_container_label_escape_enabled:
                  type: boolean
                  default: true
                  description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the application.'
                is_preserve_repository_enabled:
                  type: boolean
                  default: false
                  description: 'Preserve repository during deployment.'
              type: object
      responses:
        '201':
          description: 'Application created successfully.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to set a manual webhook secret.'
        '400':
          $ref: '#/components/responses/400'
        '409':
          description: 'Domain conflicts detected.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }
                  warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }
                  conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }
                type: object
      security:
        -
          bearerAuth: []
  /applications/private-deploy-key:
    post:
      tags:
        - Applications
      summary: 'Create (Private - Deploy Key)'
      description: 'Create new application based on a private repository through a Deploy Key.'
      operationId: create-private-deploy-key-application
      requestBody:
        description: 'Application object that needs to be created.'
        required: true
        content:
          application/json:
            schema:
              required:
                - project_uuid
                - server_uuid
                - private_key_uuid
                - git_repository
                - git_branch
                - build_pack
              properties:
                project_uuid:
                  type: string
                  description: 'The project UUID.'
                server_uuid:
                  type: string
                  description: 'The server UUID.'
                environment_name:
                  type: string
                  description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
                private_key_uuid:
                  type: string
                  description: 'The private key UUID.'
                git_repository:
                  type: string
                  description: 'The git repository URL.'
                git_branch:
                  type: string
                  description: 'The git branch.'
                ports_exposes:
                  type: string
                  description: 'The ports to expose.'
                destination_uuid:
                  type: string
                  description: 'The destination UUID.'
                build_pack:
                  type: string
                  enum: [nixpacks, railpack, static, dockerfile, dockercompose]
                  description: 'The build pack type.'
                name:
                  type: string
                  description: 'The application name.'
                description:
                  type: string
                  description: 'The application description.'
                domains:
                  type: string
                  description: 'The application URLs in a comma-separated list.'
                noindex_domains:
                  type: array
                  items: { type: string }
                  description: 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header, keeping them out of search engines. Entries that are not among the application domains are ignored.'
                git_commit_sha:
                  type: string
                  description: 'The git commit SHA.'
                docker_registry_image_name:
                  type: string
                  description: 'The docker registry image name.'
                docker_registry_image_tag:
                  type: string
                  description: 'The docker registry image tag.'
                is_static:
                  type: boolean
                  description: 'The flag to indicate if the application is static.'
                is_spa:
                  type: boolean
                  description: 'The flag to indicate if the application is a single-page application (SPA). Only relevant when is_static is true.'
                is_auto_deploy_enabled:
                  type: boolean
                  description: 'The flag to indicate if auto-deploy is enabled on git push. Defaults to true.'
                is_force_https_enabled:
                  type: boolean
                  description: 'The flag to indicate if HTTPS is forced. Defaults to true.'
                is_preview_deployments_enabled:
                  type: boolean
                  description: 'Enable preview deployments for pull requests.'
                static_image:
                  type: string
                  enum: ['nginx:alpine']
                  description: 'The static image.'
                install_command:
                  type: string
                  description: 'The install command.'
                build_command:
                  type: string
                  description: 'The build command.'
                start_command:
                  type: string
                  description: 'The start command.'
                ports_mappings:
                  type: string
                  description: 'The ports mappings.'
                base_directory:
                  type: string
                  description: 'The base directory for all commands.'
                publish_directory:
                  type: string
                  description: 'The publish directory.'
                health_check_enabled:
                  type: boolean
                  description: 'Health check enabled.'
                health_check_path:
                  type: string
                  description: 'Health check path.'
                health_check_port:
                  type: string
                  nullable: true
                  description: 'Health check port.'
                health_check_host:
                  type: string
                  nullable: true
                  description: 'Health check host.'
                health_check_method:
                  type: string
                  description: 'Health check method.'
                health_check_return_code:
                  type: integer
                  description: 'Health check return code.'
                health_check_scheme:
                  type: string
                  description: 'Health check scheme.'
                health_check_response_text:
                  type: string
                  nullable: true
                  description: 'Health check response text.'
                health_check_interval:
                  type: integer
                  description: 'Health check interval in seconds.'
                health_check_timeout:
                  type: integer
                  description: 'Health check timeout in seconds.'
                health_check_retries:
                  type: integer
                  description: 'Health check retries count.'
                health_check_start_period:
                  type: integer
                  description: 'Health check start period in seconds.'
                limits_memory:
                  type: string
                  description: 'Memory limit.'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit.'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness.'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation.'
                limits_cpus:
                  type: string
                  description: 'CPU limit.'
                limits_cpuset:
                  type: string
                  nullable: true
                  description: 'CPU set.'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares.'
                custom_labels:
                  type: string
                  description: 'Custom labels.'
                custom_docker_run_options:
                  type: string
                  description: 'Custom docker run options.'
                post_deployment_command:
                  type: string
                  description: 'Post deployment command.'
                post_deployment_command_container:
                  type: string
                  description: 'Post deployment command container.'
                pre_deployment_command:
                  type: string
                  description: 'Pre deployment command.'
                pre_deployment_command_container:
                  type: string
                  description: 'Pre deployment command container.'
                manual_webhook_secret_github:
                  type: string
                  description: 'Manual webhook secret for Github. Needs the deploy ability.'
                manual_webhook_secret_gitlab:
                  type: string
                  description: 'Manual webhook secret for Gitlab. Needs the deploy ability.'
                manual_webhook_secret_bitbucket:
                  type: string
                  description: 'Manual webhook secret for Bitbucket. Needs the deploy ability.'
                manual_webhook_secret_gitea:
                  type: string
                  description: 'Manual webhook secret for Gitea. Needs the deploy ability.'
                redirect:
                  type: string
                  nullable: true
                  description: 'How to set redirect with Traefik / Caddy. www<->non-www.'
                  enum: [www, non-www, both]
                instant_deploy:
                  type: boolean
                  description: 'The flag to indicate if the application should be deployed instantly.'
                dockerfile:
                  type: string
                  description: 'The Dockerfile content.'
                dockerfile_location:
                  type: string
                  description: 'The Dockerfile location in the repository.'
                dockerfile_target_build:
                  type: string
                  nullable: true
                  description: 'The Docker build target (stage) in the Dockerfile.'
                docker_compose_location:
                  type: string
                  description: 'The Docker Compose location.'
                docker_compose_custom_start_command:
                  type: string
                  description: 'The Docker Compose custom start command.'
                docker_compose_custom_build_command:
                  type: string
                  description: 'The Docker Compose custom build command.'
                docker_compose_domains:
                  type: array
                  description: 'Array of URLs to be applied to containers of a dockercompose application.'
                  items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, domain: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io")' }, redirect: { type: string, nullable: true, description: 'Per-service www/non-www redirect for this compose service.', enum: [www, non-www, both] } }, type: object }
                watch_paths:
                  type: string
                  description: 'Watch path patterns, one per line (newline-separated). Commas do not separate patterns.'
                use_build_server:
                  type: boolean
                  nullable: true
                  description: 'Use build server.'
                use_build_secrets:
                  type: boolean
                  default: false
                  description: 'Use Docker Build Secrets for build-time environment variables.'
                is_git_submodules_enabled:
                  type: boolean
                  description: 'Clone Git submodules.'
                is_git_lfs_enabled:
                  type: boolean
                  description: 'Enable Git LFS.'
                is_git_shallow_clone_enabled:
                  type: boolean
                  description: 'Use a shallow Git clone.'
                is_auto_cancel_queued_deployments_enabled:
                  type: boolean
                  description: 'Cancel older queued webhook deployments when a newer push arrives. Default: true.'
                is_auto_cancel_building_deployments_enabled:
                  type: boolean
                  description: 'Also stop an older webhook deployment that is still building when a newer push arrives. A deployment that already started to replace containers always finishes. This also cancels queued webhook deployments. Default: false.'
                disable_build_cache:
                  type: boolean
                  description: 'Disable the build cache.'
                inject_build_args_to_dockerfile:
                  type: boolean
                  description: 'Inject build arguments into the Dockerfile build.'
                include_source_commit_in_build:
                  type: boolean
                  description: 'Include the source commit in the build.'
                include_network_hosts_in_build:
                  type: boolean
                  description: 'Add the containers of the destination network as build hosts.'
                is_env_sorting_enabled:
                  type: boolean
                  description: 'Sort environment variables.'
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  default: true
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Redeploy to apply it.'
                is_pr_deployments_public_enabled:
                  type: boolean
                  description: 'Make pull request deployments public.'
                stop_grace_period:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 3600
                  description: 'Container stop grace period in seconds.'
                rolling_update_drain_seconds:
                  type: integer
                  minimum: 0
                  maximum: 300
                  description: 'Seconds to wait after the new container is healthy before old containers stop during a rolling update. 0 turns the wait off. Default: 5.'
                docker_images_to_keep:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: 'Number of Docker images to retain.'
                is_gzip_enabled:
                  type: boolean
                  description: 'Enable gzip compression.'
                is_stripprefix_enabled:
                  type: boolean
                  description: 'Enable path prefix stripping.'
                is_permanent_redirect_enabled:
                  type: boolean
                  description: 'Use permanent redirects (301/308) instead of temporary (302/307) for the HTTP to HTTPS and www redirects. Defaults to false.'
                traefik_certificate_resolver:
                  type: string
                  nullable: true
                  description: 'Traefik certificate resolver for this application. Null uses the server setting, "none" uses no resolver.'
                is_container_label_readonly_enabled:
                  type: boolean
                  default: true
                  description: 'Let Coolify manage the container labels. True regenerates custom_labels from domains, redirect, and proxy settings. False keeps custom_labels as you set them: domains, redirect, and basic auth changes then do not change the labels.'
                is_raw_compose_deployment_enabled:
                  type: boolean
                  description: 'Deploy the raw Docker Compose definition.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Enable log drain for the application.'
                is_gpu_enabled:
                  type: boolean
                  description: 'Enable GPU support.'
                gpu_driver:
                  type: string
                  nullable: true
                  description: 'GPU driver name.'
                gpu_count:
                  type: string
                  nullable: true
                  description: 'Number of GPUs to allocate.'
                gpu_device_ids:
                  type: string
                  nullable: true
                  description: 'Comma-separated GPU device IDs.'
                gpu_options:
                  type: string
                  nullable: true
                  description: 'Additional GPU options.'
                is_consistent_container_name_enabled:
                  type: boolean
                  description: 'Use a consistent container name across deployments.'
                is_image_scan_enabled:
                  type: boolean
                  description: 'Scan the images of the application for vulnerabilities. Needs image scanning on the server. Default true.'
                custom_internal_name:
                  type: string
                  nullable: true
                  description: 'Custom internal container name. Turns is_consistent_container_name_enabled on when that field is not sent; sending it as false together with a name returns 422.'
                custom_container_name_prefix:
                  type: string
                  nullable: true
                  description: 'Prefix for generated container names (prefix-20260908T141530). Slugified and unique across the instance.'
                preview_url_template:
                  type: string
                  description: 'Preview URL template.'
                max_restart_count:
                  type: integer
                  minimum: 0
                  description: 'Maximum container restart count before stopping.'
                is_http_basic_auth_enabled:
                  type: boolean
                  description: 'HTTP Basic Authentication enabled.'
                http_basic_auth_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTP Basic Authentication'
                http_basic_auth_password:
                  type: string
                  nullable: true
                  description: 'Password for HTTP Basic Authentication'
                http_basic_auth_hash_algorithm:
                  type: string
                  enum: [bcrypt, argon2id]
                  default: bcrypt
                  description: 'Hash algorithm for the HTTP Basic Authentication password. Argon2id needs the Caddy proxy, version 2.11 or newer.'
                http_basic_auth_bcrypt_cost:
                  type: integer
                  minimum: 4
                  maximum: 14
                  default: 10
                  description: 'Bcrypt cost for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_memory_cost:
                  type: integer
                  minimum: 8192
                  maximum: 262144
                  default: 65536
                  description: 'Argon2id memory cost in KiB for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_time_cost:
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 4
                  description: 'Argon2id time cost (iterations) for the HTTP Basic Authentication password.'
                connect_to_docker_network:
                  type: boolean
                  description: 'The flag to connect the service to the predefined Docker network.'
                force_domain_override:
                  type: boolean
                  description: 'Force domain usage even if conflicts are detected. Default is false.'
                autogenerate_domain:
                  type: boolean
                  default: true
                  description: "If true and domains is empty, auto-generate a domain using the server's wildcard domain or sslip.io fallback. Ignored for the dockercompose build pack, which uses docker_compose_domains. Default: true."
                is_container_label_escape_enabled:
                  type: boolean
                  default: true
                  description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the application.'
                is_preserve_repository_enabled:
                  type: boolean
                  default: false
                  description: 'Preserve repository during deployment.'
              type: object
      responses:
        '201':
          description: 'Application created successfully.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to set a manual webhook secret.'
        '400':
          $ref: '#/components/responses/400'
        '409':
          description: 'Domain conflicts detected.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }
                  warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }
                  conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }
                type: object
      security:
        -
          bearerAuth: []
  /applications/dockerfile:
    post:
      tags:
        - Applications
      summary: 'Create (Dockerfile without git)'
      description: 'Create new application based on a simple Dockerfile (without git).'
      operationId: create-dockerfile-application
      requestBody:
        description: 'Application object that needs to be created.'
        required: true
        content:
          application/json:
            schema:
              required:
                - project_uuid
                - server_uuid
                - dockerfile
              properties:
                project_uuid:
                  type: string
                  description: 'The project UUID.'
                server_uuid:
                  type: string
                  description: 'The server UUID.'
                environment_name:
                  type: string
                  description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
                dockerfile:
                  type: string
                  description: 'The Dockerfile content.'
                build_pack:
                  type: string
                  enum: [dockerfile]
                  description: 'The build pack type.'
                ports_exposes:
                  type: string
                  description: 'The ports to expose.'
                destination_uuid:
                  type: string
                  description: 'The destination UUID.'
                name:
                  type: string
                  description: 'The application name.'
                description:
                  type: string
                  description: 'The application description.'
                domains:
                  type: string
                  description: 'The application URLs in a comma-separated list.'
                noindex_domains:
                  type: array
                  items: { type: string }
                  description: 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header, keeping them out of search engines. Entries that are not among the application domains are ignored.'
                docker_registry_image_name:
                  type: string
                  description: 'The docker registry image name.'
                docker_registry_image_tag:
                  type: string
                  description: 'The docker registry image tag.'
                ports_mappings:
                  type: string
                  description: 'The ports mappings.'
                base_directory:
                  type: string
                  description: 'The base directory for all commands.'
                health_check_enabled:
                  type: boolean
                  description: 'Health check enabled.'
                health_check_path:
                  type: string
                  description: 'Health check path.'
                health_check_port:
                  type: string
                  nullable: true
                  description: 'Health check port.'
                health_check_host:
                  type: string
                  nullable: true
                  description: 'Health check host.'
                health_check_method:
                  type: string
                  description: 'Health check method.'
                health_check_return_code:
                  type: integer
                  description: 'Health check return code.'
                health_check_scheme:
                  type: string
                  description: 'Health check scheme.'
                health_check_response_text:
                  type: string
                  nullable: true
                  description: 'Health check response text.'
                health_check_interval:
                  type: integer
                  description: 'Health check interval in seconds.'
                health_check_timeout:
                  type: integer
                  description: 'Health check timeout in seconds.'
                health_check_retries:
                  type: integer
                  description: 'Health check retries count.'
                health_check_start_period:
                  type: integer
                  description: 'Health check start period in seconds.'
                limits_memory:
                  type: string
                  description: 'Memory limit.'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit.'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness.'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation.'
                limits_cpus:
                  type: string
                  description: 'CPU limit.'
                limits_cpuset:
                  type: string
                  nullable: true
                  description: 'CPU set.'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares.'
                custom_labels:
                  type: string
                  description: 'Custom labels.'
                custom_docker_run_options:
                  type: string
                  description: 'Custom docker run options.'
                post_deployment_command:
                  type: string
                  description: 'Post deployment command.'
                post_deployment_command_container:
                  type: string
                  description: 'Post deployment command container.'
                pre_deployment_command:
                  type: string
                  description: 'Pre deployment command.'
                pre_deployment_command_container:
                  type: string
                  description: 'Pre deployment command container.'
                manual_webhook_secret_github:
                  type: string
                  description: 'Manual webhook secret for Github. Needs the deploy ability.'
                manual_webhook_secret_gitlab:
                  type: string
                  description: 'Manual webhook secret for Gitlab. Needs the deploy ability.'
                manual_webhook_secret_bitbucket:
                  type: string
                  description: 'Manual webhook secret for Bitbucket. Needs the deploy ability.'
                manual_webhook_secret_gitea:
                  type: string
                  description: 'Manual webhook secret for Gitea. Needs the deploy ability.'
                redirect:
                  type: string
                  nullable: true
                  description: 'How to set redirect with Traefik / Caddy. www<->non-www.'
                  enum: [www, non-www, both]
                instant_deploy:
                  type: boolean
                  description: 'The flag to indicate if the application should be deployed instantly.'
                is_force_https_enabled:
                  type: boolean
                  description: 'The flag to indicate if HTTPS is forced. Defaults to true.'
                is_preview_deployments_enabled:
                  type: boolean
                  description: 'Enable preview deployments for pull requests.'
                use_build_server:
                  type: boolean
                  nullable: true
                  description: 'Use build server.'
                use_build_secrets:
                  type: boolean
                  default: false
                  description: 'Use Docker Build Secrets for build-time environment variables.'
                is_git_submodules_enabled:
                  type: boolean
                  description: 'Clone Git submodules.'
                is_git_lfs_enabled:
                  type: boolean
                  description: 'Enable Git LFS.'
                is_git_shallow_clone_enabled:
                  type: boolean
                  description: 'Use a shallow Git clone.'
                is_auto_cancel_queued_deployments_enabled:
                  type: boolean
                  description: 'Cancel older queued webhook deployments when a newer push arrives. Default: true.'
                is_auto_cancel_building_deployments_enabled:
                  type: boolean
                  description: 'Also stop an older webhook deployment that is still building when a newer push arrives. A deployment that already started to replace containers always finishes. This also cancels queued webhook deployments. Default: false.'
                disable_build_cache:
                  type: boolean
                  description: 'Disable the build cache.'
                inject_build_args_to_dockerfile:
                  type: boolean
                  description: 'Inject build arguments into the Dockerfile build.'
                include_source_commit_in_build:
                  type: boolean
                  description: 'Include the source commit in the build.'
                include_network_hosts_in_build:
                  type: boolean
                  description: 'Add the containers of the destination network as build hosts.'
                is_env_sorting_enabled:
                  type: boolean
                  description: 'Sort environment variables.'
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  default: true
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Redeploy to apply it.'
                is_pr_deployments_public_enabled:
                  type: boolean
                  description: 'Make pull request deployments public.'
                stop_grace_period:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 3600
                  description: 'Container stop grace period in seconds.'
                rolling_update_drain_seconds:
                  type: integer
                  minimum: 0
                  maximum: 300
                  description: 'Seconds to wait after the new container is healthy before old containers stop during a rolling update. 0 turns the wait off. Default: 5.'
                docker_images_to_keep:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: 'Number of Docker images to retain.'
                is_gzip_enabled:
                  type: boolean
                  description: 'Enable gzip compression.'
                is_stripprefix_enabled:
                  type: boolean
                  description: 'Enable path prefix stripping.'
                is_permanent_redirect_enabled:
                  type: boolean
                  description: 'Use permanent redirects (301/308) instead of temporary (302/307) for the HTTP to HTTPS and www redirects. Defaults to false.'
                traefik_certificate_resolver:
                  type: string
                  nullable: true
                  description: 'Traefik certificate resolver for this application. Null uses the server setting, "none" uses no resolver.'
                is_container_label_readonly_enabled:
                  type: boolean
                  default: true
                  description: 'Let Coolify manage the container labels. True regenerates custom_labels from domains, redirect, and proxy settings. False keeps custom_labels as you set them: domains, redirect, and basic auth changes then do not change the labels.'
                is_raw_compose_deployment_enabled:
                  type: boolean
                  description: 'Deploy the raw Docker Compose definition.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Enable log drain for the application.'
                is_gpu_enabled:
                  type: boolean
                  description: 'Enable GPU support.'
                gpu_driver:
                  type: string
                  nullable: true
                  description: 'GPU driver name.'
                gpu_count:
                  type: string
                  nullable: true
                  description: 'Number of GPUs to allocate.'
                gpu_device_ids:
                  type: string
                  nullable: true
                  description: 'Comma-separated GPU device IDs.'
                gpu_options:
                  type: string
                  nullable: true
                  description: 'Additional GPU options.'
                is_consistent_container_name_enabled:
                  type: boolean
                  description: 'Use a consistent container name across deployments.'
                is_image_scan_enabled:
                  type: boolean
                  description: 'Scan the images of the application for vulnerabilities. Needs image scanning on the server. Default true.'
                custom_internal_name:
                  type: string
                  nullable: true
                  description: 'Custom internal container name. Turns is_consistent_container_name_enabled on when that field is not sent; sending it as false together with a name returns 422.'
                custom_container_name_prefix:
                  type: string
                  nullable: true
                  description: 'Prefix for generated container names (prefix-20260908T141530). Slugified and unique across the instance.'
                preview_url_template:
                  type: string
                  description: 'Preview URL template.'
                max_restart_count:
                  type: integer
                  minimum: 0
                  description: 'Maximum container restart count before stopping.'
                is_http_basic_auth_enabled:
                  type: boolean
                  description: 'HTTP Basic Authentication enabled.'
                http_basic_auth_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTP Basic Authentication'
                http_basic_auth_password:
                  type: string
                  nullable: true
                  description: 'Password for HTTP Basic Authentication'
                http_basic_auth_hash_algorithm:
                  type: string
                  enum: [bcrypt, argon2id]
                  default: bcrypt
                  description: 'Hash algorithm for the HTTP Basic Authentication password. Argon2id needs the Caddy proxy, version 2.11 or newer.'
                http_basic_auth_bcrypt_cost:
                  type: integer
                  minimum: 4
                  maximum: 14
                  default: 10
                  description: 'Bcrypt cost for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_memory_cost:
                  type: integer
                  minimum: 8192
                  maximum: 262144
                  default: 65536
                  description: 'Argon2id memory cost in KiB for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_time_cost:
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 4
                  description: 'Argon2id time cost (iterations) for the HTTP Basic Authentication password.'
                connect_to_docker_network:
                  type: boolean
                  description: 'The flag to connect the service to the predefined Docker network.'
                force_domain_override:
                  type: boolean
                  description: 'Force domain usage even if conflicts are detected. Default is false.'
                autogenerate_domain:
                  type: boolean
                  default: true
                  description: "If true and domains is empty, auto-generate a domain using the server's wildcard domain or sslip.io fallback. Ignored for the dockercompose build pack, which uses docker_compose_domains. Default: true."
                is_container_label_escape_enabled:
                  type: boolean
                  default: true
                  description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the application.'
              type: object
      responses:
        '201':
          description: 'Application created successfully.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to set a manual webhook secret.'
        '400':
          $ref: '#/components/responses/400'
        '409':
          description: 'Domain conflicts detected.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }
                  warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }
                  conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }
                type: object
      security:
        -
          bearerAuth: []
  /applications/dockerimage:
    post:
      tags:
        - Applications
      summary: 'Create (Docker Image without git)'
      description: 'Create new application based on a prebuilt docker image (without git).'
      operationId: create-dockerimage-application
      requestBody:
        description: 'Application object that needs to be created.'
        required: true
        content:
          application/json:
            schema:
              required:
                - project_uuid
                - server_uuid
                - docker_registry_image_name
              properties:
                project_uuid:
                  type: string
                  description: 'The project UUID.'
                server_uuid:
                  type: string
                  description: 'The server UUID.'
                environment_name:
                  type: string
                  description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
                docker_registry_image_name:
                  type: string
                  description: 'The docker registry image name.'
                docker_registry_image_tag:
                  type: string
                  description: 'The docker registry image tag.'
                ports_exposes:
                  type: string
                  description: 'The ports to expose.'
                destination_uuid:
                  type: string
                  description: 'The destination UUID.'
                name:
                  type: string
                  description: 'The application name.'
                description:
                  type: string
                  description: 'The application description.'
                domains:
                  type: string
                  description: 'The application URLs in a comma-separated list.'
                noindex_domains:
                  type: array
                  items: { type: string }
                  description: 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header, keeping them out of search engines. Entries that are not among the application domains are ignored.'
                ports_mappings:
                  type: string
                  description: 'The ports mappings.'
                health_check_enabled:
                  type: boolean
                  description: 'Health check enabled.'
                health_check_path:
                  type: string
                  description: 'Health check path.'
                health_check_port:
                  type: string
                  nullable: true
                  description: 'Health check port.'
                health_check_host:
                  type: string
                  nullable: true
                  description: 'Health check host.'
                health_check_method:
                  type: string
                  description: 'Health check method.'
                health_check_return_code:
                  type: integer
                  description: 'Health check return code.'
                health_check_scheme:
                  type: string
                  description: 'Health check scheme.'
                health_check_response_text:
                  type: string
                  nullable: true
                  description: 'Health check response text.'
                health_check_interval:
                  type: integer
                  description: 'Health check interval in seconds.'
                health_check_timeout:
                  type: integer
                  description: 'Health check timeout in seconds.'
                health_check_retries:
                  type: integer
                  description: 'Health check retries count.'
                health_check_start_period:
                  type: integer
                  description: 'Health check start period in seconds.'
                limits_memory:
                  type: string
                  description: 'Memory limit.'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit.'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness.'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation.'
                limits_cpus:
                  type: string
                  description: 'CPU limit.'
                limits_cpuset:
                  type: string
                  nullable: true
                  description: 'CPU set.'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares.'
                custom_labels:
                  type: string
                  description: 'Custom labels.'
                custom_docker_run_options:
                  type: string
                  description: 'Custom docker run options.'
                post_deployment_command:
                  type: string
                  description: 'Post deployment command.'
                post_deployment_command_container:
                  type: string
                  description: 'Post deployment command container.'
                pre_deployment_command:
                  type: string
                  description: 'Pre deployment command.'
                pre_deployment_command_container:
                  type: string
                  description: 'Pre deployment command container.'
                manual_webhook_secret_github:
                  type: string
                  description: 'Manual webhook secret for Github. Needs the deploy ability.'
                manual_webhook_secret_gitlab:
                  type: string
                  description: 'Manual webhook secret for Gitlab. Needs the deploy ability.'
                manual_webhook_secret_bitbucket:
                  type: string
                  description: 'Manual webhook secret for Bitbucket. Needs the deploy ability.'
                manual_webhook_secret_gitea:
                  type: string
                  description: 'Manual webhook secret for Gitea. Needs the deploy ability.'
                redirect:
                  type: string
                  nullable: true
                  description: 'How to set redirect with Traefik / Caddy. www<->non-www.'
                  enum: [www, non-www, both]
                instant_deploy:
                  type: boolean
                  description: 'The flag to indicate if the application should be deployed instantly.'
                is_force_https_enabled:
                  type: boolean
                  description: 'The flag to indicate if HTTPS is forced. Defaults to true.'
                is_preview_deployments_enabled:
                  type: boolean
                  description: 'Enable preview deployments for pull requests.'
                use_build_server:
                  type: boolean
                  nullable: true
                  description: 'Use build server.'
                use_build_secrets:
                  type: boolean
                  default: false
                  description: 'Use Docker Build Secrets for build-time environment variables.'
                is_git_submodules_enabled:
                  type: boolean
                  description: 'Clone Git submodules.'
                is_git_lfs_enabled:
                  type: boolean
                  description: 'Enable Git LFS.'
                is_git_shallow_clone_enabled:
                  type: boolean
                  description: 'Use a shallow Git clone.'
                is_auto_cancel_queued_deployments_enabled:
                  type: boolean
                  description: 'Cancel older queued webhook deployments when a newer push arrives. Default: true.'
                is_auto_cancel_building_deployments_enabled:
                  type: boolean
                  description: 'Also stop an older webhook deployment that is still building when a newer push arrives. A deployment that already started to replace containers always finishes. This also cancels queued webhook deployments. Default: false.'
                disable_build_cache:
                  type: boolean
                  description: 'Disable the build cache.'
                inject_build_args_to_dockerfile:
                  type: boolean
                  description: 'Inject build arguments into the Dockerfile build.'
                include_source_commit_in_build:
                  type: boolean
                  description: 'Include the source commit in the build.'
                include_network_hosts_in_build:
                  type: boolean
                  description: 'Add the containers of the destination network as build hosts.'
                is_env_sorting_enabled:
                  type: boolean
                  description: 'Sort environment variables.'
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  default: true
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Redeploy to apply it.'
                is_pr_deployments_public_enabled:
                  type: boolean
                  description: 'Make pull request deployments public.'
                stop_grace_period:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 3600
                  description: 'Container stop grace period in seconds.'
                rolling_update_drain_seconds:
                  type: integer
                  minimum: 0
                  maximum: 300
                  description: 'Seconds to wait after the new container is healthy before old containers stop during a rolling update. 0 turns the wait off. Default: 5.'
                docker_images_to_keep:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: 'Number of Docker images to retain.'
                is_gzip_enabled:
                  type: boolean
                  description: 'Enable gzip compression.'
                is_stripprefix_enabled:
                  type: boolean
                  description: 'Enable path prefix stripping.'
                is_permanent_redirect_enabled:
                  type: boolean
                  description: 'Use permanent redirects (301/308) instead of temporary (302/307) for the HTTP to HTTPS and www redirects. Defaults to false.'
                traefik_certificate_resolver:
                  type: string
                  nullable: true
                  description: 'Traefik certificate resolver for this application. Null uses the server setting, "none" uses no resolver.'
                is_container_label_readonly_enabled:
                  type: boolean
                  default: true
                  description: 'Let Coolify manage the container labels. True regenerates custom_labels from domains, redirect, and proxy settings. False keeps custom_labels as you set them: domains, redirect, and basic auth changes then do not change the labels.'
                is_raw_compose_deployment_enabled:
                  type: boolean
                  description: 'Deploy the raw Docker Compose definition.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Enable log drain for the application.'
                is_gpu_enabled:
                  type: boolean
                  description: 'Enable GPU support.'
                gpu_driver:
                  type: string
                  nullable: true
                  description: 'GPU driver name.'
                gpu_count:
                  type: string
                  nullable: true
                  description: 'Number of GPUs to allocate.'
                gpu_device_ids:
                  type: string
                  nullable: true
                  description: 'Comma-separated GPU device IDs.'
                gpu_options:
                  type: string
                  nullable: true
                  description: 'Additional GPU options.'
                is_consistent_container_name_enabled:
                  type: boolean
                  description: 'Use a consistent container name across deployments.'
                is_image_scan_enabled:
                  type: boolean
                  description: 'Scan the images of the application for vulnerabilities. Needs image scanning on the server. Default true.'
                custom_internal_name:
                  type: string
                  nullable: true
                  description: 'Custom internal container name. Turns is_consistent_container_name_enabled on when that field is not sent; sending it as false together with a name returns 422.'
                custom_container_name_prefix:
                  type: string
                  nullable: true
                  description: 'Prefix for generated container names (prefix-20260908T141530). Slugified and unique across the instance.'
                preview_url_template:
                  type: string
                  description: 'Preview URL template.'
                max_restart_count:
                  type: integer
                  minimum: 0
                  description: 'Maximum container restart count before stopping.'
                is_http_basic_auth_enabled:
                  type: boolean
                  description: 'HTTP Basic Authentication enabled.'
                http_basic_auth_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTP Basic Authentication'
                http_basic_auth_password:
                  type: string
                  nullable: true
                  description: 'Password for HTTP Basic Authentication'
                http_basic_auth_hash_algorithm:
                  type: string
                  enum: [bcrypt, argon2id]
                  default: bcrypt
                  description: 'Hash algorithm for the HTTP Basic Authentication password. Argon2id needs the Caddy proxy, version 2.11 or newer.'
                http_basic_auth_bcrypt_cost:
                  type: integer
                  minimum: 4
                  maximum: 14
                  default: 10
                  description: 'Bcrypt cost for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_memory_cost:
                  type: integer
                  minimum: 8192
                  maximum: 262144
                  default: 65536
                  description: 'Argon2id memory cost in KiB for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_time_cost:
                  type: integer
                  minimum: 1
                  maximum: 12
                  default: 4
                  description: 'Argon2id time cost (iterations) for the HTTP Basic Authentication password.'
                connect_to_docker_network:
                  type: boolean
                  description: 'The flag to connect the service to the predefined Docker network.'
                force_domain_override:
                  type: boolean
                  description: 'Force domain usage even if conflicts are detected. Default is false.'
                autogenerate_domain:
                  type: boolean
                  default: true
                  description: "If true and domains is empty, auto-generate a domain using the server's wildcard domain or sslip.io fallback. Ignored for the dockercompose build pack, which uses docker_compose_domains. Default: true."
                is_container_label_escape_enabled:
                  type: boolean
                  default: true
                  description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the application.'
              type: object
      responses:
        '201':
          description: 'Application created successfully.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to set a manual webhook secret.'
        '400':
          $ref: '#/components/responses/400'
        '409':
          description: 'Domain conflicts detected.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }
                  warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }
                  conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }
                type: object
      security:
        -
          bearerAuth: []
  '/applications/{uuid}':
    get:
      tags:
        - Applications
      summary: Get
      description: 'Get application by UUID.'
      operationId: get-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Get application by UUID.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Application'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    delete:
      tags:
        - Applications
      summary: Delete
      description: 'Delete application by UUID. Needs a token with the write and deploy permissions.'
      operationId: delete-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: delete_configurations
          in: query
          description: 'Delete configurations.'
          required: false
          schema:
            type: boolean
            default: true
        -
          name: delete_volumes
          in: query
          description: 'Delete volumes.'
          required: false
          schema:
            type: boolean
            default: true
        -
          name: docker_cleanup
          in: query
          description: 'Run docker cleanup when the server disk usage is at or above its cleanup threshold. Skipped when a cleanup ran on the server in the last hour.'
          required: false
          schema:
            type: boolean
            default: true
        -
          name: delete_connected_networks
          in: query
          description: 'Delete connected networks.'
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: 'Application deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Application deleted.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '403':
          description: 'The token needs the write and deploy permissions.'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Applications
      summary: Update
      description: 'Update application by UUID.'
      operationId: update-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Application updated.'
        required: true
        content:
          application/json:
            schema:
              properties:
                github_app_uuid:
                  type: string
                  description: 'The Github App UUID.'
                gitea_app_uuid:
                  type: string
                  description: 'The Gitea App UUID. The source must be connected. Do not send it together with github_app_uuid.'
                git_repository:
                  type: string
                  description: 'The git repository URL.'
                git_branch:
                  type: string
                  description: 'The git branch.'
                git_https_username:
                  type: string
                  nullable: true
                  description: 'Username for HTTPS access to a private repository on a custom Git host. Send null to remove it.'
                git_https_password:
                  type: string
                  nullable: true
                  description: 'Password or access token for HTTPS access to a private repository on a custom Git host. It is stored encrypted and never returned. Send null or an empty string to remove the credentials.'
                ports_exposes:
                  type: string
                  description: 'The ports to expose.'
                build_pack:
                  type: string
                  enum: [nixpacks, railpack, static, dockerfile, dockercompose]
                  description: 'The build pack type.'
                name:
                  type: string
                  description: 'The application name.'
                description:
                  type: string
                  description: 'The application description.'
                domains:
                  type: string
                  description: 'The application URLs in a comma-separated list.'
                noindex_domains:
                  type: array
                  items: { type: string }
                  description: 'The subset of the application domains served with an X-Robots-Tag: noindex, nofollow response header, keeping them out of search engines. Entries that are not among the application domains are ignored.'
                git_commit_sha:
                  type: string
                  description: 'The git commit SHA.'
                docker_registry_image_name:
                  type: string
                  description: 'The docker registry image name.'
                docker_registry_image_tag:
                  type: string
                  description: 'The docker registry image tag.'
                is_static:
                  type: boolean
                  description: 'The flag to indicate if the application is static.'
                is_spa:
                  type: boolean
                  description: 'The flag to indicate if the application is a single-page application (SPA). Only relevant when is_static is true.'
                is_auto_deploy_enabled:
                  type: boolean
                  description: 'The flag to indicate if auto-deploy is enabled on git push. Defaults to true.'
                is_force_https_enabled:
                  type: boolean
                  description: 'The flag to indicate if HTTPS is forced. Defaults to true.'
                is_preview_deployments_enabled:
                  type: boolean
                  description: 'Enable preview deployments for pull requests.'
                install_command:
                  type: string
                  description: 'The install command.'
                build_command:
                  type: string
                  description: 'The build command.'
                start_command:
                  type: string
                  description: 'The start command.'
                ports_mappings:
                  type: string
                  description: 'The ports mappings.'
                base_directory:
                  type: string
                  description: 'The base directory for all commands.'
                publish_directory:
                  type: string
                  description: 'The publish directory.'
                health_check_enabled:
                  type: boolean
                  description: 'Health check enabled.'
                health_check_path:
                  type: string
                  description: 'Health check path.'
                health_check_port:
                  type: string
                  nullable: true
                  description: 'Health check port.'
                health_check_host:
                  type: string
                  nullable: true
                  description: 'Health check host.'
                health_check_method:
                  type: string
                  description: 'Health check method.'
                health_check_return_code:
                  type: integer
                  description: 'Health check return code.'
                health_check_scheme:
                  type: string
                  description: 'Health check scheme.'
                health_check_response_text:
                  type: string
                  nullable: true
                  description: 'Health check response text.'
                health_check_interval:
                  type: integer
                  description: 'Health check interval in seconds.'
                health_check_timeout:
                  type: integer
                  description: 'Health check timeout in seconds.'
                health_check_retries:
                  type: integer
                  description: 'Health check retries count.'
                health_check_start_period:
                  type: integer
                  description: 'Health check start period in seconds.'
                limits_memory:
                  type: string
                  description: 'Memory limit.'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit.'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness.'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation.'
                limits_cpus:
                  type: string
                  description: 'CPU limit.'
                limits_cpuset:
                  type: string
                  nullable: true
                  description: 'CPU set.'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares.'
                custom_labels:
                  type: string
                  description: 'Custom labels.'
                custom_docker_run_options:
                  type: string
                  description: 'Custom docker run options.'
                post_deployment_command:
                  type: string
                  description: 'Post deployment command.'
                post_deployment_command_container:
                  type: string
                  description: 'Post deployment command container.'
                pre_deployment_command:
                  type: string
                  description: 'Pre deployment command.'
                pre_deployment_command_container:
                  type: string
                  description: 'Pre deployment command container.'
                manual_webhook_secret_github:
                  type: string
                  description: 'Manual webhook secret for Github. Needs the deploy ability.'
                manual_webhook_secret_gitlab:
                  type: string
                  description: 'Manual webhook secret for Gitlab. Needs the deploy ability.'
                manual_webhook_secret_bitbucket:
                  type: string
                  description: 'Manual webhook secret for Bitbucket. Needs the deploy ability.'
                manual_webhook_secret_gitea:
                  type: string
                  description: 'Manual webhook secret for Gitea. Needs the deploy ability.'
                redirect:
                  type: string
                  nullable: true
                  description: 'How to set redirect with Traefik / Caddy. www<->non-www.'
                  enum: [www, non-www, both]
                instant_deploy:
                  type: boolean
                  description: 'The flag to indicate if the application should be deployed instantly.'
                dockerfile:
                  type: string
                  description: 'The Dockerfile content.'
                dockerfile_location:
                  type: string
                  description: 'The Dockerfile location in the repository.'
                dockerfile_target_build:
                  type: string
                  nullable: true
                  description: 'The Docker build target (stage) in the Dockerfile.'
                docker_compose_location:
                  type: string
                  description: 'The Docker Compose location.'
                docker_compose_custom_start_command:
                  type: string
                  description: 'The Docker Compose custom start command.'
                docker_compose_custom_build_command:
                  type: string
                  description: 'The Docker Compose custom build command.'
                docker_compose_domains:
                  type: array
                  description: 'Array of URLs to be applied to containers of a dockercompose application.'
                  items: { properties: { name: { type: string, description: 'The service name as defined in docker-compose.' }, domain: { type: string, description: 'Comma-separated list of URLs (e.g. "https://app.coolify.io,https://app2.coolify.io")' }, redirect: { type: string, nullable: true, description: 'Per-service www/non-www redirect for this compose service.', enum: [www, non-www, both] } }, type: object }
                watch_paths:
                  type: string
                  description: 'Watch path patterns, one per line (newline-separated). Commas do not separate patterns.'
                use_build_server:
                  type: boolean
                  nullable: true
                  description: 'Use build server.'
                use_build_secrets:
                  type: boolean
                  description: 'Use Docker Build Secrets for build-time environment variables.'
                http_basic_auth_hash_algorithm:
                  type: string
                  enum: [bcrypt, argon2id]
                  description: 'Hash algorithm for the HTTP Basic Authentication password. Argon2id needs the Caddy proxy, version 2.11 or newer.'
                http_basic_auth_bcrypt_cost:
                  type: integer
                  minimum: 4
                  maximum: 14
                  description: 'Bcrypt cost for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_memory_cost:
                  type: integer
                  minimum: 8192
                  maximum: 262144
                  description: 'Argon2id memory cost in KiB for the HTTP Basic Authentication password.'
                http_basic_auth_argon2id_time_cost:
                  type: integer
                  minimum: 1
                  maximum: 12
                  description: 'Argon2id time cost (iterations) for the HTTP Basic Authentication password.'
                is_git_submodules_enabled:
                  type: boolean
                  description: 'Clone Git submodules.'
                is_git_lfs_enabled:
                  type: boolean
                  description: 'Enable Git LFS.'
                is_git_shallow_clone_enabled:
                  type: boolean
                  description: 'Use a shallow Git clone.'
                is_auto_cancel_queued_deployments_enabled:
                  type: boolean
                  description: 'Cancel older queued webhook deployments when a newer push arrives. Default: true.'
                is_auto_cancel_building_deployments_enabled:
                  type: boolean
                  description: 'Also stop an older webhook deployment that is still building when a newer push arrives. A deployment that already started to replace containers always finishes. This also cancels queued webhook deployments. Default: false.'
                disable_build_cache:
                  type: boolean
                  description: 'Disable the build cache.'
                inject_build_args_to_dockerfile:
                  type: boolean
                  description: 'Inject build arguments into the Dockerfile build.'
                include_source_commit_in_build:
                  type: boolean
                  description: 'Include the source commit in the build.'
                include_network_hosts_in_build:
                  type: boolean
                  description: 'Add the containers of the destination network as build hosts.'
                is_env_sorting_enabled:
                  type: boolean
                  description: 'Sort environment variables.'
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  default: true
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Redeploy to apply it.'
                is_pr_deployments_public_enabled:
                  type: boolean
                  description: 'Make pull request deployments public.'
                stop_grace_period:
                  type: integer
                  nullable: true
                  minimum: 1
                  maximum: 3600
                  description: 'Container stop grace period in seconds.'
                rolling_update_drain_seconds:
                  type: integer
                  minimum: 0
                  maximum: 300
                  description: 'Seconds to wait after the new container is healthy before old containers stop during a rolling update. 0 turns the wait off. Default: 5.'
                docker_images_to_keep:
                  type: integer
                  minimum: 0
                  maximum: 100
                  description: 'Number of Docker images to retain.'
                is_gzip_enabled:
                  type: boolean
                  description: 'Enable gzip compression.'
                is_stripprefix_enabled:
                  type: boolean
                  description: 'Enable path prefix stripping.'
                is_permanent_redirect_enabled:
                  type: boolean
                  description: 'Use permanent redirects (301/308) instead of temporary (302/307) for the HTTP to HTTPS and www redirects. Defaults to false.'
                traefik_certificate_resolver:
                  type: string
                  nullable: true
                  description: 'Traefik certificate resolver for this application. Null uses the server setting, "none" uses no resolver.'
                is_container_label_readonly_enabled:
                  type: boolean
                  default: true
                  description: 'Let Coolify manage the container labels. True regenerates custom_labels from domains, redirect, and proxy settings. False keeps custom_labels as you set them: domains, redirect, and basic auth changes then do not change the labels.'
                is_raw_compose_deployment_enabled:
                  type: boolean
                  description: 'Deploy the raw Docker Compose definition.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Enable log drain for the application.'
                is_gpu_enabled:
                  type: boolean
                  description: 'Enable GPU support.'
                gpu_driver:
                  type: string
                  nullable: true
                  description: 'GPU driver name.'
                gpu_count:
                  type: string
                  nullable: true
                  description: 'Number of GPUs to allocate.'
                gpu_device_ids:
                  type: string
                  nullable: true
                  description: 'Comma-separated GPU device IDs.'
                gpu_options:
                  type: string
                  nullable: true
                  description: 'Additional GPU options.'
                is_consistent_container_name_enabled:
                  type: boolean
                  description: 'Use a consistent container name across deployments.'
                is_image_scan_enabled:
                  type: boolean
                  description: 'Scan the images of the application for vulnerabilities. Needs image scanning on the server. Default true.'
                custom_internal_name:
                  type: string
                  nullable: true
                  description: 'Custom internal container name. Turns is_consistent_container_name_enabled on when that field is not sent; sending it as false together with a name returns 422.'
                custom_container_name_prefix:
                  type: string
                  nullable: true
                  description: 'Prefix for generated container names (prefix-20260908T141530). Slugified and unique across the instance.'
                preview_url_template:
                  type: string
                  description: 'Preview URL template.'
                max_restart_count:
                  type: integer
                  minimum: 0
                  description: 'Maximum container restart count before stopping.'
                connect_to_docker_network:
                  type: boolean
                  description: 'The flag to connect the service to the predefined Docker network.'
                force_domain_override:
                  type: boolean
                  description: 'Force domain usage even if conflicts are detected. Default is false.'
                is_container_label_escape_enabled:
                  type: boolean
                  default: true
                  description: 'Escape special characters in labels. By default, $ (and other chars) is escaped. So if you write $ in the labels, it will be saved as $$. If you want to use env variables inside the labels, turn this off.'
                is_preserve_repository_enabled:
                  type: boolean
                  description: 'Preserve git repository during application update. If false, the existing repository will be removed and replaced with the new one. If true, the existing repository will be kept and the new one will be ignored. Default is false.'
              type: object
      responses:
        '200':
          description: 'Application updated.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to set a manual webhook secret.'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: 'Domain conflicts detected.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Domain conflicts detected. Use force_domain_override=true to proceed.' }
                  warning: { type: string, example: 'Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior.' }
                  conflicts: { type: array, items: { properties: { domain: { type: string, example: example.com }, resource_name: { type: string, example: 'My Application' }, resource_uuid: { type: string, nullable: true, example: abc123-def456 }, resource_type: { type: string, enum: [application, service, instance], example: application }, message: { type: string, example: "Domain example.com is already in use by application 'My Application'" } }, type: object } }
                type: object
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/logs':
    get:
      tags:
        - Applications
      summary: 'Get application logs.'
      description: 'Get application logs by UUID. Requires the `read:sensitive` or `root` token ability.'
      operationId: get-application-logs-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: lines
          in: query
          description: 'Number of lines to show from the end of the logs. Use `all` to return all logs. `-1` remains available as a compatibility alias.'
          required: false
          schema:
            oneOf:
              -
                type: integer
                format: int32
                default: 100
                maximum: 10000
                minimum: -1
              -
                type: string
                enum:
                  - all
        -
          name: show_timestamps
          in: query
          description: 'Show timestamps in the logs.'
          required: false
          schema:
            type: boolean
            default: false
        -
          name: service_name
          in: query
          description: 'Return logs only from the container of the Docker Compose service with this name. Returns 404 when no container matches. Stopped containers are included.'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: 'Get application logs by UUID.'
          content:
            application/json:
              schema:
                properties:
                  logs: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/previews/{pull_request_id}/logs':
    get:
      tags:
        - Applications
      summary: 'Get preview application logs.'
      description: 'Get runtime container logs for a preview deployment by application UUID and pull request ID. Requires the `read:sensitive` or `root` token ability.'
      operationId: get-preview-application-logs-by-pull-request-id
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: pull_request_id
          in: path
          description: 'Pull request ID of the preview deployment.'
          required: true
          schema:
            type: integer
            minimum: 1
        -
          name: lines
          in: query
          description: 'Number of lines to show from the end of the logs. Use `all` to return all logs. `-1` remains available as a compatibility alias.'
          required: false
          schema:
            oneOf:
              -
                type: integer
                format: int32
                default: 100
                maximum: 10000
                minimum: -1
              -
                type: string
                enum:
                  - all
        -
          name: show_timestamps
          in: query
          description: 'Show timestamps in the logs.'
          required: false
          schema:
            type: boolean
            default: false
        -
          name: service_name
          in: query
          description: 'Return logs only from the container of the Docker Compose service with this name. Returns 404 when no container matches. Stopped containers are included.'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: 'Preview runtime logs.'
          content:
            application/json:
              schema:
                properties:
                  logs: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/envs':
    get:
      tags:
        - Applications
      summary: 'List Envs'
      description: 'List all envs by application UUID.'
      operationId: list-envs-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'All environment variables by application UUID.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EnvironmentVariable'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Applications
      summary: 'Create Env'
      description: 'Create env by application UUID.'
      operationId: create-env-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Env created.'
        required: true
        content:
          application/json:
            schema:
              properties:
                key:
                  type: string
                  description: 'The key of the environment variable.'
                value:
                  type: string
                  description: 'The value of the environment variable.'
                is_preview:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is used in preview deployments.'
                is_literal:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'
                is_multiline:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is multiline.'
                is_shown_once:
                  type: boolean
                  description: 'If true, the saved value is hidden in the UI and API responses. A lock is permanent: false does not unlock a locked variable, but a new value can still replace the locked one. MCP never returns environment variable values.'
              type: object
      responses:
        '201':
          description: 'Environment variable created.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string, example: nc0k04gk8g0cgsk440g0koko }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Applications
      summary: 'Update Env'
      description: 'Update env by application UUID.'
      operationId: update-env-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Env updated.'
        required: true
        content:
          application/json:
            schema:
              required:
                - key
                - value
              properties:
                key:
                  type: string
                  description: 'The key of the environment variable.'
                value:
                  type: string
                  description: 'The value of the environment variable.'
                is_preview:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is used in preview deployments.'
                is_literal:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'
                is_multiline:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is multiline.'
                is_shown_once:
                  type: boolean
                  description: 'If true, the saved value is hidden in the UI and API responses. A lock is permanent: false does not unlock a locked variable, but a new value can still replace the locked one. MCP never returns environment variable values.'
              type: object
      responses:
        '201':
          description: 'Environment variable updated.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentVariable'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/envs/bulk':
    patch:
      tags:
        - Applications
      summary: 'Update Envs (Bulk)'
      description: 'Update multiple envs by application UUID.'
      operationId: update-envs-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Bulk envs updated.'
        required: true
        content:
          application/json:
            schema:
              required:
                - data
              properties:
                data:
                  type: array
                  items: { properties: { key: { type: string, description: 'The key of the environment variable.' }, value: { type: string, description: 'The value of the environment variable.' }, is_preview: { type: boolean, description: 'The flag to indicate if the environment variable is used in preview deployments.' }, is_literal: { type: boolean, description: 'The flag to indicate if the environment variable is a literal, nothing espaced.' }, is_multiline: { type: boolean, description: 'The flag to indicate if the environment variable is multiline.' }, is_shown_once: { type: boolean, description: 'If true, the saved value is hidden in the UI and API responses. A lock is permanent: false does not unlock a locked variable, but a new value can still replace the locked one. MCP never returns environment variable values.' } }, type: object }
              type: object
      responses:
        '201':
          description: 'Environment variables updated.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EnvironmentVariable'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/envs/{env_uuid}':
    delete:
      tags:
        - Applications
      summary: 'Delete Env'
      description: 'Delete env by UUID.'
      operationId: delete-env-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: env_uuid
          in: path
          description: 'UUID of the environment variable.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Environment variable deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Environment variable deleted.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/start':
    post:
      tags:
        - Applications
      summary: Start
      description: 'Start application.'
      operationId: start-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: force
          in: query
          description: 'Force rebuild.'
          schema:
            type: boolean
            default: false
        -
          name: instant_deploy
          in: query
          description: 'Instant deploy (skip queuing).'
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: 'Start application.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Deployment request queued.', description: Message. }
                  deployment_uuid: { type: string, example: doogksw, description: 'UUID of the deployment.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/stop':
    post:
      tags:
        - Applications
      summary: Stop
      description: 'Stop application.'
      operationId: stop-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: docker_cleanup
          in: query
          description: 'Run docker cleanup when the server disk usage is at or above its cleanup threshold. Skipped when a cleanup ran on the server in the last hour.'
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: 'Stop application.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Application stopping request queued.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/restart':
    post:
      tags:
        - Applications
      summary: Restart
      description: 'Restart application.'
      operationId: restart-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Restart application.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Restart request queued.' }
                  deployment_uuid: { type: string, example: doogksw, description: 'UUID of the deployment.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/move':
    post:
      tags:
        - Applications
      summary: Move
      description: 'Move application to another project/environment. This is a purely organizational change — running containers are not affected. Note: after moving, the application will pick up shared environment variables from the new environment on the next deployment.'
      operationId: move-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Target environment to move the application to.'
        required: true
        content:
          application/json:
            schema:
              required:
                - environment_uuid
              properties:
                environment_uuid:
                  type: string
                  description: 'UUID of the target environment.'
              type: object
      responses:
        '200':
          description: 'Application moved successfully.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Application moved successfully.' }
                  uuid: { type: string }
                  project_uuid: { type: string }
                  environment_uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/migrate':
    post:
      tags:
        - Applications
      summary: 'Migrate to Server'
      description: 'Migrate an application to another destination/server owned by the authenticated team. Stops the application, optionally transfers persistent volume data when both servers are managed by Coolify, and updates database records. Redeploy after migration completes.'
      operationId: migrate-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - destination_uuid
              properties:
                destination_uuid:
                  description: 'UUID of the target destination.'
                  type: string
                migrate_volumes:
                  description: 'Whether to transfer persistent volume data when migrating across servers.'
                  type: boolean
                  default: true
              type: object
      responses:
        '200':
          description: 'Application migration started or completed.'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/storages':
    get:
      tags:
        - Applications
      summary: 'List Storages'
      description: 'List all persistent storages and file storages by application UUID.'
      operationId: list-storages-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'All storages by application UUID.'
          content:
            application/json:
              schema:
                properties:
                  persistent_storages: { type: array, items: { type: object } }
                  file_storages: { type: array, items: { type: object } }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Applications
      summary: 'Create Storage'
      description: 'Create a persistent storage or file storage for an application.'
      operationId: create-storage-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - type
                - mount_path
              properties:
                type:
                  type: string
                  enum: [persistent, file]
                  description: 'The type of storage.'
                name:
                  type: string
                  description: 'Volume name (persistent only, required for persistent).'
                mount_path:
                  type: string
                  description: 'The container mount path.'
                content:
                  type: string
                  nullable: true
                  description: 'File content (file only, optional). Needs the deploy ability when set.'
                is_directory:
                  type: boolean
                  description: 'Whether this is a directory mount (file only, default false).'
                fs_path:
                  type: string
                  description: 'Host path. Required for directory mounts and host file mounts. Optional for file mounts with content (default: inside the resource directory). An absolute path can be anywhere on the host; a relative path is inside the resource directory. A directory or file mount outside the resource directory needs a token with the deploy permission. Coolify never deletes a path outside the resource directory.'
              type: object
              additionalProperties: false
      responses:
        '201':
          description: 'Storage created.'
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '403':
          description: 'The token needs the deploy permission for a mount outside the resource directory or for a file storage with content.'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Applications
      summary: 'Update Storage'
      description: 'Update a persistent storage or file storage by application UUID. Changed file content is saved right away and written to the server in the background, so a failed write does not change the response.'
      operationId: update-storage-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.'
        required: true
        content:
          application/json:
            schema:
              required:
                - type
              properties:
                uuid:
                  type: string
                  description: 'The UUID of the storage (preferred).'
                id:
                  type: integer
                  description: 'The ID of the storage (deprecated, use uuid instead).'
                type:
                  type: string
                  enum: [persistent, file]
                  description: 'The type of storage: persistent or file.'
                is_preview_suffix_enabled:
                  type: boolean
                  description: 'Whether to add -pr-N suffix for preview deployments.'
                name:
                  type: string
                  description: 'The volume name (persistent only, not allowed for read-only storages).'
                mount_path:
                  type: string
                  description: 'The container mount path (not allowed for read-only storages).'
                content:
                  type: string
                  nullable: true
                  description: 'The file content (file only, not allowed for read-only storages). Changing the content needs the deploy permission.'
              type: object
              additionalProperties: false
      responses:
        '200':
          description: 'Storage updated.'
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '403':
          description: 'The token needs the deploy permission to change the content of a file outside the resource directory.'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/storages/{storage_uuid}':
    delete:
      tags:
        - Applications
      summary: 'Delete Storage'
      description: 'Delete a persistent storage or file storage by application UUID.'
      operationId: delete-storage-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: storage_uuid
          in: path
          description: 'UUID of the storage.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Storage deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/tags':
    get:
      tags:
        - Applications
      summary: 'List Tags'
      description: 'List tags for an application by UUID.'
      operationId: list-tags-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'List of tags.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Applications
      summary: 'Create Tag'
      description: 'Add tag(s) to an application by UUID.'
      operationId: create-tag-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                tag_name:
                  type: string
                  description: 'The tag name (min 2 characters). Required if tag_names is not provided.'
                tag_names:
                  type: array
                  items: { type: string }
                  description: 'Array of tag names (each min 2 characters). Required if tag_name is not provided.'
              type: object
      responses:
        '201':
          description: 'Tags added successfully.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/tags/{tag_uuid}':
    delete:
      tags:
        - Applications
      summary: 'Delete Tag'
      description: 'Remove a tag from an application by UUID.'
      operationId: delete-tag-by-application-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: tag_uuid
          in: path
          description: 'UUID of the tag.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Tag removed.'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/clone':
    post:
      tags:
        - Applications
      summary: Clone
      description: 'Clone an application to a destination owned by the authenticated team.'
      operationId: clone-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - destination_uuid
              properties:
                destination_uuid:
                  description: 'UUID of the destination to clone into.'
                  type: string
                name:
                  description: 'Optional name for the cloned application.'
                  type: [string, 'null']
                clone_volumes:
                  description: 'Whether to clone volume data. Needs the deploy ability.'
                  type: boolean
                  default: false
              type: object
      responses:
        '201':
          description: 'Application cloned.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                  message: { type: string, example: 'Application cloned.' }
                type: object
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'The token needs the deploy ability to clone volume data.'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/rollback-images':
    get:
      tags:
        - Applications
      summary: 'List Rollback Images'
      description: 'List available Docker images for rolling back an application: images on the server (`local`) and, when a Docker registry image name is set, images of recent successful deployments in the registry (`registry`). Returns an empty list when the server is unavailable or remote inspection is not possible.'
      operationId: list-application-rollback-images
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Rollback images.'
          content:
            application/json:
              schema:
                properties:
                  current: { type: [string, 'null'] }
                  images: { type: array, items: { properties: { tag: { type: string }, created_at: { type: string }, is_current: { type: boolean }, source: { type: string, enum: [local, registry] } }, type: object } }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/rollback':
    post:
      tags:
        - Applications
      summary: Rollback
      description: 'Queue a rollback deployment for an application to a previous image commit/tag.'
      operationId: rollback-application-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - commit
              properties:
                commit:
                  description: 'Image tag / commit to roll back to. Must be a tag from the rollback images list or the commit of a successful production deployment.'
                  type: string
              type: object
      responses:
        '200':
          description: 'Rollback deployment queued.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string }
                  deployment_uuid: { type: string }
                type: object
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/destinations':
    get:
      tags:
        - Applications
      summary: 'List Destinations'
      description: 'List primary and additional destinations for a standalone application.'
      operationId: list-application-destinations
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Application destinations.'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Applications
      summary: 'Add Destination'
      description: 'Attach an additional standalone Docker destination to an application.'
      operationId: add-application-destination
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - destination_uuid
              properties:
                destination_uuid:
                  type: string
              type: object
      responses:
        '201':
          description: 'Destination attached.'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/applications/{uuid}/destinations/{destination_uuid}':
    delete:
      tags:
        - Applications
      summary: 'Remove Destination'
      description: 'Detach an additional destination from an application.'
      operationId: remove-application-destination
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the application.'
          required: true
          schema:
            type: string
        -
          name: destination_uuid
          in: path
          description: 'UUID of the destination.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Destination detached.'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /audit-events:
    get:
      tags:
        - 'Audit Events'
      summary: List
      description: 'List audit events of the team. Only team admins and owners can view audit events. Actor e-mail, token, metadata, changes, IP address, and user agent are returned only for tokens with the read:sensitive or root permission.'
      operationId: list-audit-events
      parameters:
        -
          name: per_page
          in: query
          description: 'Items per page.'
          required: false
          schema:
            type: integer
            default: 25
            maximum: 100
            minimum: 1
        -
          name: page
          in: query
          description: 'Page number.'
          required: false
          schema:
            type: integer
            default: 1
            minimum: 1
        -
          name: search
          in: query
          description: 'Search text.'
          required: false
          schema:
            type: string
            maxLength: 255
        -
          name: action
          in: query
          description: 'Filter by action. Use all for every action.'
          required: false
          schema:
            type: string
            maxLength: 255
        -
          name: source
          in: query
          description: 'Filter by source.'
          required: false
          schema:
            type: string
            enum:
              - all
              - ui
              - api
              - mcp
              - webhook
              - system
              - scheduler
      responses:
        '200':
          description: 'A page of audit events, newest first.'
          content:
            application/json:
              schema:
                properties:
                  current_page: { type: integer }
                  data: { type: array, items: { type: object, properties: { id: { type: integer }, team_id: { type: integer, nullable: true }, event: { type: string }, source: { type: string }, action: { type: string }, level: { type: string }, actor_type: { type: string, nullable: true }, actor_id: { type: integer, nullable: true }, actor_name: { type: string, nullable: true }, resource_type: { type: string, nullable: true }, resource_uuid: { type: string, nullable: true }, resource_name: { type: string, nullable: true }, description: { type: string, nullable: true }, created_at: { type: string, format: date-time } } } }
                  per_page: { type: integer }
                  last_page: { type: integer }
                  total: { type: integer }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Only team admins and owners can view audit logs.'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /cloud-init-scripts:
    get:
      tags:
        - 'Cloud-init Scripts'
      summary: 'List Cloud-init Scripts'
      description: 'List all cloud-init scripts for the authenticated team.'
      operationId: list-cloud-init-scripts
      responses:
        '200':
          description: 'Cloud-init scripts for the team.'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: Forbidden.
      security:
        -
          bearerAuth: []
    post:
      tags:
        - 'Cloud-init Scripts'
      summary: 'Create Cloud-init Script'
      description: 'Create a new cloud-init script for the authenticated team.'
      operationId: create-cloud-init-script
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - name
                - script
              properties:
                name:
                  type: string
                script:
                  description: 'Bash script (#!) or cloud-config YAML.'
                  type: string
              type: object
      responses:
        '201':
          description: 'Cloud-init script created.'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: Forbidden.
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/cloud-init-scripts/{uuid}':
    get:
      tags:
        - 'Cloud-init Scripts'
      summary: 'Get Cloud-init Script'
      description: 'Get a cloud-init script by UUID.'
      operationId: get-cloud-init-script-by-uuid
      parameters:
        -
          name: uuid
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Cloud-init script.'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: Forbidden.
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    delete:
      tags:
        - 'Cloud-init Scripts'
      summary: 'Delete Cloud-init Script'
      description: 'Delete a cloud-init script by UUID.'
      operationId: delete-cloud-init-script-by-uuid
      parameters:
        -
          name: uuid
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Cloud-init script deleted.'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: Forbidden.
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - 'Cloud-init Scripts'
      summary: 'Update Cloud-init Script'
      description: 'Update a cloud-init script by UUID.'
      operationId: update-cloud-init-script-by-uuid
      parameters:
        -
          name: uuid
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                script:
                  type: string
              type: object
      responses:
        '200':
          description: 'Cloud-init script updated.'
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: Forbidden.
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /cloud-tokens:
    get:
      tags:
        - 'Cloud Tokens'
      summary: 'List Cloud Provider Tokens'
      description: 'List all cloud provider tokens for the authenticated team.'
      operationId: list-cloud-tokens
      responses:
        '200':
          description: 'Get all cloud provider tokens.'
          content:
            application/json:
              schema:
                type: array
                items:
                  properties: { uuid: { type: string }, name: { type: string }, provider: { type: string, enum: [hetzner, digitalocean, vultr, hostinger] }, team_id: { type: integer }, servers_count: { type: integer }, created_at: { type: string }, updated_at: { type: string } }
                  type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Only team admins and owners can manage cloud provider tokens.'
        '400':
          $ref: '#/components/responses/400'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - 'Cloud Tokens'
      summary: 'Create Cloud Provider Token'
      description: 'Create a new cloud provider token. The token will be validated before being stored.'
      operationId: create-cloud-token
      requestBody:
        description: 'Cloud provider token details'
        required: true
        content:
          application/json:
            schema:
              required:
                - provider
                - token
                - name
              properties:
                provider:
                  type: string
                  enum: [hetzner, digitalocean, vultr, hostinger]
                  example: hetzner
                  description: 'The cloud provider.'
                token:
                  type: string
                  example: your-api-token-here
                  description: 'The API token for the cloud provider.'
                name:
                  type: string
                  example: 'My Hetzner Token'
                  description: 'A friendly name for the token.'
              type: object
      responses:
        '201':
          description: 'Cloud provider token created.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string, example: og888os, description: 'The UUID of the token.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Only team admins and owners can manage cloud provider tokens.'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/cloud-tokens/{uuid}':
    get:
      tags:
        - 'Cloud Tokens'
      summary: 'Get Cloud Provider Token'
      description: 'Get cloud provider token by UUID.'
      operationId: get-cloud-token-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'Token UUID'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Get cloud provider token by UUID'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                  name: { type: string }
                  provider: { type: string }
                  team_id: { type: integer }
                  servers_count: { type: integer }
                  created_at: { type: string }
                  updated_at: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Only team admins and owners can manage cloud provider tokens.'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    delete:
      tags:
        - 'Cloud Tokens'
      summary: 'Delete Cloud Provider Token'
      description: 'Delete cloud provider token by UUID. Cannot delete if token is used by any servers.'
      operationId: delete-cloud-token-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the cloud provider token.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Cloud provider token deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Cloud provider token deleted.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Only team admins and owners can manage cloud provider tokens.'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - 'Cloud Tokens'
      summary: 'Update Cloud Provider Token'
      description: 'Update cloud provider token name.'
      operationId: update-cloud-token-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'Token UUID'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Cloud provider token updated.'
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                  description: 'The friendly name for the token.'
              type: object
      responses:
        '200':
          description: 'Cloud provider token updated.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Only team admins and owners can manage cloud provider tokens.'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/cloud-tokens/{uuid}/validate':
    post:
      tags:
        - 'Cloud Tokens'
      summary: 'Validate Cloud Provider Token'
      description: 'Validate a cloud provider token against the provider API.'
      operationId: validate-cloud-token-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'Token UUID'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Token validation result.'
          content:
            application/json:
              schema:
                properties:
                  valid: { type: boolean, example: true }
                  message: { type: string, example: 'Token is valid.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '403':
          description: 'Only team admins and owners can manage cloud provider tokens.'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/imports/uploads':
    post:
      tags:
        - Databases
      summary: 'Upload database import'
      operationId: upload-database-import
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '201':
          description: 'Upload completed'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/imports':
    post:
      tags:
        - Databases
      summary: 'Import database backup'
      description: 'Restore a backup into the database. Every import source requires the deploy ability.'
      operationId: create-database-import
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DatabaseImportRequest'
      responses:
        '202':
          description: 'Import queued'
        '403':
          description: 'The token needs the deploy ability.'
        '409':
          description: 'Another start, restart or import of this database is already in progress.'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/imports/{activity_id}':
    get:
      tags:
        - Databases
      summary: 'Get database import status'
      operationId: get-database-import
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
        -
          name: activity_id
          in: path
          description: 'Import activity ID.'
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: 'Import status'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseImportStatus'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  /databases:
    get:
      tags:
        - Databases
      summary: List
      description: 'List all databases.'
      operationId: list-databases
      responses:
        '200':
          description: 'Get all databases'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Database'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/backups':
    get:
      tags:
        - Databases
      summary: Get
      description: 'Get backups details by database UUID.'
      operationId: get-database-backups-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Get all backups for a database. Each backup includes s3_storage_uuid (primary S3 destination) and s3_storage_uuids (every S3 destination, primary first).'
          content:
            application/json:
              schema:
                type: string
              example: 'Content is very complex. Will be implemented later.'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Databases
      summary: 'Create Backup'
      description: 'Create a new scheduled backup configuration for a database'
      operationId: create-database-backup
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Backup configuration data'
        required: true
        content:
          application/json:
            schema:
              required:
                - frequency
              properties:
                frequency:
                  type: string
                  description: 'Backup frequency (cron expression or: every_minute, hourly, daily, weekly, monthly, yearly)'
                enabled:
                  type: boolean
                  description: 'Whether the backup is enabled'
                  default: true
                save_s3:
                  type: boolean
                  description: 'Whether to save backups to S3'
                  default: false
                disable_local_backup:
                  type: boolean
                  description: 'Delete the local backup file after the upload to S3. Only allowed when save_s3 is true.'
                  default: false
                s3_storage_uuid:
                  type: string
                  description: 'Primary S3 storage UUID. Sent without s3_storage_uuids, it selects this storage as the only destination. Either field is required if save_s3 is true.'
                s3_storage_uuids:
                  type: array
                  items: { type: string }
                  description: 'UUIDs of every S3 storage the backup is uploaded to. Replaces the current destinations. When s3_storage_uuid is also sent, it must be in this list and becomes the primary destination; otherwise the first entry is the primary destination.'
                databases_to_backup:
                  type: string
                  description: 'Comma separated list of databases to backup'
                dump_all:
                  type: boolean
                  description: 'Whether to dump all databases'
                  default: false
                backup_now:
                  type: boolean
                  description: 'Whether to trigger backup immediately after creation. Needs a token with the deploy permission.'
                database_backup_retention_amount_locally:
                  type: integer
                  description: 'Number of backups to retain locally'
                database_backup_retention_days_locally:
                  type: integer
                  description: 'Number of days to retain backups locally'
                database_backup_retention_max_storage_locally:
                  type: number
                  description: 'Max storage (GB) for local backups'
                database_backup_retention_amount_s3:
                  type: integer
                  description: 'Number of backups to retain in S3'
                database_backup_retention_days_s3:
                  type: integer
                  description: 'Number of days to retain backups in S3'
                database_backup_retention_max_storage_s3:
                  type: number
                  description: 'Max storage (GB) for S3 backups'
                timeout:
                  type: integer
                  description: 'Backup job timeout in seconds (min: 60, max: 36000)'
                  default: 3600
                missing_backup_notification_days:
                  type: integer
                  description: 'Alert after this many days without an execution; 0 disables alerts'
                  minimum: 0
                  maximum: 365
                  default: 0
              type: object
      responses:
        '201':
          description: 'Backup configuration created successfully'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string, format: uuid, example: 550e8400-e29b-41d4-a716-446655440000 }
                  message: { type: string, example: 'Backup configuration created successfully.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '403':
          description: 'The token needs the deploy permission to use backup_now.'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}':
    get:
      tags:
        - Databases
      summary: Get
      description: 'Get database by UUID.'
      operationId: get-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Get database by UUID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Database'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    delete:
      tags:
        - Databases
      summary: Delete
      description: 'Delete database by UUID. Needs a token with the write and deploy permissions.'
      operationId: delete-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
        -
          name: delete_configurations
          in: query
          description: 'Delete configurations.'
          required: false
          schema:
            type: boolean
            default: true
        -
          name: delete_volumes
          in: query
          description: 'Delete volumes.'
          required: false
          schema:
            type: boolean
            default: true
        -
          name: docker_cleanup
          in: query
          description: 'Run docker cleanup when the server disk usage is at or above its cleanup threshold. Skipped when a cleanup ran on the server in the last hour.'
          required: false
          schema:
            type: boolean
            default: true
        -
          name: delete_connected_networks
          in: query
          description: 'Delete connected networks.'
          required: false
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: 'Database deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Database deleted.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '403':
          description: 'The token needs the write and deploy permissions.'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Databases
      summary: Update
      description: 'Update database by UUID.'
      operationId: update-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public? Changing it starts or stops the database proxy, so it needs a token with the deploy permission.'
                public_port:
                  type: integer
                  description: 'Public port of the database (1024-65535)'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Restart the database after the update. Requires the deploy ability.'
                postgres_user:
                  type: string
                  description: 'PostgreSQL user'
                postgres_password:
                  type: string
                  description: 'PostgreSQL password'
                postgres_db:
                  type: string
                  description: 'PostgreSQL database'
                postgres_initdb_args:
                  type: string
                  description: 'PostgreSQL initdb args'
                postgres_host_auth_method:
                  type: string
                  description: 'PostgreSQL host auth method'
                postgres_conf:
                  type: string
                  description: 'PostgreSQL conf'
                clickhouse_admin_user:
                  type: string
                  description: 'Clickhouse admin user'
                clickhouse_admin_password:
                  type: string
                  description: 'Clickhouse admin password'
                dragonfly_password:
                  type: string
                  description: 'DragonFly password'
                redis_password:
                  type: string
                  description: 'Redis password'
                redis_conf:
                  type: string
                  description: 'Redis conf'
                keydb_password:
                  type: string
                  description: 'KeyDB password'
                keydb_conf:
                  type: string
                  description: 'KeyDB conf'
                mariadb_conf:
                  type: string
                  description: 'MariaDB conf'
                mariadb_root_password:
                  type: string
                  description: 'MariaDB root password'
                mariadb_user:
                  type: string
                  description: 'MariaDB user'
                mariadb_password:
                  type: string
                  description: 'MariaDB password'
                mariadb_database:
                  type: string
                  description: 'MariaDB database'
                mongo_conf:
                  type: string
                  description: 'Mongo conf'
                mongo_initdb_root_username:
                  type: string
                  description: 'Mongo initdb root username'
                mongo_initdb_root_password:
                  type: string
                  description: 'Mongo initdb root password'
                mongo_initdb_database:
                  type: string
                  description: 'Mongo initdb init database'
                mysql_root_password:
                  type: string
                  description: 'MySQL root password'
                mysql_password:
                  type: string
                  description: 'MySQL password'
                mysql_user:
                  type: string
                  description: 'MySQL user'
                mysql_database:
                  type: string
                  description: 'MySQL database'
                mysql_conf:
                  type: string
                  description: 'MySQL conf'
                sqlite_databases:
                  type: string
                  description: 'Comma-separated SQLite database file names'
                health_check_enabled:
                  type: boolean
                  description: 'Enable the database healthcheck probe.'
                  default: true
                health_check_interval:
                  type: integer
                  description: 'Healthcheck interval in seconds.'
                  minimum: 1
                  default: 15
                health_check_timeout:
                  type: integer
                  description: 'Healthcheck timeout in seconds.'
                  minimum: 1
                  default: 5
                health_check_retries:
                  type: integer
                  description: 'Healthcheck retries count.'
                  minimum: 1
                  default: 5
                health_check_start_period:
                  type: integer
                  description: 'Healthcheck start period in seconds.'
                  minimum: 0
                  default: 5
                redact_all_env_values_in_logs:
                  type: boolean
                  description: 'Redact all environment variable values in logs. When false, only locked (shown once) values, database passwords, and remote secrets are redacted. Requires team admin permissions.'
                include_coolify_default_variables:
                  type: boolean
                  description: 'Add the predefined COOLIFY_* variables (COOLIFY_URL, COOLIFY_FQDN, ...) to the environment. Requires team admin permissions. Restart the database to apply it.'
                is_log_drain_enabled:
                  type: boolean
                  description: 'Send the database logs to the log drain of the server. Log drain must be enabled on the server. Restart the database to apply it.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '403':
          description: 'The token needs the deploy permission to change is_public or to use instant_deploy.'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/backups/{scheduled_backup_uuid}':
    delete:
      tags:
        - Databases
      summary: 'Delete backup configuration'
      description: 'Deletes a backup configuration and all its executions.'
      operationId: delete-backup-configuration-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database'
          required: true
          schema:
            type: string
        -
          name: scheduled_backup_uuid
          in: path
          description: 'UUID of the backup configuration to delete'
          required: true
          schema:
            type: string
        -
          name: delete_s3
          in: query
          description: 'Whether to delete all backup files from S3'
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: 'Backup configuration deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Backup configuration and all executions deleted.' }
                type: object
        '404':
          description: 'Backup configuration not found.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Backup configuration not found.' }
                type: object
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Databases
      summary: Update
      description: 'Update a specific backup configuration for a given database, identified by its UUID and the backup ID'
      operationId: update-database-backup
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
        -
          name: scheduled_backup_uuid
          in: path
          description: 'UUID of the backup configuration.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Database backup configuration data'
        required: true
        content:
          application/json:
            schema:
              properties:
                save_s3:
                  type: boolean
                  description: 'Whether data is saved in s3 or not'
                disable_local_backup:
                  type: boolean
                  description: 'Delete the local backup file after the upload to S3. Only allowed when save_s3 is true. Turning save_s3 off also turns this off.'
                s3_storage_uuid:
                  type: string
                  description: 'Primary S3 storage UUID. Sent without s3_storage_uuids, it selects this storage as the only destination; when it is already a destination, it becomes the primary destination and the other destinations stay.'
                s3_storage_uuids:
                  type: array
                  items: { type: string }
                  description: 'UUIDs of every S3 storage the backup is uploaded to. Replaces the current destinations. When s3_storage_uuid is also sent, it must be in this list and becomes the primary destination; otherwise the first entry is the primary destination.'
                backup_now:
                  type: boolean
                  description: 'Whether to take a backup now or not. Needs a token with the deploy permission.'
                enabled:
                  type: boolean
                  description: 'Whether the backup is enabled or not'
                databases_to_backup:
                  type: string
                  description: 'Comma separated list of databases to backup'
                dump_all:
                  type: boolean
                  description: 'Whether all databases are dumped or not'
                frequency:
                  type: string
                  description: 'Frequency of the backup'
                database_backup_retention_amount_locally:
                  type: integer
                  description: 'Retention amount of the backup locally'
                database_backup_retention_days_locally:
                  type: integer
                  description: 'Retention days of the backup locally'
                database_backup_retention_max_storage_locally:
                  type: number
                  description: 'Max storage of the backup locally'
                database_backup_retention_amount_s3:
                  type: integer
                  description: 'Retention amount of the backup in s3'
                database_backup_retention_days_s3:
                  type: integer
                  description: 'Retention days of the backup in s3'
                database_backup_retention_max_storage_s3:
                  type: number
                  description: 'Max storage of the backup in S3'
                timeout:
                  type: integer
                  description: 'Backup job timeout in seconds (min: 60, max: 36000)'
                  default: 3600
                missing_backup_notification_days:
                  type: integer
                  description: 'Alert after this many days without an execution; 0 disables alerts'
                  minimum: 0
                  maximum: 365
              type: object
      responses:
        '200':
          description: 'Database backup configuration updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '403':
          description: 'The token needs the deploy permission to use backup_now.'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/postgresql:
    post:
      tags:
        - Databases
      summary: 'Create (PostgreSQL)'
      description: 'Create a new PostgreSQL database.'
      operationId: create-database-postgresql
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                postgres_user:
                  type: string
                  description: 'PostgreSQL user'
                postgres_password:
                  type: string
                  description: 'PostgreSQL password'
                postgres_db:
                  type: string
                  description: 'PostgreSQL database'
                postgres_initdb_args:
                  type: string
                  description: 'PostgreSQL initdb args'
                postgres_host_auth_method:
                  type: string
                  description: 'PostgreSQL host auth method'
                postgres_conf:
                  type: string
                  description: 'PostgreSQL conf'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/clickhouse:
    post:
      tags:
        - Databases
      summary: 'Create (Clickhouse)'
      description: 'Create a new Clickhouse database.'
      operationId: create-database-clickhouse
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                clickhouse_admin_user:
                  type: string
                  description: 'Clickhouse admin user'
                clickhouse_admin_password:
                  type: string
                  description: 'Clickhouse admin password'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/dragonfly:
    post:
      tags:
        - Databases
      summary: 'Create (DragonFly)'
      description: 'Create a new DragonFly database.'
      operationId: create-database-dragonfly
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                dragonfly_password:
                  type: string
                  description: 'DragonFly password'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/redis:
    post:
      tags:
        - Databases
      summary: 'Create (Redis / Valkey)'
      description: 'Create a new Redis or Valkey database. Valkey (valkey/valkey:9-alpine) is the default. Set image to a Redis image (for example redis:8) for Redis.'
      operationId: create-database-redis
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                redis_password:
                  type: string
                  description: 'Redis password'
                redis_conf:
                  type: string
                  description: 'Redis conf'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker image of the database. Default: valkey/valkey:9-alpine. For Redis, use a Redis image, for example redis:8.'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/keydb:
    post:
      tags:
        - Databases
      summary: 'Create (KeyDB)'
      description: 'Create a new KeyDB database.'
      operationId: create-database-keydb
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                keydb_password:
                  type: string
                  description: 'KeyDB password'
                keydb_conf:
                  type: string
                  description: 'KeyDB conf'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/mariadb:
    post:
      tags:
        - Databases
      summary: 'Create (MariaDB)'
      description: 'Create a new MariaDB database.'
      operationId: create-database-mariadb
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                mariadb_conf:
                  type: string
                  description: 'MariaDB conf'
                mariadb_root_password:
                  type: string
                  description: 'MariaDB root password'
                mariadb_user:
                  type: string
                  description: 'MariaDB user'
                mariadb_password:
                  type: string
                  description: 'MariaDB password'
                mariadb_database:
                  type: string
                  description: 'MariaDB database'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/mysql:
    post:
      tags:
        - Databases
      summary: 'Create (MySQL)'
      description: 'Create a new MySQL database.'
      operationId: create-database-mysql
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                mysql_root_password:
                  type: string
                  description: 'MySQL root password'
                mysql_password:
                  type: string
                  description: 'MySQL password'
                mysql_user:
                  type: string
                  description: 'MySQL user'
                mysql_database:
                  type: string
                  description: 'MySQL database'
                mysql_conf:
                  type: string
                  description: 'MySQL conf'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/mongodb:
    post:
      tags:
        - Databases
      summary: 'Create (MongoDB)'
      description: 'Create a new MongoDB database.'
      operationId: create-database-mongodb
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                mongo_conf:
                  type: string
                  description: 'MongoDB conf'
                mongo_initdb_root_username:
                  type: string
                  description: 'MongoDB initdb root username'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                is_public:
                  type: boolean
                  description: 'Is the database public?'
                public_port:
                  type: integer
                  description: 'Public port of the database'
                public_port_timeout:
                  type: integer
                  description: 'Public port timeout in seconds (default: 3600)'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  /databases/sqlite:
    post:
      tags:
        - Databases
      summary: 'Create (SQLite)'
      description: 'Create a new SQLite database.'
      operationId: create-database-sqlite
      requestBody:
        description: 'Database data'
        required: true
        content:
          application/json:
            schema:
              required:
                - server_uuid
                - project_uuid
              properties:
                server_uuid:
                  type: string
                  description: 'UUID of the server'
                project_uuid:
                  type: string
                  description: 'UUID of the project'
                environment_name:
                  type: string
                  description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
                environment_uuid:
                  type: string
                  description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
                destination_uuid:
                  type: string
                  description: 'UUID of the destination if the server has multiple destinations'
                sqlite_databases:
                  type: string
                  description: 'Comma-separated SQLite database file names'
                name:
                  type: string
                  description: 'Name of the database'
                description:
                  type: string
                  description: 'Description of the database'
                image:
                  type: string
                  description: 'Docker Image of the database'
                limits_memory:
                  type: string
                  description: 'Memory limit of the database'
                limits_memory_swap:
                  type: string
                  description: 'Memory swap limit of the database'
                limits_memory_swappiness:
                  type: integer
                  description: 'Memory swappiness of the database'
                limits_memory_reservation:
                  type: string
                  description: 'Memory reservation of the database'
                limits_cpus:
                  type: string
                  description: 'CPU limit of the database'
                limits_cpuset:
                  type: string
                  description: 'CPU set of the database'
                limits_cpu_shares:
                  type: integer
                  description: 'CPU shares of the database'
                instant_deploy:
                  type: boolean
                  description: 'Instant deploy the database'
                tags:
                  type: array
                  items: { type: string }
                  description: 'Tags to assign to the database.'
              type: object
      responses:
        '200':
          description: 'Database updated'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/logs':
    get:
      tags:
        - Databases
      summary: 'Get database logs.'
      description: 'Get database logs by UUID. Requires the `read:sensitive` or `root` token ability.'
      operationId: get-database-logs-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
            format: uuid
        -
          name: lines
          in: query
          description: 'Number of lines to show from the end of the logs. Use `all` to return all logs. `-1` remains available as a compatibility alias.'
          required: false
          schema:
            oneOf:
              -
                type: integer
                format: int32
                default: 100
                maximum: 10000
                minimum: -1
              -
                type: string
                enum:
                  - all
        -
          name: show_timestamps
          in: query
          description: 'Show timestamps in the logs.'
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: 'Get database logs by UUID.'
          content:
            application/json:
              schema:
                properties:
                  logs: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/backups/{scheduled_backup_uuid}/executions/{execution_uuid}':
    delete:
      tags:
        - Databases
      summary: 'Delete backup execution'
      description: 'Deletes a specific backup execution.'
      operationId: delete-backup-execution-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database'
          required: true
          schema:
            type: string
        -
          name: scheduled_backup_uuid
          in: path
          description: 'UUID of the backup configuration'
          required: true
          schema:
            type: string
        -
          name: execution_uuid
          in: path
          description: 'UUID of the backup execution to delete'
          required: true
          schema:
            type: string
        -
          name: delete_s3
          in: query
          description: 'Whether to delete the backup from S3'
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: 'Backup execution deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Backup execution deleted.' }
                type: object
        '404':
          description: 'Backup execution not found.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Backup execution not found.' }
                type: object
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/backups/{scheduled_backup_uuid}/executions':
    get:
      tags:
        - Databases
      summary: 'List backup executions'
      description: 'Get all executions for a specific backup configuration. The execution `message` is only returned (redacted) to tokens with the `read:sensitive` or `root` ability; otherwise it is `null`.'
      operationId: list-backup-executions
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database'
          required: true
          schema:
            type: string
        -
          name: scheduled_backup_uuid
          in: path
          description: 'UUID of the backup configuration'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'List of backup executions'
          content:
            application/json:
              schema:
                properties:
                  executions: { type: array, items: { properties: { uuid: { type: string }, filename: { type: string }, size: { type: integer }, created_at: { type: string }, message: { description: 'Redacted execution output. Null unless the token has the `read:sensitive` or `root` ability.', type: [string, 'null'] }, status: { type: string } }, type: object } }
                type: object
        '404':
          description: 'Backup configuration not found.'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/move':
    post:
      tags:
        - Databases
      summary: Move
      description: 'Move database to another project/environment. This is a purely organizational change — running containers are not affected. Note: after moving, the database will pick up shared environment variables from the new environment on the next deployment.'
      operationId: move-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Target environment to move the database to.'
        required: true
        content:
          application/json:
            schema:
              required:
                - environment_uuid
              properties:
                environment_uuid:
                  type: string
                  description: 'UUID of the target environment.'
              type: object
      responses:
        '200':
          description: 'Database moved successfully.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Database moved successfully.' }
                  uuid: { type: string }
                  project_uuid: { type: string }
                  environment_uuid: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/migrate':
    post:
      tags:
        - Databases
      summary: 'Migrate to Server'
      description: 'Migrate a database to another destination/server owned by the authenticated team. Stops the database, optionally transfers persistent volume data when both servers are managed by Coolify, and updates database records. Redeploy after migration completes.'
      operationId: migrate-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - destination_uuid
              properties:
                destination_uuid:
                  description: 'UUID of the target destination.'
                  type: string
                migrate_volumes:
                  description: 'Whether to transfer persistent volume data when migrating across servers.'
                  type: boolean
                  default: true
              type: object
      responses:
        '200':
          description: 'Database migration started or completed.'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/start':
    post:
      tags:
        - Databases
      summary: Start
      description: 'Start database.'
      operationId: start-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Start database.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Database starting request queued.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: 'Another start, restart or import of this database is already in progress.'
        '422':
          description: 'The database cannot start yet, for example because a CA certificate is missing.'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/stop':
    post:
      tags:
        - Databases
      summary: Stop
      description: 'Stop database.'
      operationId: stop-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
        -
          name: docker_cleanup
          in: query
          description: 'Run docker cleanup when the server disk usage is at or above its cleanup threshold. Skipped when a cleanup ran on the server in the last hour.'
          schema:
            type: boolean
            default: true
      responses:
        '200':
          description: 'Stop database.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Database stopping request queued.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/restart':
    post:
      tags:
        - Databases
      summary: Restart
      description: 'Restart database.'
      operationId: restart-database-by-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Restart database.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Database restaring request queued.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '409':
          description: 'Another start, restart or import of this database is already in progress.'
        '422':
          description: 'The database cannot start yet, for example because a CA certificate is missing.'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/envs':
    get:
      tags:
        - Databases
      summary: 'List Envs'
      description: 'List all envs by database UUID.'
      operationId: list-envs-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Environment variables.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EnvironmentVariable'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Databases
      summary: 'Create Env'
      description: 'Create env by database UUID.'
      operationId: create-env-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Env created.'
        required: true
        content:
          application/json:
            schema:
              properties:
                key:
                  type: string
                  description: 'The key of the environment variable.'
                value:
                  type: string
                  description: 'The value of the environment variable.'
                is_literal:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'
                is_multiline:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is multiline.'
                is_shown_once:
                  type: boolean
                  description: 'If true, the saved value is hidden in the UI and API responses. A lock is permanent: false does not unlock a locked variable, but a new value can still replace the locked one. MCP never returns environment variable values.'
              type: object
      responses:
        '201':
          description: 'Environment variable created.'
          content:
            application/json:
              schema:
                properties:
                  uuid: { type: string, example: nc0k04gk8g0cgsk440g0koko }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Databases
      summary: 'Update Env'
      description: 'Update env by database UUID.'
      operationId: update-env-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Env updated.'
        required: true
        content:
          application/json:
            schema:
              required:
                - key
                - value
              properties:
                key:
                  type: string
                  description: 'The key of the environment variable.'
                value:
                  type: string
                  description: 'The value of the environment variable.'
                is_literal:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is a literal, nothing espaced.'
                is_multiline:
                  type: boolean
                  description: 'The flag to indicate if the environment variable is multiline.'
                is_shown_once:
                  type: boolean
                  description: 'If true, the saved value is hidden in the UI and API responses. A lock is permanent: false does not unlock a locked variable, but a new value can still replace the locked one. MCP never returns environment variable values.'
              type: object
      responses:
        '201':
          description: 'Environment variable updated.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EnvironmentVariable'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/envs/bulk':
    patch:
      tags:
        - Databases
      summary: 'Update Envs (Bulk)'
      description: 'Update multiple envs by database UUID.'
      operationId: update-envs-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Bulk envs updated.'
        required: true
        content:
          application/json:
            schema:
              required:
                - data
              properties:
                data:
                  type: array
                  items: { properties: { key: { type: string, description: 'The key of the environment variable.' }, value: { type: string, description: 'The value of the environment variable.' }, is_literal: { type: boolean, description: 'The flag to indicate if the environment variable is a literal, nothing espaced.' }, is_multiline: { type: boolean, description: 'The flag to indicate if the environment variable is multiline.' }, is_shown_once: { type: boolean, description: 'If true, the saved value is hidden in the UI and API responses. A lock is permanent: false does not unlock a locked variable, but a new value can still replace the locked one. MCP never returns environment variable values.' } }, type: object }
              type: object
      responses:
        '201':
          description: 'Environment variables updated.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/EnvironmentVariable'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/envs/{env_uuid}':
    delete:
      tags:
        - Databases
      summary: 'Delete Env'
      description: 'Delete env by UUID.'
      operationId: delete-env-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
        -
          name: env_uuid
          in: path
          description: 'UUID of the environment variable.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Environment variable deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string, example: 'Environment variable deleted.' }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/storages':
    get:
      tags:
        - Databases
      summary: 'List Storages'
      description: 'List all persistent storages and file storages by database UUID.'
      operationId: list-storages-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'All storages by database UUID.'
          content:
            application/json:
              schema:
                properties:
                  persistent_storages: { type: array, items: { type: object } }
                  file_storages: { type: array, items: { type: object } }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Databases
      summary: 'Create Storage'
      description: 'Create a persistent storage or file storage for a database.'
      operationId: create-storage-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              required:
                - type
                - mount_path
              properties:
                type:
                  type: string
                  enum: [persistent, file]
                  description: 'The type of storage.'
                name:
                  type: string
                  description: 'Volume name (persistent only, required for persistent).'
                mount_path:
                  type: string
                  description: 'The container mount path.'
                content:
                  type: string
                  nullable: true
                  description: 'File content (file only, optional). Needs the deploy ability when set.'
                is_directory:
                  type: boolean
                  description: 'Whether this is a directory mount (file only, default false).'
                fs_path:
                  type: string
                  description: 'Host path. Required for directory mounts and host file mounts. Optional for file mounts with content (default: inside the resource directory). An absolute path can be anywhere on the host; a relative path is inside the resource directory. A directory or file mount outside the resource directory needs a token with the deploy permission. Coolify never deletes a path outside the resource directory.'
              type: object
              additionalProperties: false
      responses:
        '201':
          description: 'Storage created.'
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '403':
          description: 'The token needs the deploy permission for a mount outside the resource directory or for a file storage with content.'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
    patch:
      tags:
        - Databases
      summary: 'Update Storage'
      description: 'Update a persistent storage or file storage by database UUID. Changed file content is saved right away and written to the server in the background, so a failed write does not change the response.'
      operationId: update-storage-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        description: 'Storage updated. For read-only storages (from docker-compose or services), only is_preview_suffix_enabled can be updated.'
        required: true
        content:
          application/json:
            schema:
              required:
                - type
              properties:
                uuid:
                  type: string
                  description: 'The UUID of the storage (preferred).'
                id:
                  type: integer
                  description: 'The ID of the storage (deprecated, use uuid instead).'
                type:
                  type: string
                  enum: [persistent, file]
                  description: 'The type of storage: persistent or file.'
                is_preview_suffix_enabled:
                  type: boolean
                  description: 'Whether to add -pr-N suffix for preview deployments.'
                name:
                  type: string
                  description: 'The volume name (persistent only, not allowed for read-only storages).'
                mount_path:
                  type: string
                  description: 'The container mount path (not allowed for read-only storages).'
                content:
                  type: string
                  nullable: true
                  description: 'The file content (file only, not allowed for read-only storages). Changing the content needs the deploy permission.'
              type: object
              additionalProperties: false
      responses:
        '200':
          description: 'Storage updated.'
          content:
            application/json:
              schema:
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '403':
          description: 'The token needs the deploy permission to change the content of a file outside the resource directory.'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/storages/{storage_uuid}':
    delete:
      tags:
        - Databases
      summary: 'Delete Storage'
      description: 'Delete a persistent storage or file storage by database UUID.'
      operationId: delete-storage-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
        -
          name: storage_uuid
          in: path
          description: 'UUID of the storage.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'Storage deleted.'
          content:
            application/json:
              schema:
                properties:
                  message: { type: string }
                type: object
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '422':
          $ref: '#/components/responses/422'
      security:
        -
          bearerAuth: []
  '/databases/{uuid}/tags':
    get:
      tags:
        - Databases
      summary: 'List Tags'
      description: 'List tags for a database by UUID.'
      operationId: list-tags-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 'List of tags.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
      security:
        -
          bearerAuth: []
    post:
      tags:
        - Databases
      summary: 'Create Tag'
      description: 'Add tag(s) to a database by UUID.'
      operationId: create-tag-by-database-uuid
      parameters:
        -
          name: uuid
          in: path
          description: 'UUID of the database.'
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                tag_name:
                  type: string
                  description: 'The tag name (min 2 characters). Required if tag_names is not provided.'
                tag_names:
                  type: array
                  items: { type: string }
                  description: 'Array of tag names (each min 2 characters). Required if tag_name is not provided.'
              type: object
      responses:
        '201':
          description: 'Tags added successfully.'
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tag'
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/respo