Dokploy postgres API

The postgres API from Dokploy — 16 operation(s) for postgres.

OpenAPI Specification

dokploy-postgres-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Dokploy admin postgres API
  description: Complete API documentation for Dokploy - Deploy applications, manage databases, and orchestrate your infrastructure. This API allows you to programmatically manage all aspects of your Dokploy instance.
  version: 1.0.0
  contact:
    name: Dokploy Team
    url: https://dokploy.com
  license:
    name: Apache 2.0
    url: https://github.com/dokploy/dokploy/blob/canary/LICENSE
servers:
- url: https://your-dokploy-instance.com/api
security:
- apiKey: []
tags:
- name: postgres
paths:
  /postgres.create:
    post:
      operationId: postgres-create
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                appName:
                  type: string
                  minLength: 1
                  maxLength: 63
                  pattern: ^[a-zA-Z0-9._-]+$
                databaseName:
                  type: string
                  minLength: 1
                databaseUser:
                  type: string
                  minLength: 1
                databasePassword:
                  type: string
                  pattern: ^[a-zA-Z0-9@#%^&*()_+\-=[\]{}|;:,.<>?~`]*$
                dockerImage:
                  default: postgres:18
                  type: string
                environmentId:
                  type: string
                description:
                  anyOf:
                  - type: string
                  - type: 'null'
                serverId:
                  anyOf:
                  - type: string
                  - type: 'null'
              required:
              - name
              - databaseName
              - databaseUser
              - databasePassword
              - environmentId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.one:
    get:
      operationId: postgres-one
      tags:
      - postgres
      security:
      - Authorization: []
      parameters:
      - in: query
        name: postgresId
        schema:
          type: string
          minLength: 1
        required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.start:
    post:
      operationId: postgres-start
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                  minLength: 1
              required:
              - postgresId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.stop:
    post:
      operationId: postgres-stop
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                  minLength: 1
              required:
              - postgresId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.saveExternalPort:
    post:
      operationId: postgres-saveExternalPort
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                externalPort:
                  anyOf:
                  - type: number
                  - type: 'null'
              required:
              - postgresId
              - externalPort
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.deploy:
    post:
      operationId: postgres-deploy
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
              required:
              - postgresId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.changeStatus:
    post:
      operationId: postgres-changeStatus
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                applicationStatus:
                  type: string
                  enum:
                  - idle
                  - running
                  - done
                  - error
              required:
              - postgresId
              - applicationStatus
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.remove:
    post:
      operationId: postgres-remove
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                  minLength: 1
              required:
              - postgresId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.saveEnvironment:
    post:
      operationId: postgres-saveEnvironment
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                env:
                  anyOf:
                  - type: string
                  - type: 'null'
              required:
              - postgresId
              - env
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.reload:
    post:
      operationId: postgres-reload
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                appName:
                  type: string
                  minLength: 1
                  maxLength: 63
                  pattern: ^[a-zA-Z0-9._-]+$
              required:
              - postgresId
              - appName
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.update:
    post:
      operationId: postgres-update
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                  minLength: 1
                name:
                  type: string
                  minLength: 1
                appName:
                  type: string
                  minLength: 1
                  maxLength: 63
                  pattern: ^[a-zA-Z0-9._-]+$
                databaseName:
                  type: string
                  minLength: 1
                databaseUser:
                  type: string
                  minLength: 1
                databasePassword:
                  type: string
                  pattern: ^[a-zA-Z0-9@#%^&*()_+\-=[\]{}|;:,.<>?~`]*$
                description:
                  anyOf:
                  - type: string
                  - type: 'null'
                dockerImage:
                  type: string
                command:
                  anyOf:
                  - type: string
                  - type: 'null'
                args:
                  anyOf:
                  - type: array
                    items:
                      type: string
                  - type: 'null'
                env:
                  anyOf:
                  - type: string
                  - type: 'null'
                memoryReservation:
                  anyOf:
                  - type: string
                  - type: 'null'
                externalPort:
                  anyOf:
                  - type: number
                  - type: 'null'
                memoryLimit:
                  anyOf:
                  - type: string
                  - type: 'null'
                cpuReservation:
                  anyOf:
                  - type: string
                  - type: 'null'
                cpuLimit:
                  anyOf:
                  - type: string
                  - type: 'null'
                applicationStatus:
                  type: string
                  enum:
                  - idle
                  - running
                  - done
                  - error
                healthCheckSwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      properties:
                        Test:
                          type: array
                          items:
                            type: string
                        Interval:
                          type: number
                        Timeout:
                          type: number
                        StartPeriod:
                          type: number
                        Retries:
                          type: number
                      additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                restartPolicySwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      properties:
                        Condition:
                          type: string
                        Delay:
                          type: number
                        MaxAttempts:
                          type: number
                        Window:
                          type: number
                      additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                placementSwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      properties:
                        Constraints:
                          type: array
                          items:
                            type: string
                        Preferences:
                          type: array
                          items:
                            type: object
                            properties:
                              Spread:
                                type: object
                                properties:
                                  SpreadDescriptor:
                                    type: string
                                required:
                                - SpreadDescriptor
                            required:
                            - Spread
                            additionalProperties: false
                        MaxReplicas:
                          type: number
                        Platforms:
                          type: array
                          items:
                            type: object
                            properties:
                              Architecture:
                                type: string
                              OS:
                                type: string
                            required:
                            - Architecture
                            - OS
                            additionalProperties: false
                      additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                updateConfigSwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      properties:
                        Parallelism:
                          type: number
                        Delay:
                          type: number
                        FailureAction:
                          type: string
                        Monitor:
                          type: number
                        MaxFailureRatio:
                          type: number
                        Order:
                          type: string
                      required:
                      - Parallelism
                      - Order
                      additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                rollbackConfigSwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      properties:
                        Parallelism:
                          type: number
                        Delay:
                          type: number
                        FailureAction:
                          type: string
                        Monitor:
                          type: number
                        MaxFailureRatio:
                          type: number
                        Order:
                          type: string
                      required:
                      - Parallelism
                      - Order
                      additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                modeSwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      properties:
                        Replicated:
                          type: object
                          properties:
                            Replicas:
                              type: number
                          additionalProperties: false
                        Global:
                          type: object
                          properties: {}
                        ReplicatedJob:
                          type: object
                          properties:
                            MaxConcurrent:
                              type: number
                            TotalCompletions:
                              type: number
                          additionalProperties: false
                        GlobalJob:
                          type: object
                          properties: {}
                      additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                labelsSwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      propertyNames:
                        type: string
                      additionalProperties:
                        type: string
                    - type: 'null'
                  - type: 'null'
                networkSwarm:
                  anyOf:
                  - anyOf:
                    - type: array
                      items:
                        type: object
                        properties:
                          Target:
                            type: string
                          Aliases:
                            type: array
                            items:
                              type: string
                          DriverOpts:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type: string
                        additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                stopGracePeriodSwarm:
                  anyOf:
                  - anyOf:
                    - type: number
                    - type: 'null'
                  - type: 'null'
                endpointSpecSwarm:
                  anyOf:
                  - anyOf:
                    - type: object
                      properties:
                        Mode:
                          type: string
                        Ports:
                          type: array
                          items:
                            type: object
                            properties:
                              Protocol:
                                type: string
                              TargetPort:
                                type: number
                              PublishedPort:
                                type: number
                              PublishMode:
                                type: string
                            additionalProperties: false
                      additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                ulimitsSwarm:
                  anyOf:
                  - anyOf:
                    - type: array
                      items:
                        type: object
                        properties:
                          Name:
                            type: string
                            minLength: 1
                          Soft:
                            type: integer
                            minimum: -1
                            maximum: 9007199254740991
                          Hard:
                            type: integer
                            minimum: -1
                            maximum: 9007199254740991
                        required:
                        - Name
                        - Soft
                        - Hard
                        additionalProperties: false
                    - type: 'null'
                  - type: 'null'
                replicas:
                  type: number
                createdAt:
                  type: string
                environmentId:
                  type: string
              required:
              - postgresId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.changePassword:
    post:
      operationId: postgres-changePassword
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                  minLength: 1
                password:
                  type: string
                  minLength: 1
                  pattern: ^[a-zA-Z0-9@#%^&*()_+\-=[\]{}|;:,.<>?~`]*$
              required:
              - postgresId
              - password
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
  /postgres.move:
    post:
      operationId: postgres-move
      tags:
      - postgres
      security:
      - Authorization: []
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                postgresId:
                  type: string
                targetEnvironmentId:
                  type: string
              required:
              - postgresId
              - targetEnvironmentId
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties: {}
                additionalProperties: false
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '401':
          description: Authorization not provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
        '403':
          description: Insufficient access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.FORBIDDEN'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas

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