Coolify Databases API

Databases

OpenAPI Specification

coolify-databases-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Coolify Applications Databases API
  version: '0.1'
  description: Applications
servers:
- url: https://app.coolify.io/api/v1
  description: Coolify Cloud API. Change the host to your own instance if you are self-hosting.
tags:
- name: Databases
  description: Databases
paths:
  /databases:
    get:
      tags:
      - Databases
      summary: List
      description: List all databases.
      operationId: list-databases
      responses:
        '200':
          description: Get all databases
          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'
      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
          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
                s3_storage_uuid:
                  type: string
                  description: S3 storage UUID (required if save_s3 is true)
                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
                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
              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'
        '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 all databases
          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: []
    delete:
      tags:
      - Databases
      summary: Delete
      description: Delete database by UUID.
      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.
        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'
      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?
                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
                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
              type: object
      responses:
        '200':
          description: Database updated
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '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
                s3_storage_uuid:
                  type: string
                  description: S3 storage UUID
                backup_now:
                  type: boolean
                  description: Whether to take a backup now or not
                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
              type: object
      responses:
        '200':
          description: Database backup configuration updated
        '401':
          $ref: '#/components/responses/401'
        '400':
          $ref: '#/components/responses/400'
        '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
              - environment_name
              - environment_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
              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
              - environment_name
              - environment_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
              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
              - environment_name
              - environment_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
              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)
      description: Create a new Redis database.
      operationId: create-database-redis
      requestBody:
        description: Database data
        required: true
        content:
          application/json:
            schema:
              required:
              - server_uuid
              - project_uuid
              - environment_name
              - environment_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
                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
              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:
              -

# --- truncated at 32 KB (68 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/coolify/refs/heads/main/openapi/coolify-databases-api-openapi.yml