openapi: 3.0.3
info:
  title: 'FlashPanel API Documentation'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://flashpanel.io'
tags:
  -
    name: Applications
    description: "\nAPIs for managing server applications (PHP, MySQL, Nginx, etc.)"
  -
    name: Authentication
    description: "\nAPIs for user authentication and token management"
  -
    name: Backups
    description: "\nAPIs for managing server backup configurations"
  -
    name: Commands
    description: "\nAPIs for executing and viewing site commands"
  -
    name: 'DNS & Bind9'
    description: "\nAPIs for managing Bind9 DNS zones"
  -
    name: 'Database Users'
    description: "\nAPIs for managing database users on servers"
  -
    name: Databases
    description: "\nAPIs for managing databases on servers"
  -
    name: Deployments
    description: "\nAPIs for managing site deployments and deployment scripts"
  -
    name: Docker
    description: "\nAPIs for managing Docker images"
  -
    name: 'File Management'
    description: "\nAPIs for managing files and directories on the server via agent"
  -
    name: 'Firewall & Security'
    description: "\nAPIs for managing Fail2ban jails"
  -
    name: 'Firewall Rules'
    description: "\nAPIs for managing server firewall rules (UFW)"
  -
    name: 'Linux Users'
    description: "\nAPIs for managing Linux system users on servers"
  -
    name: 'Load Balancing'
    description: "\nAPIs for managing site load balancing"
  -
    name: 'Mail Server'
    description: "\nAPIs for managing mail server domains"
  -
    name: 'N8N Automation'
    description: "\nAPIs for managing N8N automation sites"
  -
    name: Notifications
    description: "\nAPIs for managing site notifications"
  -
    name: OpenLiteSpeed
    description: "\nAPIs for managing OpenLiteSpeed and LSPHP configurations"
  -
    name: 'PHP Settings'
    description: "\nAPIs for managing PHP OPcache settings"
  -
    name: PhpMyAdmin
    description: "\nAPIs for managing PhpMyAdmin sites"
  -
    name: 'SSH & Keys'
    description: "\nAPIs for managing SSH keys on Git providers"
  -
    name: 'SSH Configuration'
    description: "\nAPIs for managing SSH daemon configuration"
  -
    name: 'SSH Keys'
    description: "\nAPIs for managing SSH keys on servers"
  -
    name: 'SSL Certificates'
    description: "\nAPIs for managing SSL certificates on sites"
  -
    name: 'Schedules & Cron'
    description: "\nAPIs for managing server cron jobs and scheduled tasks"
  -
    name: 'Server Agent'
    description: "\nAPIs for managing server agent installation and communication"
  -
    name: 'Server Management'
    description: "\nAPIs for managing VPS servers"
  -
    name: 'Server Settings'
    description: "\nAPIs for managing server timezone"
  -
    name: 'Server Transfer'
    description: "\nAPIs for managing server ownership transfers"
  -
    name: Services
    description: "\nAPIs for managing custom systemd services on servers"
  -
    name: 'Services & Daemons'
    description: "\nAPIs for managing systemd service actions (start/stop/restart/enable/disable)"
  -
    name: 'Site Management'
    description: "\nAPIs for managing websites/sites on servers"
  -
    name: 'Site Settings'
    description: "\nAPIs for updating site Git repository"
  -
    name: Supervisor
    description: "\nAPIs for managing Supervisor process manager configurations"
  -
    name: 'WireGuard VPN'
    description: "\nAPIs for managing WireGuard VPN clients"
  -
    name: WordPress
    description: "\nAPIs for managing WordPress auto login feature"
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: 'You can retrieve your token by <a href="#authentication-POSTapi-token">follow API token</a>.'
security:
  -
    default: []
paths:
  /api/servers/applications:
    get:
      summary: 'List applications.'
      operationId: listApplications
      description: 'Get available and installed applications for a server.'
      parameters:
        -
          in: query
          name: extension
          description: 'Filter by extension group (php-extension, ols-extension).'
          example: php-extension
          required: false
          schema:
            type: string
            description: 'Filter by extension group (php-extension, ols-extension).'
            example: php-extension
        -
          in: query
          name: binary_name
          description: 'Required with extension. Base binary name.'
          example: php8.3
          required: false
          schema:
            type: string
            description: 'Required with extension. Base binary name.'
            example: php8.3
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: 'PHP 8.3'
                      binary_name: php8.3
                      installed: true
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'PHP 8.3'
                        binary_name: php8.3
                        installed: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'PHP 8.3'
                        binary_name:
                          type: string
                          example: php8.3
                        installed:
                          type: boolean
                          example: true
      tags:
        - Applications
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                extension:
                  type: string
                  description: 'The string must be at least 1 character.'
                  example: bngzmiyvdljnikhw
                  nullable: true
                binary_name:
                  type: string
                  description: 'The string must be at least 1 character.'
                  example: aykcmyuwpwlvqwrs
                os_version:
                  type: number
                  description: ''
                  example: 4326.41688
                  nullable: true
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/applications/{application}/start':
    post:
      summary: 'Start application.'
      operationId: startApplication
      description: 'Start the application on the given server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Applications
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: application
        description: 'The application ID.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/servers/{server}/applications/{application}/stop':
    post:
      summary: 'Stop application.'
      operationId: stopApplication
      description: 'Stop the application on the given server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Applications
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: application
        description: 'The application ID.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/servers/{server}/applications/{application}/restart':
    post:
      summary: 'Restart application.'
      operationId: restartApplication
      description: 'Restart the application on the given server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Applications
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: application
        description: 'The application ID.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/servers/{server}/applications/{application}/auto-restart':
    post:
      summary: 'Toggle auto restart.'
      operationId: toggleAutoRestart
      description: 'Enable or disable automatic restart monitoring for an application.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        422:
          description: not_supported
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'This application does not support auto restart feature'
                properties:
                  message:
                    type: string
                    example: 'This application does not support auto restart feature'
      tags:
        - Applications
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
                  description: 'Enable auto restart.'
                  example: true
              required:
                - enabled
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: application
        description: 'The application ID.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/servers/{server}/applications/{application}/ols-admin-update':
    post:
      summary: 'Update OLS admin.'
      operationId: updateOLSAdmin
      description: 'Update OpenLiteSpeed admin username and password.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        404:
          description: not_ols
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Not Found'
                properties:
                  message:
                    type: string
                    example: 'Not Found'
      tags:
        - Applications
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                admin_username:
                  type: string
                  description: 'Admin username.'
                  example: admin
                admin_password:
                  type: string
                  description: 'Admin password (min 6 chars).'
                  example: AdminP@ss123
              required:
                - admin_username
                - admin_password
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: application
        description: 'The application ID.'
        example: 5
        required: true
        schema:
          type: integer
  '/api/servers/{server}/applications':
    get:
      summary: 'List applications.'
      operationId: listApplications
      description: 'Get available and installed applications for a server.'
      parameters:
        -
          in: query
          name: extension
          description: 'Filter by extension group (php-extension, ols-extension).'
          example: php-extension
          required: false
          schema:
            type: string
            description: 'Filter by extension group (php-extension, ols-extension).'
            example: php-extension
        -
          in: query
          name: binary_name
          description: 'Required with extension. Base binary name.'
          example: php8.3
          required: false
          schema:
            type: string
            description: 'Required with extension. Base binary name.'
            example: php8.3
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: 'PHP 8.3'
                      binary_name: php8.3
                      installed: true
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'PHP 8.3'
                        binary_name: php8.3
                        installed: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'PHP 8.3'
                        binary_name:
                          type: string
                          example: php8.3
                        installed:
                          type: boolean
                          example: true
      tags:
        - Applications
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                extension:
                  type: string
                  description: 'The string must be at least 1 character.'
                  example: bngzmiyvdljnikhw
                  nullable: true
                binary_name:
                  type: string
                  description: 'The string must be at least 1 character.'
                  example: aykcmyuwpwlvqwrs
                os_version:
                  type: number
                  description: ''
                  example: 4326.41688
                  nullable: true
    post:
      summary: 'Install application.'
      operationId: installApplication
      description: 'Install an application on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Applications
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: 'Application version.'
                  example: '8.3'
                app_id:
                  type: integer
                  description: 'Application ID.'
                  example: 4432
                password:
                  type: string
                  description: 'Master key/password for MeiliSearch, Typesense, PostgreSQL, MinIO.'
                  example: SecureP@ss
                port:
                  type: integer
                  description: 'Port for MeiliSearch (7700), Typesense (8108).'
                  example: 7700
                admin_username:
                  type: string
                  description: 'Admin username for OpenLiteSpeed.'
                  example: admin
                admin_password:
                  type: string
                  description: 'Admin password for OpenLiteSpeed, Apache Tomcat.'
                  example: AdminP@ss
                manager_password:
                  type: string
                  description: 'Manager password for Apache Tomcat.'
                  example: ManagerP@ss
                user:
                  type: string
                  description: 'Username for MinIO admin.'
                  example: minioadmin
              required:
                - version
                - app_id
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/applications/{application}':
    put:
      summary: 'Update application.'
      operationId: updateApplication
      description: 'Update an installed application to the latest version.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        400:
          description: no_update
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'This app does not need to be updated'
                properties:
                  message:
                    type: string
                    example: 'This app does not need to be updated'
      tags:
        - Applications
    delete:
      summary: 'Uninstall application.'
      operationId: uninstallApplication
      description: 'Uninstall an application from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        422:
          description: cannot_remove
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'This app cannot be uninstalled'
                properties:
                  message:
                    type: string
                    example: 'This app cannot be uninstalled'
      tags:
        - Applications
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: application
        description: 'The application ID.'
        example: 5
        required: true
        schema:
          type: integer
  /api/token:
    post:
      summary: 'Get API token.'
      operationId: getAPIToken
      description: "Retrieves an access token and a code for the user.\nAutomatically deletes old tokens, keeping only the 10 most recent tokens."
      parameters: []
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  token: 123|xxxxxx
                  code: yyyyyy
                properties:
                  token:
                    type: string
                    example: 123|xxxxxx
                  code:
                    type: string
                    example: yyyyyy
        422:
          description: 'Validation error'
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'The provided credentials are incorrect.'
                  errors:
                    email:
                      - 'The provided credentials are incorrect.'
                properties:
                  message:
                    type: string
                    example: 'The provided credentials are incorrect.'
                  errors:
                    type: object
                    properties:
                      email:
                        type: array
                        example:
                          - 'The provided credentials are incorrect.'
                        items:
                          type: string
      tags:
        - Authentication
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'The email of the user.'
                  example: user@example.com
                password:
                  type: string
                  description: 'The password of the user.'
                  example: Pa$$w0rd!
                code:
                  type: string
                  description: 'The 6-digit code generated by the 2FA app if the user has 2FA enabled.'
                  example: '123456'
                  nullable: true
                device_name:
                  type: string
                  description: 'The name of the device. Defaults to "".'
                  example: 'My Device'
                  nullable: true
              required:
                - email
                - password
      security: []
  '/api/servers/{server}/backups/{backup}':
    get:
      summary: 'Get backup configuration information.'
      operationId: getBackupConfigurationInformation
      description: "This function retrieves the backup configuration information for a specific backup\nof a server. The function requires a backup token to be provided in the request\nquery parameters."
      parameters: []
      responses:
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Invalid Token'
                properties:
                  message:
                    type: string
                    example: 'Invalid Token'
      tags:
        - Backups
      security: []
    put:
      summary: 'Update backup configuration.'
      operationId: updateBackupConfiguration
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  backup:
                    id: 1
                    memo: 'Daily backup'
                    is_active: true
                  event:
                    id: 1
                    status: running
                properties:
                  backup:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      memo:
                        type: string
                        example: 'Daily backup'
                      is_active:
                        type: boolean
                        example: true
                  event:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
      tags:
        - Backups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                is_active:
                  type: boolean
                  description: 'Enable or disable backup configuration.'
                  example: true
                memo:
                  type: string
                  description: 'Configuration name.'
                  example: 'Daily backup'
                expression:
                  type: string
                  description: 'Cron expression for schedule.'
                  example: '0 0 * * *'
                cycle:
                  type: integer
                  description: 'Retention days for old backups (min 2).'
                  example: 7
                all_sites:
                  type: boolean
                  description: 'Backup all sites.'
                  example: true
                excludes:
                  type: array
                  description: 'Directories to exclude from all sites.'
                  example:
                    - architecto
                  items:
                    type: string
                'excludes[]':
                  type: string
                  description: 'Exclude pattern.'
                  example: node_modules
                sites:
                  type: array
                  description: 'Sites to backup (when all_sites=false).'
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: 'The site ID to backup.'
                        example: 1
                      excludes:
                        type: array
                        description: 'Directories to exclude for this site.'
                        example:
                          - architecto
                        items:
                          type: string
                      'excludes[]':
                        type: string
                        description: 'Exclude pattern.'
                        example: node_modules
                    required:
                      - id
                all_databases:
                  type: boolean
                  description: 'Backup all databases.'
                  example: true
                databases:
                  type: array
                  description: 'Database IDs to backup (when all_databases=false).'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
              required:
                - is_active
                - memo
                - expression
                - cycle
                - all_sites
                - all_databases
    delete:
      summary: 'Delete backup configuration'
      operationId: deleteBackupConfiguration
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Backups
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: backup
        description: 'The backup.'
        example: 101002
        required: true
        schema:
          type: integer
  '/api/servers/{server}/backups/{backup}/script':
    get:
      summary: 'Download backup script'
      operationId: downloadBackupScript
      description: ''
      parameters: []
      responses:
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Invalid Token'
                properties:
                  message:
                    type: string
                    example: 'Invalid Token'
      tags:
        - Backups
      security: []
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: backup
        description: 'The backup.'
        example: 101002
        required: true
        schema:
          type: integer
  '/api/servers/{server}/backups/{backup}/info':
    get:
      summary: 'Get backup info'
      operationId: getBackupInfo
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Backups
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: backup
        description: 'The backup.'
        example: 101002
        required: true
        schema:
          type: integer
  '/api/servers/{server}/backups/{backup}/restore':
    post:
      summary: 'Restore selected backup file'
      operationId: restoreSelectedBackupFile
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Backups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_path:
                  type: string
                  description: ''
                  example: architecto
                restore_type:
                  type: string
                  description: ''
                  example: database
                  enum:
                    - website
                    - database
                site_id:
                  type: number
                  description: ''
                  example: 4326.41688
                  nullable: true
                database_id:
                  type: number
                  description: ''
                  example: 4326.41688
                  nullable: true
              required:
                - file_path
                - restore_type
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: backup
        description: 'The backup.'
        example: 101002
        required: true
        schema:
          type: integer
  '/api/servers/{server}/backups/{backup}/clone':
    post:
      summary: 'Clone Backup Configuration'
      operationId: cloneBackupConfiguration
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Backups
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                servers:
                  type: array
                  description: ''
                  example:
                    - 16
                  items:
                    type: integer
                all_sites:
                  type: boolean
                  description: ''
                  example: false
                all_databases:
                  type: boolean
                  description: ''
                  example: false
              required:
                - servers
                - all_sites
                - all_databases
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: backup
        description: 'The backup.'
        example: 101002
        required: true
        schema:
          type: integer
  '/api/servers/{server}/backups':
    get:
      summary: 'List backup configurations.'
      operationId: listBackupConfigurations
      description: 'Get all backup configurations for a server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      memo: 'Daily backup'
                      drive: drive
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        memo: 'Daily backup'
                        drive: drive
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        memo:
                          type: string
                          example: 'Daily backup'
                        drive:
                          type: string
                          example: drive
      tags:
        - Backups
    post:
      summary: 'Create backup configuration.'
      operationId: createBackupConfiguration
      description: 'Create a new backup configuration for a server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  backup:
                    id: 1
                    memo: 'Daily backup'
                  event:
                    id: 1
                    status: running
                properties:
                  backup:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      memo:
                        type: string
                        example: 'Daily backup'
                  event:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
      tags:
        - Backups
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: 'OAuth access token for cloud drives.'
                  example: oauth_code_123
                  nullable: true
                drive:
                  type: string
                  description: 'Storage drive: drive, onedrive, dropbox, sftp, ftp, s3.'
                  example: drive
                host:
                  type: string
                  description: 'SFTP/FTP host address.'
                  example: backup.example.com
                  nullable: true
                user:
                  type: string
                  description: 'SFTP/FTP username.'
                  example: backupuser
                  nullable: true
                port:
                  type: integer
                  description: 'SFTP/FTP port.'
                  example: 22
                  nullable: true
                auth_password:
                  type: boolean
                  description: 'Use password auth for SFTP.'
                  example: true
                  nullable: true
                password:
                  type: string
                  description: 'SFTP/FTP password.'
                  example: secretpass
                private_key:
                  type: string
                  format: binary
                  description: 'SFTP private key file.'
                passphrase:
                  type: string
                  description: 'SFTP private key passphrase.'
                  example: myPassphrase
                s3_bucket_name:
                  type: string
                  description: 'S3 bucket name.'
                  example: my-backups
                  nullable: true
                s3_provider:
                  type: string
                  description: 'S3 provider: s3 or Other.'
                  example: s3
                  nullable: true
                s3_access_key_id:
                  type: string
                  description: 'S3 access key.'
                  example: AKIAIOSFODNN7EXAMPLE
                  nullable: true
                s3_secret_access_key:
                  type: string
                  description: 'S3 secret key.'
                  example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
                  nullable: true
                s3_region:
                  type: string
                  description: 'S3 region.'
                  example: us-east-1
                  nullable: true
                s3_endpoint:
                  type: string
                  description: 'Custom S3 endpoint URL.'
                  example: 'https://s3.us-west-2.amazonaws.com'
                  nullable: true
                memo:
                  type: string
                  description: 'Configuration name.'
                  example: 'Daily backup'
                expression:
                  type: string
                  description: 'Cron expression for schedule.'
                  example: '0 0 * * *'
                cycle:
                  type: integer
                  description: 'Retention days for old backups (min 2).'
                  example: 7
                all_sites:
                  type: boolean
                  description: 'Backup all sites.'
                  example: true
                sites:
                  type: array
                  description: 'Sites to backup (when all_sites=false).'
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        description: 'The site ID to backup.'
                        example: 1
                      excludes:
                        type: array
                        description: 'Directories to exclude for this site.'
                        example:
                          - architecto
                        items:
                          type: string
                      'excludes[]':
                        type: string
                        description: 'Exclude pattern.'
                        example: node_modules
                    required:
                      - id
                excludes:
                  type: array
                  description: 'Directories to exclude from all sites.'
                  example:
                    - architecto
                  items:
                    type: string
                'excludes[]':
                  type: string
                  description: 'Exclude pattern.'
                  example: node_modules
                all_databases:
                  type: boolean
                  description: 'Backup all databases.'
                  example: true
                databases:
                  type: array
                  description: 'Database IDs to backup (when all_databases=false).'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
              required:
                - drive
                - memo
                - expression
                - cycle
                - all_sites
                - all_databases
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/backup-histories':
    get:
      summary: 'List backup history.'
      operationId: listBackupHistory
      description: 'Retrieve the backup history for a server.'
      parameters:
        -
          in: query
          name: sort
          description: 'Sort field. Default: -id.'
          example: '-id'
          required: false
          schema:
            type: string
            description: 'Sort field. Default: -id.'
            example: '-id'
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: backup-2024-01-01
                      size: '1.5 GB'
                      time: '120'
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: backup-2024-01-01
                        size: '1.5 GB'
                        time: '120'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: backup-2024-01-01
                        size:
                          type: string
                          example: '1.5 GB'
                        time:
                          type: string
                          example: '120'
      tags:
        - Backups
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/commands':
    get:
      summary: 'List commands.'
      operationId: listCommands
      description: 'Retrieves a paginated list of commands executed on a given site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      script: 'ls -la'
                      output: ...
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        script: 'ls -la'
                        output: ...
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        script:
                          type: string
                          example: 'ls -la'
                        output:
                          type: string
                          example: ...
      tags:
        - Commands
    post:
      summary: 'Execute command.'
      operationId: executeCommand
      description: 'Store and execute a new command for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    script: 'ls -la'
                    status: running
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      script:
                        type: string
                        example: 'ls -la'
                      status:
                        type: string
                        example: running
      tags:
        - Commands
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                script:
                  type: string
                  description: 'The shell script to execute.'
                  example: 'ls -la'
              required:
                - script
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/bind9/zones/{zone}/import':
    post:
      summary: 'Import DNS zone.'
      operationId: importDNSZone
      description: 'Import DNS records from a zone file.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'DNS & Bind9'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: 'Zone file to import (txt format, max 1MB).'
              required:
                - file
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: zone
        description: 'The zone name.'
        example: example.com
        required: true
        schema:
          type: string
  '/api/servers/{server}/bind9/zones/{zone}/export':
    post:
      summary: 'Export DNS zone.'
      operationId: exportDNSZone
      description: 'Export DNS zone to a file on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'DNS & Bind9'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: zone
        description: 'The zone name.'
        example: example.com
        required: true
        schema:
          type: string
  '/api/servers/{server}/bind9/zones/{zone}/download':
    get:
      summary: 'Download DNS zone file.'
      operationId: downloadDNSZoneFile
      description: 'Download the exported DNS zone file.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'file The zone file content.'
      tags:
        - 'DNS & Bind9'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: zone
        description: 'The zone name.'
        example: example.com
        required: true
        schema:
          type: string
  '/api/servers/{server}/bind9/zones':
    get:
      summary: 'List DNS zones.'
      operationId: listDNSZones
      description: 'Get all DNS zones configured on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'DNS & Bind9'
    post:
      summary: 'Create zone'
      operationId: createZone
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'DNS & Bind9'
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/bind9/zones/{zone}':
    put:
      summary: 'Update zone'
      operationId: updateZone
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'DNS & Bind9'
    delete:
      summary: 'Delete zone'
      operationId: deleteZone
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'DNS & Bind9'
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: zone
        description: 'The zone.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/servers/{server}/bind9/zones/{zone}/records':
    get:
      summary: 'List DNS records.'
      operationId: listDNSRecords
      description: 'Get all DNS records for a specific zone.'
      parameters:
        -
          in: query
          name: search
          description: 'Search query.'
          example: www
          required: false
          schema:
            type: string
            description: 'Search query.'
            example: www
        -
          in: query
          name: match
          description: 'Search match type: any, all.'
          example: any
          required: false
          schema:
            type: string
            description: 'Search match type: any, all.'
            example: any
        -
          in: query
          name: per_page
          description: 'Items per page.'
          example: 50
          required: false
          schema:
            type: integer
            description: 'Items per page.'
            example: 50
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      type: A
                      name: www
                      content: 192.168.1.1
                      ttl: 3600
                properties:
                  data:
                    type: array
                    example:
                      -
                        type: A
                        name: www
                        content: 192.168.1.1
                        ttl: 3600
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          example: A
                        name:
                          type: string
                          example: www
                        content:
                          type: string
                          example: 192.168.1.1
                        ttl:
                          type: integer
                          example: 3600
      tags:
        - 'DNS & Bind9'
    post:
      summary: 'Create DNS record.'
      operationId: createDNSRecord
      description: 'Create a new DNS record in the zone.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'DNS & Bind9'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Record type: A, AAAA, CNAME, MX, TXT, etc.'
                  example: A
                name:
                  type: string
                  description: 'Record name.'
                  example: www
                content:
                  type: string
                  description: 'Record value.'
                  example: 192.168.1.1
                ttl:
                  type: integer
                  description: 'TTL in seconds.'
                  example: 3600
                priority:
                  type: integer
                  description: 'Priority (for MX records).'
                  example: 10
              required:
                - type
                - name
                - content
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: zone
        description: 'The zone name.'
        example: example.com
        required: true
        schema:
          type: string
  '/api/servers/{server}/bind9/zones/{zone}/records/{record}':
    put:
      summary: 'Update DNS record.'
      operationId: updateDNSRecord
      description: 'Update an existing DNS record in the zone.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'DNS & Bind9'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Record type.'
                  example: A
                name:
                  type: string
                  description: 'Record name.'
                  example: www
                content:
                  type: string
                  description: 'Record value.'
                  example: 192.168.1.2
                ttl:
                  type: integer
                  description: 'TTL in seconds.'
                  example: 7200
                priority:
                  type: integer
                  description: 'Priority (for MX records).'
                  example: 10
              required:
                - type
                - name
                - content
    delete:
      summary: 'Delete DNS record.'
      operationId: deleteDNSRecord
      description: 'Delete a DNS record from the zone.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'DNS & Bind9'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: zone
        description: 'The zone name.'
        example: example.com
        required: true
        schema:
          type: string
      -
        in: path
        name: record
        description: 'Record ID.'
        example: www.example.com._A
        required: true
        schema:
          type: string
  '/api/servers/{server}/database-users/sync':
    get:
      summary: 'Sync database users.'
      operationId: syncDatabaseUsers
      description: 'Synchronize database users with the actual database server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Database Users'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Database type: mysql, postgresql, mongodb.'
                  example: mysql
              required:
                - type
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/database-users':
    get:
      summary: 'List database users.'
      operationId: listDatabaseUsers
      description: 'Get all database users on a server with their associated databases.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: dbuser
                      type: mysql
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: dbuser
                        type: mysql
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: dbuser
                        type:
                          type: string
                          example: mysql
      tags:
        - 'Database Users'
    post:
      summary: 'Create database user.'
      operationId: createDatabaseUser
      description: 'Create a new database user on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Database Users'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Database type: mysql, postgresql, mongodb.'
                  example: mysql
                name:
                  type: string
                  description: 'Username (alphanumeric, max 32 chars).'
                  example: myuser
                password:
                  type: string
                  description: 'User password.'
                  example: SecureP@ss123
                databases:
                  type: array
                  description: 'Database IDs to grant access.'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
                roles:
                  type: array
                  description: ''
                  example: null
                  items:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: integer
                        description: ''
                        example: 16
                      roles:
                        type: array
                        description: 'The string must be at least 1 character.'
                        example:
                          - ngzmiyvdljnikhwa
                        items:
                          type: string
                    required:
                      - roles
                access_anywhere:
                  type: boolean
                  description: 'Allow connections from any host.'
                  example: false
                identified_with:
                  type: string
                  description: 'MySQL auth plugin: mysql_native_password, caching_sha2_password.'
                  example: mysql_native_password
                  nullable: true
              required:
                - type
                - name
                - password
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/database-users/{database_user}':
    put:
      summary: 'Update database user.'
      operationId: updateDatabaseUser
      description: "Update a database user's password, access permissions, or database grants."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Database Users'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Database type: mysql, postgresql, mongodb.'
                  example: mysql
                password:
                  type: string
                  description: 'New password for the user.'
                  example: NewP@ss123
                  nullable: true
                databases:
                  type: array
                  description: 'Database IDs to grant access (for mysql/postgresql).'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
                roles:
                  type: array
                  description: 'MongoDB roles configuration (for mongodb).'
                  example:
                    - []
                  items:
                    type: object
                    nullable: true
                    properties:
                      id:
                        type: integer
                        description: 'Database ID for the role.'
                        example: 1
                      roles:
                        type: array
                        description: 'Role names for this database.'
                        example:
                          - architecto
                        items:
                          type: string
                      'roles[]':
                        type: string
                        description: 'Role name.'
                        example: readWrite
                access_anywhere:
                  type: boolean
                  description: 'Allow connections from any host.'
                  example: false
                  nullable: true
                identified_with:
                  type: string
                  description: 'MySQL auth plugin: mysql_native_password, caching_sha2_password.'
                  example: mysql_native_password
                  nullable: true
              required:
                - type
    delete:
      summary: 'Delete database user.'
      operationId: deleteDatabaseUser
      description: 'Delete a database user from the server. Cannot delete users linked to PHPMyAdmin, WordPress, or other application sites.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        400:
          description: linked_to_site
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Cannot delete database user linked to site'
                properties:
                  message:
                    type: string
                    example: 'Cannot delete database user linked to site'
      tags:
        - 'Database Users'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: database_user
        description: 'The database user ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/databases/{database}/export':
    post:
      summary: 'Export database.'
      operationId: exportDatabase
      description: 'Export a database to a backup file on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Databases
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: database
        description: 'The database ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/databases/{database}/import':
    post:
      summary: 'Import database.'
      operationId: importDatabase
      description: 'Import data into a database from a file on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        400:
          description: system_database
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Cannot import system database'
                properties:
                  message:
                    type: string
                    example: 'Cannot import system database'
      tags:
        - Databases
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Path to the import file. Supported formats: .sql, .sql.gz, .zip (MongoDB requires .zip).'
                  example: /home/flashvps/backup.sql.gz
                remove:
                  type: boolean
                  description: 'Remove the import file after successful import.'
                  example: false
                  nullable: true
              required:
                - path
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: database
        description: 'The database ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/databases/{database}/download':
    post:
      summary: 'Download database backup.'
      operationId: downloadDatabaseBackup
      description: 'Download the exported database backup file.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'file The gzipped database backup file.'
        404:
          description: not_found
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'File not found'
                properties:
                  message:
                    type: string
                    example: 'File not found'
      tags:
        - Databases
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: database
        description: 'The database ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/databases':
    get:
      summary: 'List databases.'
      operationId: listDatabases
      description: 'Get all databases on a server with their associated users.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: mydb
                      type: mysql
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: mydb
                        type: mysql
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: mydb
                        type:
                          type: string
                          example: mysql
      tags:
        - Databases
    post:
      summary: 'Create database.'
      operationId: createDatabase
      description: 'Create a new database on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Databases
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Database type: mysql, postgresql, mongodb.'
                  example: mysql
                name:
                  type: string
                  description: 'Database name (alphanumeric and dashes).'
                  example: mydb
                users:
                  type: array
                  description: 'Database user IDs to grant access.'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
              required:
                - type
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/databases/{database}':
    put:
      summary: 'Update database.'
      operationId: updateDatabase
      description: 'Update database user access permissions.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Databases
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Database type: mysql, postgresql.'
                  example: mysql
                users:
                  type: array
                  description: 'Database user IDs to grant access.'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
                    nullable: true
              required:
                - type
    delete:
      summary: 'Delete database.'
      operationId: deleteDatabase
      description: 'Delete a database from the server. Cannot delete system databases or databases used by PHPMyAdmin sites.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Databases
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: database
        description: 'The database ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mysql':
    get:
      summary: 'Get MySQL config.'
      operationId: getMySQLConfig
      description: 'Retrieve MySQL/MariaDB configuration with current values from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    key:
                      type: string
                      example: max_connections
                    value:
                      type: string
                      example: '151'
                    type:
                      type: string
                      example: number
                example:
                  -
                    key: max_connections
                    value: '151'
                    type: number
      tags:
        - Databases
    post:
      summary: 'Update MySQL config.'
      operationId: updateMySQLConfig
      description: 'Update MySQL/MariaDB configuration on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Databases
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/deploys':
    get:
      summary: 'List deployments.'
      operationId: listDeployments
      description: 'Retrieves a paginated collection of deployments for a given site.'
      parameters:
        -
          in: query
          name: page
          description: 'Page number. Default: 1.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'Page number. Default: 1.'
            example: 1
        -
          in: query
          name: per_page
          description: 'Items per page. Default: 10.'
          example: 15
          required: false
          schema:
            type: integer
            description: 'Items per page. Default: 10.'
            example: 15
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      status: success
                      created_at: '2024-01-01T00:00:00Z'
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        status: success
                        created_at: '2024-01-01T00:00:00Z'
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        status:
                          type: string
                          example: success
                        created_at:
                          type: string
                          example: '2024-01-01T00:00:00Z'
      tags:
        - Deployments
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/deploys/variables':
    get:
      summary: 'Get deployment variables.'
      operationId: getDeploymentVariables
      description: 'Retrieves the list of available deployment script variables.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  SITE_NAME: example.com
                  SITE_PATH: /home/user/example.com
                properties:
                  SITE_NAME:
                    type: string
                    example: example.com
                  SITE_PATH:
                    type: string
                    example: /home/user/example.com
      tags:
        - Deployments
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/deploys/script':
    put:
      summary: 'Update deployment script.'
      operationId: updateDeploymentScript
      description: 'Updates the deployment script for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: example.com
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: example.com
      tags:
        - Deployments
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                script:
                  type: string
                  description: 'The deployment script content.'
                  example: 'cd $SITE_PATH && git pull'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/deploys/now':
    post:
      summary: 'Deploy now.'
      operationId: deployNow
      description: 'Deploy the latest source code. The system will run the deployment script.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  deployment:
                    id: 1
                    status: running
                  event:
                    id: 1
                    status: running
                properties:
                  deployment:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
                  event:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
      tags:
        - Deployments
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/deploys/refresh-token':
    put:
      summary: 'Refresh deployment token.'
      operationId: refreshDeploymentToken
      description: 'Refreshes the deployment webhook token for the site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  link: 'https://example.com/deploy?token=...'
                properties:
                  link:
                    type: string
                    example: 'https://example.com/deploy?token=...'
      tags:
        - Deployments
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/deploys/auto':
    put:
      summary: 'Toggle auto-deploy.'
      operationId: toggleAutoDeploy
      description: 'Enables or disables automatic deployment for the site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: example.com
                    autodeploy_enabled: true
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: example.com
                      autodeploy_enabled:
                        type: boolean
                        example: true
      tags:
        - Deployments
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/deploys/key':
    post:
      summary: 'Create deploy key.'
      operationId: createDeployKey
      description: "Automatically generates a new RSA private key and adds it to the site's server."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: example.com
                    attrs:
                      deploy_key: 'ssh-rsa AAAA...'
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: example.com
                      attrs:
                        type: object
                        properties:
                          deploy_key:
                            type: string
                            example: 'ssh-rsa AAAA...'
      tags:
        - Deployments
    delete:
      summary: 'Delete deploy key.'
      operationId: deleteDeployKey
      description: 'Deletes the deploy key for a given site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: example.com
                    attrs:
                      deploy_key: ''
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: example.com
                      attrs:
                        type: object
                        properties:
                          deploy_key:
                            type: string
                            example: ''
      tags:
        - Deployments
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/docker/images/prune':
    post:
      summary: 'Prune Docker images.'
      operationId: pruneDockerImages
      description: 'Remove all unused Docker images from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/docker/images':
    get:
      summary: 'List Docker images.'
      operationId: listDockerImages
      description: 'Get all Docker images on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/docker/images/{image}':
    delete:
      summary: 'Delete Docker image.'
      operationId: deleteDockerImage
      description: 'Remove a Docker image from the server.'
      parameters:
        -
          in: query
          name: force
          description: 'Force remove even if in use.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'Force remove even if in use.'
            example: true
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: image
        description: 'Image ID or name.'
        example: 'nginx:latest'
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers/{container}/start':
    post:
      summary: 'Start container.'
      operationId: startContainer
      description: 'Start a stopped or paused Docker container.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                Status:
                  type: integer
                  description: 'Container status (2=paused, will unpause).'
                  example: 0
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers/{container}/stop':
    post:
      summary: 'Stop container.'
      operationId: stopContainer
      description: 'Stop a running Docker container.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers/{container}/restart':
    post:
      summary: 'Restart container.'
      operationId: restartContainer
      description: 'Restart a Docker container.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers/{container}/pause':
    post:
      summary: 'Pause container.'
      operationId: pauseContainer
      description: 'Pause a running Docker container.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers/{container}/rename':
    post:
      summary: 'Rename container.'
      operationId: renameContainer
      description: 'Rename a Docker container.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'New container name.'
                  example: mycontainer_new
              required:
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers/{container}/logs':
    post:
      summary: 'Get container logs.'
      operationId: getContainerLogs
      description: 'Get the last 100 lines of container logs.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: string
                example: 'Log output text...'
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers/{container}/stats':
    get:
      summary: 'Get container stats.'
      operationId: getContainerStats
      description: 'Get real-time resource usage statistics for a container.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  CPUPerc: 0.50%
                  MemUsage: '100MiB / 1GiB'
                  NetIO: '1kB / 2kB'
                properties:
                  CPUPerc:
                    type: string
                    example: 0.50%
                  MemUsage:
                    type: string
                    example: '100MiB / 1GiB'
                  NetIO:
                    type: string
                    example: '1kB / 2kB'
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/containers':
    get:
      summary: 'List containers.'
      operationId: listContainers
      description: 'Get all Docker containers on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    ID:
                      type: string
                      example: abc123
                    Names:
                      type: string
                      example: mycontainer
                    Image:
                      type: string
                      example: nginx
                    State:
                      type: string
                      example: running
                example:
                  -
                    ID: abc123
                    Names: mycontainer
                    Image: nginx
                    State: running
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/docker/containers/{container}':
    get:
      summary: 'Get container details.'
      operationId: getContainerDetails
      description: 'Get detailed information about a Docker container.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  Id: abc123
                  Name: mycontainer
                  State:
                    Status: running
                properties:
                  Id:
                    type: string
                    example: abc123
                  Name:
                    type: string
                    example: mycontainer
                  State:
                    type: object
                    properties:
                      Status:
                        type: string
                        example: running
      tags:
        - Docker
    delete:
      summary: 'Delete container.'
      operationId: deleteContainer
      description: 'Stop and remove a Docker container.'
      parameters:
        -
          in: query
          name: force
          description: 'Force remove even if running.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'Force remove even if running.'
            example: true
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: container
        description: 'Container ID or name.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/volumes/{volume}/clone':
    post:
      summary: 'Clone Docker volume.'
      operationId: cloneDockerVolume
      description: 'Create a copy of a Docker volume with a new name.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'New volume name.'
                  example: mydata_backup
              required:
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: volume
        description: 'Source volume name.'
        example: mydata
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/volumes/prune':
    post:
      summary: 'Prune Docker volumes.'
      operationId: pruneDockerVolumes
      description: 'Remove all unused Docker volumes from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/docker/volumes':
    get:
      summary: 'List Docker volumes.'
      operationId: listDockerVolumes
      description: 'Get all Docker volumes on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/docker/volumes/{volume}':
    delete:
      summary: 'Delete Docker volume.'
      operationId: deleteDockerVolume
      description: 'Remove a Docker volume from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: volume
        description: 'Volume name.'
        example: mydata
        required: true
        schema:
          type: string
  '/api/servers/{server}/docker/networks/prune':
    post:
      summary: 'Prune Docker networks.'
      operationId: pruneDockerNetworks
      description: 'Remove all unused Docker networks from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/docker/networks':
    get:
      summary: 'List Docker networks.'
      operationId: listDockerNetworks
      description: 'Get all Docker networks on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Docker
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/systeminfo':
    get:
      summary: 'Get system info.'
      operationId: getSystemInfo
      description: 'Get server system information (CPU, memory, disk, etc.) via agent.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  cpu:
                    cores: 4
                    usage: 15.5
                  memory:
                    total: 8192
                    used: 4096
                  disk:
                    total: 100
                    used: 45
                properties:
                  cpu:
                    type: object
                    properties:
                      cores:
                        type: integer
                        example: 4
                      usage:
                        type: number
                        example: 15.5
                  memory:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 8192
                      used:
                        type: integer
                        example: 4096
                  disk:
                    type: object
                    properties:
                      total:
                        type: integer
                        example: 100
                      used:
                        type: integer
                        example: 45
      tags:
        - 'File Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/list':
    post:
      summary: 'List files.'
      operationId: listFiles
      description: 'List files and directories in a given path.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
              required:
                - path
                - root
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/mkdir':
    post:
      summary: 'Create new directory'
      operationId: createNewDirectory
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                name:
                  type: string
                  description: ''
                  example: architecto
              required:
                - path
                - root
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/save':
    post:
      summary: 'Save file content'
      operationId: saveFileContent
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                new:
                  type: string
                  description: ''
                  example: 'false'
                  enum:
                    - 'true'
                    - 'false'
                file:
                  type: string
                  format: binary
                  description: 'Must be a file.'
              required:
                - root
                - new
                - file
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/delete':
    delete:
      summary: 'Delete file or directory'
      operationId: deleteFileOrDirectory
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: array
                  description: 'Must start with one of <code>/</code>.'
                  example:
                    - /bngz
                  items:
                    type: string
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
              required:
                - path
                - root
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/view':
    get:
      summary: 'View file content'
      operationId: viewFileContent
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                limit:
                  type: integer
                  description: 'Must be at least 1. Must not be greater than 10000.'
                  example: 17
                  nullable: true
              required:
                - root
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/rename':
    put:
      summary: 'Rename file or directory'
      operationId: renameFileOrDirectory
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                name:
                  type: string
                  description: ''
                  example: architecto
              required:
                - path
                - root
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/compress':
    post:
      summary: 'Compress files/directories'
      operationId: compressFilesdirectories
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: array
                  description: 'Must start with one of <code>/</code>.'
                  example:
                    - /bngz
                  items:
                    type: string
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                level:
                  type: integer
                  description: 'Must be at least 1.'
                  example: 27
                  nullable: true
                type:
                  type: string
                  description: ''
                  example: tar.gz
                  enum:
                    - zip
                    - tar
                    - tar.gz
                name:
                  type: string
                  description: ''
                  example: architecto
              required:
                - root
                - type
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/decompress':
    post:
      summary: 'Decompress archive'
      operationId: decompressArchive
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                here:
                  type: boolean
                  description: ''
                  example: true
              required:
                - path
                - root
                - here
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/copy':
    post:
      summary: 'Copy file or directory'
      operationId: copyFileOrDirectory
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                destination:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
              required:
                - path
                - root
                - destination
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/move':
    post:
      summary: 'Move file or directory'
      operationId: moveFileOrDirectory
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                destination:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
              required:
                - path
                - root
                - destination
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/chmod':
    post:
      summary: 'Change file permissions'
      operationId: changeFilePermissions
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                mode:
                  type: string
                  description: ''
                  example: architecto
              required:
                - path
                - root
                - mode
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/files/chown':
    post:
      summary: 'Change file owner'
      operationId: changeFileOwner
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'File Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                path:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                root:
                  type: string
                  description: 'Must start with one of <code>/</code>.'
                  example: /bngz
                owner:
                  type: string
                  description: ''
                  example: architecto
                group:
                  type: string
                  description: ''
                  example: architecto
              required:
                - path
                - root
                - owner
                - group
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/sites/{site}/tiny-file-manager':
    delete:
      summary: 'Remove Tiny File Manager.'
      operationId: removeTinyFileManager
      description: 'Delete the Tiny File Manager from a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'File Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/fail2ban/unbanip':
    post:
      summary: 'Unban IP addresses.'
      operationId: unbanIPAddresses
      description: 'Unban one or more IP addresses from a Fail2ban jail.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Firewall & Security'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jail:
                  type: string
                  description: 'Jail name.'
                  example: sshd
                all:
                  type: boolean
                  description: 'Unban all IPs.'
                  example: false
                  nullable: true
                ips:
                  type: array
                  description: 'IP addresses to unban.'
                  example:
                    - 192.168.1.100
                  items:
                    type: string
              required:
                - jail
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/fail2ban/enable':
    post:
      summary: 'Enable or disable jail.'
      operationId: enableOrDisableJail
      description: 'Enable or disable a Fail2ban jail.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Firewall & Security'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: 'Jail config file path.'
                  example: /etc/fail2ban/jail.d/sshd.conf
                jail:
                  type: string
                  description: 'Jail name.'
                  example: sshd
                enable:
                  type: boolean
                  description: 'Enable or disable.'
                  example: true
              required:
                - file
                - jail
                - enable
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/fail2ban/info':
    post:
      summary: 'Get Fail2ban info.'
      operationId: getFail2banInfo
      description: 'Get available filters and actions for Fail2ban configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  filters:
                    - sshd
                    - nginx-http-auth
                  actions:
                    - iptables-multiport
                    - firewallcmd-ipset
                properties:
                  filters:
                    type: array
                    example:
                      - sshd
                      - nginx-http-auth
                    items:
                      type: string
                  actions:
                    type: array
                    example:
                      - iptables-multiport
                      - firewallcmd-ipset
                    items:
                      type: string
      tags:
        - 'Firewall & Security'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/fail2ban/jail':
    get:
      summary: 'List Fail2ban jails.'
      operationId: listFail2banJails
      description: 'Get all configured Fail2ban jails on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      name: sshd
                      enabled: true
                      banned_ip_list: []
                properties:
                  data:
                    type: array
                    example:
                      -
                        name: sshd
                        enabled: true
                        banned_ip_list: []
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: sshd
                        enabled:
                          type: boolean
                          example: true
                        banned_ip_list:
                          type: array
                          example: []
      tags:
        - 'Firewall & Security'
    post:
      summary: 'Create or update jail.'
      operationId: createOrUpdateJail
      description: 'Create or update a Fail2ban jail configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Firewall & Security'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file:
                  type: string
                  description: 'Jail config file path.'
                  example: /etc/fail2ban/jail.d/sshd.conf
                name:
                  type: string
                  description: 'Jail name.'
                  example: sshd
                enabled:
                  type: boolean
                  description: 'Enable jail.'
                  example: true
                filter:
                  type: string
                  description: 'Filter name.'
                  example: sshd
                  nullable: true
                action:
                  type: string
                  description: 'Action to take.'
                  example: iptables-multiport
                  nullable: true
                port:
                  type: string
                  description: 'Port(s) to protect.'
                  example: ssh
                  nullable: true
                protocol:
                  type: string
                  description: 'Protocol (tcp/udp).'
                  example: tcp
                  nullable: true
                ignoreip:
                  type: array
                  description: 'IPs to whitelist.'
                  example:
                    - 127.0.0.1
                  items:
                    type: string
                logpath:
                  type: string
                  description: 'Log file path.'
                  example: /var/log/auth.log
                  nullable: true
                banaction:
                  type: string
                  description: 'Ban action.'
                  example: iptables-multiport
                  nullable: true
                backend:
                  type: string
                  description: 'Backend (auto/systemd).'
                  example: systemd
                  nullable: true
                maxretry:
                  type: string
                  description: 'Max retries before ban.'
                  example: '5'
                  nullable: true
                findtime:
                  type: string
                  description: 'Time window for retries.'
                  example: 10m
                  nullable: true
                bantime:
                  type: string
                  description: 'Ban duration.'
                  example: 1h
                  nullable: true
              required:
                - file
                - name
                - enabled
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/fail2ban/jail/{jail}':
    delete:
      summary: 'Delete jail.'
      operationId: deleteJail
      description: 'Delete a Fail2ban jail configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Firewall & Security'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: jail
        description: 'Jail name.'
        example: sshd
        required: true
        schema:
          type: string
  '/api/sites/{site}/8gfirewall':
    post:
      summary: 'Enable 8G Firewall.'
      operationId: enable8GFirewall
      description: 'Enable 8G Firewall protection for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        400:
          description: not_supported
          content:
            application/json:
              schema:
                type: object
                example:
                  message: '8G Firewall is only supported for Nginx and Apache'
                properties:
                  message:
                    type: string
                    example: '8G Firewall is only supported for Nginx and Apache'
      tags:
        - 'Firewall & Security'
    delete:
      summary: 'Disable 8G Firewall.'
      operationId: disable8GFirewall
      description: 'Disable 8G Firewall protection for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        400:
          description: not_supported
          content:
            application/json:
              schema:
                type: object
                example:
                  message: '8G Firewall is only supported for Nginx and Apache'
                properties:
                  message:
                    type: string
                    example: '8G Firewall is only supported for Nginx and Apache'
      tags:
        - 'Firewall & Security'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/rules/sync':
    get:
      summary: 'Sync firewall rules.'
      operationId: syncFirewallRules
      description: 'Synchronize firewall rules with the actual server UFW configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Firewall Rules'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/rules':
    get:
      summary: 'List firewall rules.'
      operationId: listFirewallRules
      description: 'Get all firewall rules configured on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      port: '80'
                      type: allow
                      protocol: tcp
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        port: '80'
                        type: allow
                        protocol: tcp
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        port:
                          type: string
                          example: '80'
                        type:
                          type: string
                          example: allow
                        protocol:
                          type: string
                          example: tcp
      tags:
        - 'Firewall Rules'
    post:
      summary: 'Create firewall rule.'
      operationId: createFirewallRule
      description: 'Create a new firewall rule on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  firewall_rule:
                    id: 1
                    port: '80'
                  event:
                    id: 1
                    status: running
                properties:
                  firewall_rule:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      port:
                        type: string
                        example: '80'
                  event:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
      tags:
        - 'Firewall Rules'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Rule description.'
                  example: 'Allow HTTP'
                  nullable: true
                port:
                  type: string
                  description: 'Port or port range (e.g., 80, 8000:9000).'
                  example: '80'
                protocol:
                  type: string
                  description: 'Protocol: tcp, udp.'
                  example: tcp
                  nullable: true
                type:
                  type: string
                  description: 'Rule type: allow, deny.'
                  example: allow
                ip_address:
                  type: string
                  description: 'Limit to specific IP.'
                  example: 192.168.1.0/24
                  nullable: true
              required:
                - port
                - type
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/rules/{rule}':
    delete:
      summary: 'Delete firewall rule.'
      operationId: deleteFirewallRule
      description: 'Remove a firewall rule from the server. Cannot delete SSH port rules.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Firewall Rules'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: rule
        description: 'The firewall rule ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/users/sync':
    get:
      summary: 'Sync Linux users.'
      operationId: syncLinuxUsers
      description: 'Synchronize Linux system users from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Linux Users'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/users':
    get:
      summary: 'List Linux users.'
      operationId: listLinuxUsers
      description: 'Get all Linux system users on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: webuser
                      can_ssh: true
                      can_ftp: false
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: webuser
                        can_ssh: true
                        can_ftp: false
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: webuser
                        can_ssh:
                          type: boolean
                          example: true
                        can_ftp:
                          type: boolean
                          example: false
      tags:
        - 'Linux Users'
    post:
      summary: 'Create Linux user.'
      operationId: createLinuxUser
      description: 'Create a new Linux system user on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Linux Users'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Username (alphanumeric, max 32 chars).'
                  example: webuser
                password:
                  type: string
                  description: 'User password (min 6 chars).'
                  example: SecureP@ss
                can_ssh:
                  type: boolean
                  description: 'Allow SSH access.'
                  example: true
                can_ftp:
                  type: boolean
                  description: 'Allow FTP access.'
                  example: false
                block_soft_limit:
                  type: string
                  description: 'Disk quota soft limit (e.g., 1G).'
                  example: 1G
                  nullable: true
                block_hard_limit:
                  type: string
                  description: 'Disk quota hard limit (e.g., 2G).'
                  example: 2G
                  nullable: true
                inode_soft_limit:
                  type: integer
                  description: 'Inode soft limit.'
                  example: 100000
                  nullable: true
                inode_hard_limit:
                  type: integer
                  description: 'Inode hard limit.'
                  example: 150000
                  nullable: true
              required:
                - name
                - password
                - can_ssh
                - can_ftp
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/users/{user}':
    put:
      summary: 'Update Linux user.'
      operationId: updateLinuxUser
      description: "Update a Linux user's permissions and quotas."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Linux Users'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: 'New password (min 6 chars).'
                  example: NewP@ss123
                  nullable: true
                can_ssh:
                  type: boolean
                  description: 'Allow SSH access.'
                  example: true
                can_ftp:
                  type: boolean
                  description: 'Allow FTP access.'
                  example: false
                block_soft_limit:
                  type: string
                  description: 'Disk quota soft limit (e.g., 1G).'
                  example: 1G
                  nullable: true
                block_hard_limit:
                  type: string
                  description: 'Disk quota hard limit (e.g., 2G).'
                  example: 2G
                  nullable: true
                inode_soft_limit:
                  type: integer
                  description: 'Inode soft limit.'
                  example: 100000
                  nullable: true
                inode_hard_limit:
                  type: integer
                  description: 'Inode hard limit.'
                  example: 150000
                  nullable: true
              required:
                - can_ssh
                - can_ftp
    delete:
      summary: 'Delete Linux user.'
      operationId: deleteLinuxUser
      description: 'Delete a Linux system user from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Linux Users'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: user
        description: 'The Linux user ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/balancing/enable':
    post:
      summary: 'Enable load balancing.'
      operationId: enableLoadBalancing
      description: 'Enable load balancing for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        400:
          description: no_servers
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'There is no load balancer server'
                properties:
                  message:
                    type: string
                    example: 'There is no load balancer server'
      tags:
        - 'Load Balancing'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/balancing/disable':
    post:
      summary: 'Disable load balancing.'
      operationId: disableLoadBalancing
      description: 'Disable load balancing for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Load Balancing'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/balancing':
    post:
      summary: 'Configure load balancing.'
      operationId: configureLoadBalancing
      description: 'Store load balancing configuration for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: example.com
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: example.com
      tags:
        - 'Load Balancing'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                method:
                  type: string
                  description: 'Load balancing method: round_robin, ip_hash, least_conn.'
                  example: round_robin
                servers:
                  type: array
                  description: 'Backend server list.'
                  example:
                    - []
                  items:
                    type: object
                    nullable: true
                    properties:
                      ip:
                        type: string
                        description: 'Backend server IP.'
                        example: 192.168.1.10
                      port:
                        type: integer
                        description: 'Backend server port.'
                        example: 80
                      weight:
                        type: integer
                        description: 'Server weight.'
                        example: 1
                        nullable: true
                      backup:
                        type: boolean
                        description: 'Mark as backup server.'
                        example: false
                        nullable: true
                      down:
                        type: boolean
                        description: 'Mark as down.'
                        example: false
                        nullable: true
                    required:
                      - ip
                      - port
              required:
                - method
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mail/domains/{domain}/check':
    post:
      summary: 'Check DNS records.'
      operationId: checkDNSRecords
      description: 'Check and validate DNS records for the mail domain (A, MX, DKIM, DMARC, SPF).'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Mail Server'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: domain
        description: 'The mail domain ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mail/domains/{domain}/ssl':
    post:
      summary: 'Install SSL for mail domain.'
      operationId: installSSLForMailDomain
      description: "Install SSL certificate for the mail server using the domain's certificate."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: domain
        description: 'The mail domain ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mail/domains/{domain}/default':
    post:
      summary: 'Set default domain.'
      operationId: setDefaultDomain
      description: 'Set a mail domain as the default mail domain.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: domain
        description: 'The mail domain ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mail/domains':
    get:
      summary: 'List mail domains.'
      operationId: listMailDomains
      description: 'Get all mail domains configured on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      domain: example.com
                      is_default: true
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        domain: example.com
                        is_default: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        domain:
                          type: string
                          example: example.com
                        is_default:
                          type: boolean
                          example: true
      tags:
        - 'Mail Server'
    post:
      summary: 'Create mail domain.'
      operationId: createMailDomain
      description: 'Create a new mail domain on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                domain:
                  type: string
                  description: 'The domain name.'
                  example: example.com
                subdomain:
                  type: string
                  description: 'The subdomain name.'
                  example: mail
              required:
                - domain
                - subdomain
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mail/domains/{domain}':
    delete:
      summary: 'Delete mail domain.'
      operationId: deleteMailDomain
      description: 'Delete a mail domain from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: domain
        description: 'The mail domain ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mail/accounts':
    get:
      summary: 'List mail accounts.'
      operationId: listMailAccounts
      description: 'Get all mail accounts on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  accounts:
                    -
                      email: user@example.com
                      quota: 1024
                properties:
                  accounts:
                    type: array
                    example:
                      -
                        email: user@example.com
                        quota: 1024
                    items:
                      type: object
                      properties:
                        email:
                          type: string
                          example: user@example.com
                        quota:
                          type: integer
                          example: 1024
      tags:
        - 'Mail Server'
    post:
      summary: 'Create mail account.'
      operationId: createMailAccount
      description: 'Create a new mail account on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'Email address.'
                  example: user@example.com
                password:
                  type: string
                  description: 'Password (min 6 chars).'
                  example: SecureP@ss
                catch_all:
                  type: boolean
                  description: 'Set as catch-all for domain.'
                  example: false
                  nullable: true
                quota:
                  type: string
                  description: 'Mailbox quota (e.g., 100M, 1G).'
                  example: 100M
                  nullable: true
                aliases:
                  type: array
                  description: 'Email aliases.'
                  example:
                    - alias@example.com
                  items:
                    type: string
              required:
                - email
                - password
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/mail/accounts/{account}':
    put:
      summary: 'Update mail account.'
      operationId: updateMailAccount
      description: 'Update an existing mail account.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: 'New password (min 6 chars).'
                  example: NewP@ssword
                  nullable: true
                catch_all:
                  type: boolean
                  description: 'Set as catch-all for domain.'
                  example: false
                  nullable: true
                quota:
                  type: string
                  description: 'Mailbox quota (e.g., 100M, 1G).'
                  example: 200M
                  nullable: true
                aliases:
                  type: array
                  description: 'Email aliases.'
                  example:
                    - alias@example.com
                  items:
                    type: string
                    nullable: true
    delete:
      summary: 'Delete mail account or alias.'
      operationId: deleteMailAccountOrAlias
      description: 'Delete a mail account or remove an alias from an account.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'Email address to delete.'
                  example: user@example.com
                alias:
                  type: string
                  description: 'Specific alias to remove (optional).'
                  example: alias@example.com
                  nullable: true
              required:
                - email
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: account
        description: 'The account.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: email
        description: 'Email address.'
        example: user@example.com
        required: true
        schema:
          type: string
  '/api/servers/{server}/mail/settings':
    get:
      summary: 'Get mail settings.'
      operationId: getMailSettings
      description: 'Retrieve current mail server settings.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  ENABLE_POP3: true
                  ENABLE_MANAGESIEVE: false
                  ENABLE_FAIL2BAN: true
                  POSTFIX_MESSAGE_SIZE_LIMIT: 10
                properties:
                  ENABLE_POP3:
                    type: boolean
                    example: true
                  ENABLE_MANAGESIEVE:
                    type: boolean
                    example: false
                  ENABLE_FAIL2BAN:
                    type: boolean
                    example: true
                  POSTFIX_MESSAGE_SIZE_LIMIT:
                    type: integer
                    example: 10
      tags:
        - 'Mail Server'
    post:
      summary: 'Update mail settings.'
      operationId: updateMailSettings
      description: 'Update mail server settings.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Mail Server'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                ENABLE_POP3:
                  type: boolean
                  description: 'Enable POP3 protocol.'
                  example: true
                  nullable: true
                ENABLE_MANAGESIEVE:
                  type: boolean
                  description: 'Enable ManageSieve for mail filtering.'
                  example: false
                  nullable: true
                ENABLE_FAIL2BAN:
                  type: boolean
                  description: 'Enable Fail2ban protection.'
                  example: true
                  nullable: true
                POSTFIX_MESSAGE_SIZE_LIMIT:
                  type: number
                  description: 'Maximum message size in MB.'
                  example: 25.0
                  nullable: true
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/restart':
    post:
      summary: 'Restart N8N.'
      operationId: restartN8N
      description: 'Restart the N8N service.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/upgrade':
    post:
      summary: 'Upgrade N8N.'
      operationId: upgradeN8N
      description: 'Upgrade N8N to the latest version.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/user-reset':
    post:
      summary: 'Reset user management.'
      operationId: resetUserManagement
      description: 'Reset user management back to pre-setup state.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/license-clear':
    post:
      summary: 'Clear license.'
      operationId: clearLicense
      description: 'Clear the N8N license.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/ldap-reset':
    post:
      summary: 'Reset LDAP.'
      operationId: resetLDAP
      description: 'Reset the LDAP connection.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                option:
                  type: string
                  description: 'Reset option: userId, projectId, or deleteWorkflowsAndCredentials.'
                  example: userId
                value:
                  type: string
                  description: 'The value for the option (required for userId/projectId).'
                  example: user123
                  nullable: true
              required:
                - option
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/mfa-disable':
    post:
      summary: 'Disable MFA.'
      operationId: disableMFA
      description: 'Disable multi-factor authentication for a user.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: 'User email address.'
                  example: user@example.com
              required:
                - email
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/licence-info':
    get:
      summary: 'Get license info.'
      operationId: getLicenseInfo
      description: 'Get N8N license information.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  info: 'License information...'
                properties:
                  info:
                    type: string
                    example: 'License information...'
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/export':
    post:
      summary: 'Export N8N data.'
      operationId: exportN8NData
      description: 'Export N8N workflows and/or credentials.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workflows:
                  type: boolean
                  description: 'Export workflows.'
                  example: true
                credentials:
                  type: boolean
                  description: 'Export credentials.'
                  example: true
              required:
                - workflows
                - credentials
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/download':
    get:
      summary: 'Download backup.'
      operationId: downloadBackup
      description: 'Download the N8N data backup file.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'File download stream'
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/info':
    get:
      summary: 'Get N8N info.'
      operationId: getN8NInfo
      description: 'Get N8N data info including users, projects, workflows and credentials count.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  users: 5
                  projects: 3
                  workflows_count: 10
                  credentials_count: 8
                properties:
                  users:
                    type: integer
                    example: 5
                  projects:
                    type: integer
                    example: 3
                  workflows_count:
                    type: integer
                    example: 10
                  credentials_count:
                    type: integer
                    example: 8
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/workflows/import':
    post:
      summary: 'Import workflow.'
      operationId: importWorkflow
      description: 'Import a workflow into the N8N instance.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: 'JSON or ZIP file to import (max 500KB).'
                path:
                  type: string
                  description: 'File path on server (alternative to file upload).'
                  example: /path/to/workflow.json
                remove:
                  type: boolean
                  description: 'Remove file after import.'
                  example: false
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/workflows/status':
    post:
      summary: 'Bulk activate/deactivate workflows.'
      operationId: bulkActivatedeactivateWorkflows
      description: 'Activate or deactivate all workflows at once.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  description: 'Action: active or inactive.'
                  example: active
              required:
                - action
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/workflows/{workflow}/active':
    post:
      summary: 'Activate workflow.'
      operationId: activateWorkflow
      description: 'Set a workflow to active state.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Workflow name for event description.'
                  example: 'My Workflow'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: workflow
        description: 'The workflow.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: id
        description: 'The workflow ID.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/sites/{site}/n8n/workflows/{workflow}/inactive':
    post:
      summary: 'Deactivate workflow.'
      operationId: deactivateWorkflow
      description: 'Set a workflow to inactive state.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Workflow name for event description.'
                  example: 'My Workflow'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: workflow
        description: 'The workflow.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: id
        description: 'The workflow ID.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/sites/{site}/n8n/workflows/{workflow}/start':
    post:
      summary: 'Execute workflow.'
      operationId: executeWorkflow
      description: 'Execute a workflow immediately.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Workflow name for event description.'
                  example: 'My Workflow'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: workflow
        description: 'The workflow.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: id
        description: 'The workflow ID.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/sites/{site}/n8n/workflows/{workflow}/export':
    post:
      summary: 'Export workflow.'
      operationId: exportWorkflow
      description: 'Export a workflow as JSON file.'
      parameters:
        -
          in: query
          name: name
          description: 'Workflow name for filename.'
          example: 'My Workflow'
          required: false
          schema:
            type: string
            description: 'Workflow name for filename.'
            example: 'My Workflow'
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'File download stream'
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: workflow
        description: 'The workflow.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: id
        description: 'The workflow ID.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/sites/{site}/n8n/workflows':
    get:
      summary: 'List workflows.'
      operationId: listWorkflows
      description: 'Get all N8N workflows for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: '1'
                      name: 'My Workflow'
                      active: true
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: '1'
                        name: 'My Workflow'
                        active: true
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: '1'
                        name:
                          type: string
                          example: 'My Workflow'
                        active:
                          type: boolean
                          example: true
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/credentials/import':
    post:
      summary: 'Import credential.'
      operationId: importCredential
      description: 'Import a credential into the N8N instance.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'N8N Automation'
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: 'JSON or ZIP file to import (max 500KB).'
                path:
                  type: string
                  description: 'File path on server (alternative to file upload).'
                  example: /path/to/credentials.json
                remove:
                  type: boolean
                  description: 'Remove file after import.'
                  example: false
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n/credentials/{credential}/export':
    post:
      summary: 'Export credential.'
      operationId: exportCredential
      description: 'Export a credential as JSON file.'
      parameters:
        -
          in: query
          name: name
          description: 'Credential name for filename.'
          example: 'API Key'
          required: false
          schema:
            type: string
            description: 'Credential name for filename.'
            example: 'API Key'
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'File download stream'
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: credential
        description: 'The credential.'
        example: architecto
        required: true
        schema:
          type: string
      -
        in: path
        name: id
        description: 'The credential ID.'
        example: abc123
        required: true
        schema:
          type: string
  '/api/sites/{site}/n8n/credentials':
    get:
      summary: 'List credentials.'
      operationId: listCredentials
      description: 'Get all N8N credentials for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: '1'
                      name: 'API Key'
                      type: apiKey
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: '1'
                        name: 'API Key'
                        type: apiKey
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: '1'
                        name:
                          type: string
                          example: 'API Key'
                        type:
                          type: string
                          example: apiKey
      tags:
        - 'N8N Automation'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/notifications/telegram/disable':
    post:
      summary: 'Disable Telegram notification.'
      operationId: disableTelegramNotification
      description: 'Disables the Telegram notification for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - Notifications
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/openlitespeed/php.ini':
    get:
      summary: 'Get OpenLiteSpeed PHP.ini config.'
      operationId: getOpenLiteSpeedPHPiniConfig
      description: 'Retrieve PHP.ini configuration for OpenLiteSpeed.'
      parameters:
        -
          in: query
          name: version
          description: 'PHP version.'
          example: php8.3
          required: true
          schema:
            type: string
            description: 'PHP version.'
            example: php8.3
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    key:
                      type: string
                      example: memory_limit
                    value:
                      type: string
                      example: 256M
                example:
                  -
                    key: memory_limit
                    value: 256M
      tags:
        - OpenLiteSpeed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: 'Must start with one of <code>php</code>.'
                  example: phpbngz
              required:
                - version
    post:
      summary: 'Update OpenLiteSpeed PHP.ini config.'
      operationId: updateOpenLiteSpeedPHPiniConfig
      description: 'Update PHP.ini configuration for OpenLiteSpeed.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - OpenLiteSpeed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: 'PHP version.'
                  example: php8.3
              required:
                - version
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/openlitespeed/install':
    post:
      summary: 'Install LSPHP package.'
      operationId: installLSPHPPackage
      description: 'Install OpenLiteSpeed lsphp packages for a PHP version.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - OpenLiteSpeed
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: ''
                  example: architecto
              required:
                - version
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/openlitespeed':
    get:
      summary: 'Get OpenLiteSpeed info.'
      operationId: getOpenLiteSpeedInfo
      description: 'Get supported and installed PHP versions for OpenLiteSpeed.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  support_versions:
                    - php8.3
                    - php8.2
                  installed_versions:
                    - php8.3
                    - null
                properties:
                  support_versions:
                    type: array
                    example:
                      - php8.3
                      - php8.2
                    items:
                      type: string
                  installed_versions:
                    type: array
                    example:
                      - php8.3
                      - null
                    items:
                      type: string
      tags:
        - OpenLiteSpeed
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/settings/php/opcache':
    post:
      summary: 'Enable OPcache.'
      operationId: enableOPcache
      description: 'Enable PHP OPcache for all PHP versions.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
    delete:
      summary: 'Disable OPcache.'
      operationId: disableOPcache
      description: 'Disable PHP OPcache for all PHP versions.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/settings/php/max-upload-size':
    put:
      summary: 'Update max upload size.'
      operationId: updateMaxUploadSize
      description: 'Update the maximum file upload size for all PHP versions.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                max_file_upload_size:
                  type: integer
                  description: 'Max upload size in MB (min 1).'
                  example: 256
              required:
                - max_file_upload_size
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/settings/php/max-execution-time':
    put:
      summary: 'Update max execution time.'
      operationId: updateMaxExecutionTime
      description: 'Update the maximum execution time for all PHP versions.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                max_execution_time:
                  type: integer
                  description: 'Max execution time in seconds (min 1).'
                  example: 300
              required:
                - max_execution_time
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/php/cli':
    put:
      summary: 'Update PHP CLI version.'
      operationId: updatePHPCLIVersion
      description: 'Update the default PHP CLI version for the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: 'PHP version binary name.'
                  example: php8.3
              required:
                - version
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/ioncube/enable':
    post:
      summary: 'Enable IonCube.'
      operationId: enableIonCube
      description: 'Enable IonCube Loader for a PHP version.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: 'PHP version (e.g., php8.2).'
                  example: php8.2
              required:
                - version
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/ioncube/disable':
    post:
      summary: 'Disable IonCube.'
      operationId: disableIonCube
      description: 'Disable IonCube Loader for a PHP version.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: 'PHP version (e.g., php8.2).'
                  example: php8.2
              required:
                - version
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/php/ini':
    get:
      summary: 'Get PHP.ini config.'
      operationId: getPHPiniConfig
      description: 'Retrieve PHP.ini configuration mapped to predefined config template.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'PHP Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: ''
                  example: cli
                  enum:
                    - fpm
                    - cli
                php_version:
                  type: string
                  description: 'Must start with one of <code>php</code>.'
                  example: phpbngz
              required:
                - type
                - php_version
    post:
      summary: 'Update PHP.ini config.'
      operationId: updatePHPiniConfig
      description: 'Update PHP.ini configuration on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'PHP Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Type: fpm or cli.'
                  example: fpm
                php_version:
                  type: string
                  description: 'PHP version.'
                  example: php8.3
              required:
                - type
                - php_version
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/sites/{site}/phpmyadmin/login':
    get:
      summary: 'PhpMyAdmin auto login.'
      operationId: phpMyAdminAutoLogin
      description: "Perform a magic (passwordless) login into the phpMyAdmin site.\n\nThis endpoint allows users to authenticate with a site without using a password\nby generating a secure token and redirecting to the site's authentication page."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - PhpMyAdmin
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/servers/{server}/keys':
    post:
      summary: 'Add SSH key to Git providers.'
      operationId: addSSHKeyToGitProviders
      description: "Add the server's SSH public key to selected Git provider accounts."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
        400:
          description: failed
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Failed to add SSH Key to GitHub'
                properties:
                  message:
                    type: string
                    example: 'Failed to add SSH Key to GitHub'
      tags:
        - 'SSH & Keys'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                providers:
                  type: array
                  description: 'Socialite account IDs (GitHub/GitLab).'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/sshd_config':
    get:
      summary: 'Get SSHD config.'
      operationId: getSSHDConfig
      description: 'Retrieve current SSHD configuration mapped to predefined config template.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - 'SSH Configuration'
    post:
      summary: 'Update SSHD config.'
      operationId: updateSSHDConfig
      description: 'Update SSHD configuration on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'SSH Configuration'
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/ssh-keys':
    get:
      summary: 'List SSH keys.'
      operationId: listSSHKeys
      description: 'Get all SSH keys configured on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: 'My Key'
                      linux_user: root
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'My Key'
                        linux_user: root
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'My Key'
                        linux_user:
                          type: string
                          example: root
      tags:
        - 'SSH Keys'
    post:
      summary: 'Add SSH key.'
      operationId: addSSHKey
      description: 'Add a new SSH key for a Linux user on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: 'My Laptop Key'
                    linux_user: root
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'My Laptop Key'
                      linux_user:
                        type: string
                        example: root
      tags:
        - 'SSH Keys'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Key name for identification.'
                  example: 'My Laptop Key'
                user:
                  type: string
                  description: 'Linux user to add key for.'
                  example: root
                public_key:
                  type: string
                  description: 'SSH public key content.'
                  example: 'ssh-rsa AAAA...'
              required:
                - name
                - user
                - public_key
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/ssh-keys/{ssh_key}':
    delete:
      summary: 'Delete SSH key.'
      operationId: deleteSSHKey
      description: 'Remove an SSH key from a Linux user on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'SSH Keys'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                linux_user:
                  type: string
                  description: 'Linux user the key belongs to.'
                  example: root
              required:
                - linux_user
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: ssh_key
        description: 'The SSH key ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/renew':
    post:
      summary: 'Renew certificate.'
      operationId: renewCertificate
      description: 'Renew an SSL certificate on the site.'
      parameters: []
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'SSL Certificates'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  description: 'Certificate ID to renew.'
                  example: 1
                token:
                  type: string
                  description: ''
                  example: architecto
              required:
                - id
                - token
      security: []
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/free':
    post:
      summary: 'Install free certificate.'
      operationId: installFreeCertificate
      description: "Install a free SSL certificate (Let's Encrypt or ZeroSSL) on the site."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'SSL Certificates'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                client:
                  type: string
                  description: 'Certificate provider: letsencrypt or zerossl.'
                  example: letsencrypt
                auto_active:
                  type: boolean
                  description: 'Automatically activate after install.'
                  example: true
                  nullable: true
                account:
                  type: string
                  description: 'ZeroSSL account (use "default" for system account).'
                  example: default
                  nullable: true
              required:
                - client
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/csr':
    post:
      summary: 'Create Certificate Signing Request'
      operationId: createCertificateSigningRequest
      description: 'Creates a Certificate Signing Request (CSR) to purchase an SSL certificate.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'SSL Certificates'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                city:
                  type: string
                  description: ''
                  example: architecto
                country:
                  type: string
                  description: 'The string must not be greater than 2 characters.'
                  example: ng
                department:
                  type: string
                  description: ''
                  example: architecto
                domain:
                  type: string
                  description: ''
                  example: architecto
                organization:
                  type: string
                  description: ''
                  example: architecto
                state:
                  type: string
                  description: ''
                  example: architecto
              required:
                - city
                - country
                - department
                - domain
                - organization
                - state
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/import':
    post:
      summary: 'Import certificate'
      operationId: importCertificate
      description: 'Imports an existing SSL certificate for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'SSL Certificates'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                certificate_key:
                  type: string
                  description: ''
                  example: architecto
                certificate_cert:
                  type: string
                  description: ''
                  example: architecto
                auto_active:
                  type: boolean
                  description: ''
                  example: false
              required:
                - certificate_key
                - certificate_cert
                - auto_active
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/{certificate}/clone':
    post:
      summary: 'Clone certificate'
      operationId: cloneCertificate
      description: "Clones a certificate from one of the SSL certificates installed\nfor the websites on the servers of your VPS system."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'SSL Certificates'
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
      -
        in: path
        name: certificate
        description: 'The certificate.'
        example: architecto
        required: true
        schema:
          type: string
  '/api/sites/{site}/certificates/{certificate}/install':
    post:
      summary: 'Installs a private key for a CSR.'
      operationId: installsAPrivateKeyForACSR
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'SSL Certificates'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                certificate_cert:
                  type: string
                  description: ''
                  example: architecto
              required:
                - certificate_cert
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
      -
        in: path
        name: certificate
        description: 'The certificate.'
        example: 101126
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/{certificate}/active':
    post:
      summary: 'Activate certificate'
      operationId: activateCertificate
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'SSL Certificates'
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
      -
        in: path
        name: certificate
        description: 'The certificate.'
        example: 101126
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/{certificate}/inactive':
    post:
      summary: 'Deactivate certificate.'
      operationId: deactivateCertificate
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'SSL Certificates'
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
      -
        in: path
        name: certificate
        description: 'The certificate.'
        example: 101126
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates':
    get:
      summary: 'List certificates.'
      operationId: listCertificates
      description: 'Get all SSL certificates installed on a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      domain: example.com
                      is_active: true
                      is_free: true
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        domain: example.com
                        is_active: true
                        is_free: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        domain:
                          type: string
                          example: example.com
                        is_active:
                          type: boolean
                          example: true
                        is_free:
                          type: boolean
                          example: true
      tags:
        - 'SSL Certificates'
    post:
      summary: 'Install new certificate'
      operationId: installNewCertificate
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'SSL Certificates'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                client:
                  type: string
                  description: ''
                  example: architecto
              required:
                - client
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/certificates/{certificate}':
    delete:
      summary: 'Delete certificate.'
      operationId: deleteCertificate
      description: 'Remove an SSL certificate from the site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'SSL Certificates'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: certificate
        description: 'The certificate ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/schedules/{schedule}/script':
    get:
      summary: 'Get schedule script.'
      operationId: getScheduleScript
      description: 'Download the shell script for a system schedule.'
      parameters:
        -
          in: query
          name: token
          description: 'Backup token.'
          example: abc123
          required: true
          schema:
            type: string
            description: 'Backup token.'
            example: abc123
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'Shell script file download'
        400:
          description: not_system
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Only system schedules can access this endpoint'
                properties:
                  message:
                    type: string
                    example: 'Only system schedules can access this endpoint'
      tags:
        - 'Schedules & Cron'
      security: []
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: schedule
        description: 'The schedule ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/schedules':
    get:
      summary: 'List schedules.'
      operationId: listSchedules
      description: 'Retrieve all cron jobs configured on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      command: 'php artisan schedule:run'
                      cron: '* * * * *'
                      user: root
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        command: 'php artisan schedule:run'
                        cron: '* * * * *'
                        user: root
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        command:
                          type: string
                          example: 'php artisan schedule:run'
                        cron:
                          type: string
                          example: '* * * * *'
                        user:
                          type: string
                          example: root
      tags:
        - 'Schedules & Cron'
    post:
      summary: 'Create schedule.'
      operationId: createSchedule
      description: 'Create a new cron job on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  schedule:
                    id: 1
                    command: ...
                  event:
                    id: 1
                    status: running
                properties:
                  schedule:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      command:
                        type: string
                        example: ...
                  event:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
      tags:
        - 'Schedules & Cron'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type: string
                  description: 'Command to execute.'
                  example: 'php /home/user/app/artisan schedule:run'
                user:
                  type: string
                  description: 'Linux user to run the command.'
                  example: root
                cron:
                  type: string
                  description: 'Cron expression.'
                  example: '* * * * *'
                description:
                  type: string
                  description: Description.
                  example: 'Laravel scheduler'
                  nullable: true
              required:
                - command
                - user
                - cron
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/schedules/{schedule}':
    put:
      summary: 'Update schedule.'
      operationId: updateSchedule
      description: 'Update an existing cron job on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  schedule:
                    id: 1
                    command: ...
                  event:
                    id: 1
                    status: running
                properties:
                  schedule:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      command:
                        type: string
                        example: ...
                  event:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
      tags:
        - 'Schedules & Cron'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                command:
                  type: string
                  description: 'Command to execute.'
                  example: 'php /home/user/app/artisan schedule:run'
                user:
                  type: string
                  description: 'Linux user to run the command.'
                  example: root
                cron:
                  type: string
                  description: 'Cron expression.'
                  example: '0 * * * *'
                description:
                  type: string
                  description: Description.
                  example: 'Laravel scheduler'
                  nullable: true
              required:
                - command
                - user
                - cron
    delete:
      summary: 'Delete schedule.'
      operationId: deleteSchedule
      description: 'Delete a cron job from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Schedules & Cron'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: schedule
        description: 'The schedule ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/agent/install':
    post:
      summary: 'Install agent.'
      operationId: installAgent
      description: 'Install or update the FlashPanel agent on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        409:
          description: up_to_date
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Agent is already up to date'
                properties:
                  message:
                    type: string
                    example: 'Agent is already up to date'
      tags:
        - 'Server Agent'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                web:
                  type: boolean
                  description: 'Install via web interface. Default: true.'
                  example: true
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/agent/token':
    post:
      summary: 'Generate agent token.'
      operationId: generateAgentToken
      description: 'Generate a token for connecting with the server agent.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  token: jwt_token
                  direct: direct_token
                  remote: encrypted_key
                properties:
                  token:
                    type: string
                    example: jwt_token
                  direct:
                    type: string
                    example: direct_token
                  remote:
                    type: string
                    example: encrypted_key
      tags:
        - 'Server Agent'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/decrypt':
    get:
      summary: 'Decrypt data.'
      operationId: decryptData
      description: 'Decrypt encrypted data using server token.'
      parameters:
        -
          in: query
          name: token
          description: 'The decrypt token.'
          example: abc123
          required: true
          schema:
            type: string
            description: 'The decrypt token.'
            example: abc123
        -
          in: query
          name: data
          description: 'The encrypted data.'
          example: encrypted-string
          required: true
          schema:
            type: string
            description: 'The encrypted data.'
            example: encrypted-string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  decrypted: data
                properties:
                  decrypted:
                    type: string
                    example: data
      tags:
        - 'Server Management'
      security: []
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  /api/servers:
    get:
      summary: 'List all servers.'
      operationId: listAllServers
      description: 'Get a list of all servers owned by the authenticated user.'
      parameters:
        -
          in: query
          name: search
          description: 'Filter by server name or ID.'
          example: my-server
          required: false
          schema:
            type: string
            description: 'Filter by server name or ID.'
            example: my-server
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: my-server
                      ip: 192.168.1.1
                      status: active
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: my-server
                        ip: 192.168.1.1
                        status: active
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: my-server
                        ip:
                          type: string
                          example: 192.168.1.1
                        status:
                          type: string
                          example: active
      tags:
        - 'Server Management'
    post:
      summary: 'Create a new server.'
      operationId: createANewServer
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Server Management'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                provider:
                  type: string
                  description: 'Server provider: custom, 123HOST, tinohost, vultr, digitalocean, linode, upcloud.'
                  example: custom
                name:
                  type: string
                  description: 'Server name.'
                  example: server01
                custom_script:
                  type: integer
                  description: 'Custom script ID to run after provisioning.'
                  example: 123
                customProvider:
                  type: string
                  description: 'Note: The following parameters apply to <b>Custom</b> servers only.'
                  example: architecto
                ip:
                  type: string
                  description: 'IP address (IPv4 or IPv6).'
                  example: 192.168.1.100
                ssh_port:
                  type: integer
                  description: 'SSH port (1-65535).'
                  example: 22
                auth_password:
                  type: boolean
                  description: 'Use password (true) or SSH key (false) for authentication.'
                  example: true
                ssh_password:
                  type: string
                  description: 'Root password. Required if auth_password=true.'
                  example: RootP@ss123
                ssh_private_key:
                  type: string
                  format: binary
                  description: 'SSH private key file (max 512KB). Required if auth_password=false.'
                ssh_passphrase:
                  type: string
                  description: 'SSH private key passphrase if applicable.'
                  example: KeyP@ss
                notCustomProvider:
                  type: string
                  description: 'Note: The following parameters apply to <b>non-Custom</b> servers only.'
                  example: architecto
                plan:
                  type: string
                  description: 'VPS plan ID.'
                  example: vc2-1c-1gb
                region:
                  type: string
                  description: 'Region ID.'
                  example: sgp
                credential:
                  type: integer
                  description: 'VPS credential ID. Required for providers except partner vps providers.'
                  example: 5
              required:
                - provider
                - name
                - ssh_port
                - auth_password
                - plan
                - region
  '/api/servers/{server}':
    get:
      summary: 'Get server details.'
      operationId: getServerDetails
      description: 'Retrieve detailed information about a specific server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: my-server
                    ip: 192.168.1.1
                    status: active
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: my-server
                      ip:
                        type: string
                        example: 192.168.1.1
                      status:
                        type: string
                        example: active
      tags:
        - 'Server Management'
    delete:
      summary: 'Delete a server.'
      operationId: deleteAServer
      description: 'Remove a server from the system.'
      parameters:
        -
          in: query
          name: provider
          description: 'Also delete server at VPS provider.'
          example: true
          required: false
          schema:
            type: boolean
            description: 'Also delete server at VPS provider.'
            example: true
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/info':
    post:
      summary: 'Get server system information.'
      operationId: getServerSystemInformation
      description: 'Retrieve system information about the server such as CPU, RAM, DISK, CORE, Swap, etc.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/favorite':
    post:
      summary: 'Toggle server favorite.'
      operationId: toggleServerFavorite
      description: 'Toggle the favorite status of a server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/name':
    put:
      summary: 'Change server name.'
      operationId: changeServerName
      description: 'Update the server display name. The system will also change the VPS hostname and label at the VPS provider if applicable.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Server Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Display name of the server.'
                  example: my-new-server
              required:
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/ip':
    put:
      summary: 'Change server IP address.'
      operationId: changeServerIPAddress
      description: 'Update the IP address of a server. This is useful when the VPS IP address has changed.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Server Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ip:
                  type: string
                  description: 'The new IP address (IPv4 or IPv6).'
                  example: 192.168.1.100
              required:
                - ip
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/hotfix':
    post:
      summary: 'Run hotfix.'
      operationId: runHotfix
      description: 'Execute available hotfixes for the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  events: []
                properties:
                  events:
                    type: array
                    example: []
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/sync-backup-configuration':
    post:
      summary: 'Sync backup configuration.'
      operationId: syncBackupConfiguration
      description: 'Synchronize backup scripts with the latest configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/protect':
    post:
      summary: 'Toggle server protection.'
      operationId: toggleServerProtection
      description: 'Enable or disable server protection to prevent accidental deletion.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: my-server
                    protected: true
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: my-server
                      protected:
                        type: boolean
                        example: true
      tags:
        - 'Server Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                protected:
                  type: boolean
                  description: 'Protection status.'
                  example: true
              required:
                - protected
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/tags':
    put:
      summary: 'Update server tags.'
      operationId: updateServerTags
      description: 'Update the tags associated with a server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: my-server
                    tags:
                      - production
                      - web
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: my-server
                      tags:
                        type: array
                        example:
                          - production
                          - web
                        items:
                          type: string
      tags:
        - 'Server Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  type: array
                  description: 'Tags to associate with the server (max 5).'
                  example:
                    - production
                    - web
                  items:
                    type: string
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/clean':
    post:
      summary: 'Clean system.'
      operationId: cleanSystem
      description: 'Clean unnecessary files like system logs and application cache from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  events:
                    -
                      id: 1
                      status: running
                properties:
                  events:
                    type: array
                    example:
                      -
                        id: 1
                        status: running
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        status:
                          type: string
                          example: running
      tags:
        - 'Server Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                schedule:
                  type: string
                  description: 'Cron expression for scheduled cleanup (paid feature).'
                  example: '0 0 * * *'
                  nullable: true
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/action':
    post:
      summary: 'Run server action.'
      operationId: runServerAction
      description: 'Execute a predefined action script on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Server Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  description: 'The action name to execute.'
                  example: restart-nginx
                note:
                  type: string
                  description: 'Description of the action.'
                  example: 'Restarting Nginx'
              required:
                - action
                - note
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/share':
    post:
      summary: 'Share server.'
      operationId: shareServer
      description: 'Share the server access with teams.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Server Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                teams:
                  type: array
                  description: 'Team IDs to share with (empty array to unshare all).'
                  example:
                    - 1
                    - 2
                  items:
                    type: integer
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/grant-root':
    post:
      summary: 'Grant root access.'
      operationId: grantRootAccess
      description: 'Re-grant root access to the server by updating the SSH private key.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Server Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                private_key:
                  type: string
                  description: 'New SSH private key.'
                  example: '-----BEGIN OPENSSH PRIVATE KEY-----\n...'
                password:
                  type: string
                  description: 'Your current account password.'
                  example: MyP@ssw0rd
              required:
                - private_key
                - password
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/restart/normal':
    post:
      summary: 'Restart server.'
      operationId: restartServer
      description: 'Perform a normal (soft) restart on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        400:
          description: too_soon
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'You can only restart the server once every 2 minutes'
                properties:
                  message:
                    type: string
                    example: 'You can only restart the server once every 2 minutes'
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/restart/hard':
    post:
      summary: 'Hard restart server.'
      operationId: hardRestartServer
      description: 'Perform a hard (forced) restart via VPS provider API.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/reinstall':
    post:
      summary: 'Reinstall server.'
      operationId: reinstallServer
      description: 'Reinstall the server OS via VPS provider API.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: 'Web Server 01'
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: 'Web Server 01'
        400:
          description: not_supported
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Reinstall is not supported for this provider'
                properties:
                  message:
                    type: string
                    example: 'Reinstall is not supported for this provider'
      tags:
        - 'Server Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/password':
    put:
      summary: 'Change user password.'
      operationId: changeUserPassword
      description: 'Update the password for a Linux user on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Server Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: string
                  description: 'The Linux username.'
                  example: root
                password:
                  type: string
                  description: 'The new password (min 6 characters).'
                  example: newP@ssw0rd
              required:
                - user
                - password
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/timezone':
    get:
      summary: 'List timezones.'
      operationId: listTimezones
      description: 'Get all available timezone identifiers.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                example:
                  - America/New_York
                  - Asia/Ho_Chi_Minh
                  - Europe/London
      tags:
        - 'Server Settings'
    post:
      summary: 'Update timezone.'
      operationId: updateTimezone
      description: 'Update the server timezone.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Server Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                timezone:
                  type: string
                  description: 'Timezone identifier.'
                  example: Asia/Ho_Chi_Minh
              required:
                - timezone
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/default-page':
    get:
      summary: 'Get default page.'
      operationId: getDefaultPage
      description: 'Get the default page HTML template for new sites.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  default_page: '<html>...</html>'
                properties:
                  default_page:
                    type: string
                    example: '<html>...</html>'
      tags:
        - 'Server Settings'
    post:
      summary: 'Update default page.'
      operationId: updateDefaultPage
      description: 'Update the default page HTML template for new sites.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Server Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                default_page:
                  type: string
                  description: 'HTML template content.'
                  example: '<html><body>Welcome</body></html>'
              required:
                - default_page
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/ports':
    get:
      summary: 'List common ports.'
      operationId: listCommonPorts
      description: 'Get list of common server port configurations.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      example: 1
                    name:
                      type: string
                      example: HTTP
                    port:
                      type: integer
                      example: 80
                example:
                  -
                    id: 1
                    name: HTTP
                    port: 80
                  -
                    id: 2
                    name: HTTPS
                    port: 443
      tags:
        - 'Server Settings'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  /api/servers-transfer:
    get:
      summary: 'List server transfers.'
      operationId: listServerTransfers
      description: 'Get all server transfers (sent and received) for the current user.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      server:
                        id: 1
                        name: 'Web Server'
                      status: pending
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        server:
                          id: 1
                          name: 'Web Server'
                        status: pending
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        server:
                          type: object
                          properties:
                            id:
                              type: integer
                              example: 1
                            name:
                              type: string
                              example: 'Web Server'
                        status:
                          type: string
                          example: pending
      tags:
        - 'Server Transfer'
    post:
      summary: 'Create server transfer.'
      operationId: createServerTransfer
      description: 'Transfer server ownership to another user.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Success
                properties:
                  message:
                    type: string
                    example: Success
        400:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: self_transfer
                    type: object
                    example:
                      message: "You can't transfer server to yourself"
                    properties:
                      message:
                        type: string
                        example: "You can't transfer server to yourself"
                  -
                    description: not_eligible
                    type: object
                    example:
                      message: 'This user is not eligible to receive your server'
                    properties:
                      message:
                        type: string
                        example: 'This user is not eligible to receive your server'
      tags:
        - 'Server Transfer'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                to_id:
                  type: string
                  description: "Receiver's email address."
                  example: receiver@example.com
                server_id:
                  type: integer
                  description: 'Server ID to transfer.'
                  example: 1
              required:
                - to_id
                - server_id
  '/api/servers-transfer/{servers_transfer}':
    put:
      summary: 'Update transfer status.'
      operationId: updateTransferStatus
      description: 'Update the status of a server transfer (approve/reject/cancel).'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Update Success'
                properties:
                  message:
                    type: string
                    example: 'Update Success'
      tags:
        - 'Server Transfer'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  description: 'Status: pending, approved, rejected, cancelled.'
                  example: approved
              required:
                - status
    parameters:
      -
        in: path
        name: servers_transfer
        description: 'The server transfer ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/status':
    post:
      summary: 'Status of a service.'
      operationId: statusOfAService
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Services
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                services:
                  type: array
                  description: ''
                  example:
                    - architecto
                  items:
                    type: string
              required:
                - services
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/sync':
    post:
      summary: 'Synchronizes a VPS service with the server.'
      operationId: synchronizesAVPSServiceWithTheServer
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Services
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Must contain only letters, numbers, dashes and underscores. The string must not be greater than 32 characters.'
                  example: b
              required:
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services':
    get:
      summary: 'List services.'
      operationId: listServices
      description: 'Get all custom systemd services on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: myservice
                      enabled: true
                  infos: {  }
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: myservice
                        enabled: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: myservice
                        enabled:
                          type: boolean
                          example: true
                  infos:
                    type: object
                    properties: {  }
      tags:
        - Services
    post:
      summary: 'Create service.'
      operationId: createService
      description: 'Create a new custom systemd service on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Services
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'Service name.'
                  example: myservice
                unit:
                  type: object
                  description: 'Unit section configuration.'
                  example:
                    Description: 'My Service'
                  properties: {  }
                service:
                  type: object
                  description: 'Service section configuration.'
                  example:
                    ExecStart: /usr/bin/myapp
                  properties: {  }
                install:
                  type: object
                  description: 'Install section configuration.'
                  example:
                    WantedBy: multi-user.target
                  properties: {  }
                enabled:
                  type: boolean
                  description: 'Enable service on boot.'
                  example: true
              required:
                - name
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/{service}':
    put:
      summary: 'Update service.'
      operationId: updateService
      description: 'Update a custom systemd service configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Services
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                unit:
                  type: object
                  description: 'Unit section configuration.'
                  example:
                    Description: 'My Service'
                  properties: {  }
                service:
                  type: object
                  description: 'Service section configuration.'
                  example:
                    ExecStart: /usr/bin/myapp
                  properties: {  }
                install:
                  type: object
                  description: 'Install section configuration.'
                  example:
                    WantedBy: multi-user.target
                  properties: {  }
                enabled:
                  type: boolean
                  description: 'Enable service on boot.'
                  example: true
    delete:
      summary: 'Delete service.'
      operationId: deleteService
      description: 'Remove a custom systemd service from the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - Services
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: service
        description: 'The service ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/{service}/start':
    post:
      summary: 'Start service.'
      operationId: startService
      description: 'Start a systemd service.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Services & Daemons'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: service
        description: 'The service ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/{service}/stop':
    post:
      summary: 'Stop service.'
      operationId: stopService
      description: 'Stop a systemd service.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Services & Daemons'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: service
        description: 'The service ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/{service}/restart':
    post:
      summary: 'Restart service.'
      operationId: restartService
      description: 'Restart a systemd service.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Services & Daemons'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: service
        description: 'The service ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/{service}/enable':
    post:
      summary: 'Enable service.'
      operationId: enableService
      description: 'Enable a systemd service to start automatically at boot.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Services & Daemons'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: service
        description: 'The service ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/services/{service}/disable':
    post:
      summary: 'Disable service.'
      operationId: disableService
      description: 'Disable a systemd service from starting automatically at boot.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Services & Daemons'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: service
        description: 'The service ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/pm2':
    get:
      summary: 'List PM2 processes.'
      operationId: listPM2Processes
      description: 'Get all running PM2 processes on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  processes:
                    -
                      id: 0
                      name: app
                      status: online
                      cpu: 0.5
                      memory: 52428800
                  installed: true
                properties:
                  processes:
                    type: array
                    example:
                      -
                        id: 0
                        name: app
                        status: online
                        cpu: 0.5
                        memory: 52428800
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 0
                        name:
                          type: string
                          example: app
                        status:
                          type: string
                          example: online
                        cpu:
                          type: number
                          example: 0.5
                        memory:
                          type: integer
                          example: 52428800
                  installed:
                    type: boolean
                    example: true
      tags:
        - 'Services & Daemons'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/pm2/start':
    post:
      summary: 'Start PM2 process.'
      operationId: startPM2Process
      description: 'Start a new PM2 process on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Services & Daemons'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: string
                  description: 'Linux user to run the process.'
                  example: www-data
                command:
                  type: string
                  description: 'Command to execute.'
                  example: 'npm start'
              required:
                - user
                - command
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/pm2/stop':
    post:
      summary: 'Stop PM2 process.'
      operationId: stopPM2Process
      description: 'Stop a running PM2 process.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  output: 'Process stopped'
                  success: true
                properties:
                  output:
                    type: string
                    example: 'Process stopped'
                  success:
                    type: boolean
                    example: true
      tags:
        - 'Services & Daemons'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: string
                  description: 'Linux user running the process.'
                  example: www-data
                process:
                  type: integer
                  description: 'Process ID.'
                  example: 0
              required:
                - user
                - process
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/pm2/restart':
    post:
      summary: 'Restart PM2 process.'
      operationId: restartPM2Process
      description: 'Restart a running PM2 process.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  output: 'Process restarted'
                  success: true
                properties:
                  output:
                    type: string
                    example: 'Process restarted'
                  success:
                    type: boolean
                    example: true
      tags:
        - 'Services & Daemons'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: string
                  description: 'Linux user running the process.'
                  example: www-data
                process:
                  type: integer
                  description: 'Process ID.'
                  example: 0
              required:
                - user
                - process
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/pm2/delete':
    post:
      summary: 'Delete PM2 process.'
      operationId: deletePM2Process
      description: 'Delete a PM2 process from the process list.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  output: 'Process deleted'
                  success: true
                properties:
                  output:
                    type: string
                    example: 'Process deleted'
                  success:
                    type: boolean
                    example: true
      tags:
        - 'Services & Daemons'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: string
                  description: 'Linux user running the process.'
                  example: www-data
                process:
                  type: integer
                  description: 'Process ID.'
                  example: 0
              required:
                - user
                - process
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/pm2/logs':
    post:
      summary: 'Get PM2 logs.'
      operationId: getPM2Logs
      description: 'Get logs for a PM2 process.'
      parameters:
        -
          in: query
          name: process
          description: 'Process ID.'
          example: 0
          required: true
          schema:
            type: integer
            description: 'Process ID.'
            example: 0
        -
          in: query
          name: user
          description: 'Linux user running the process.'
          example: www-data
          required: true
          schema:
            type: string
            description: 'Linux user running the process.'
            example: www-data
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  output: '[PM2] Logs...'
                  success: true
                properties:
                  output:
                    type: string
                    example: '[PM2] Logs...'
                  success:
                    type: boolean
                    example: true
      tags:
        - 'Services & Daemons'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                user:
                  type: string
                  description: ''
                  example: architecto
                process:
                  type: number
                  description: ''
                  example: 4326.41688
                lines:
                  type: integer
                  description: 'Must be at least 100. Must not be greater than 1000.'
                  example: 17
                  nullable: true
              required:
                - user
                - process
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/verify':
    get:
      summary: 'Verify the token for auto login to WordPress.'
      operationId: verifyTheTokenForAutoLoginToWordPress
      description: ''
      parameters: []
      responses:
        400:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  success: false
                  message: 'Bad request: bad data'
                properties:
                  success:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: 'Bad request: bad data'
      tags:
        - 'Site Management'
      security: []
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  /api/sites:
    get:
      summary: 'List all sites.'
      operationId: listAllSites
      description: 'Get a list of all sites owned by the authenticated user.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: example.com
                      enabled: true
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: example.com
                        enabled: true
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: example.com
                        enabled:
                          type: boolean
                          example: true
      tags:
        - 'Site Management'
    post:
      summary: 'Create a new site.'
      operationId: createANewSite
      description: 'Create a new website on a server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        201:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: example.com
                    enabled: true
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: example.com
                      enabled:
                        type: boolean
                        example: true
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                server_id:
                  type: integer
                  description: 'The server ID to create the site on.'
                  example: 1
                site_id:
                  type: integer
                  description: 'Parent site ID if creating an alias site.'
                  example: 10
                name:
                  type: string
                  description: 'Domain name of the website.'
                  example: example.com
                php_version:
                  type: string
                  description: 'PHP version to install with the site.'
                  example: php8.3
                proxy_port:
                  type: integer
                  description: 'Proxy port for reverse proxy sites.'
                  example: 3000
                database_name:
                  type: string
                  description: 'Database name to create and assign.'
                  example: mydb
                wildcards:
                  type: boolean
                  description: 'Enable wildcard subdomain routing.'
                  example: false
                username:
                  type: string
                  description: 'Isolated Linux user for the site.'
                  example: myuser
                password:
                  type: string
                  description: 'Password for the isolated user.'
                  example: secret123
              required:
                - server_id
                - name
  '/api/servers/{server}/sites/usage':
    get:
      summary: 'Calculate site data usage.'
      operationId: calculateSiteDataUsage
      description: 'Calculate disk usage for all sites on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}':
    get:
      summary: 'Get site details.'
      operationId: getSiteDetails
      description: 'Retrieve detailed information about a specific site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 1
                    name: example.com
                    enabled: true
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      name:
                        type: string
                        example: example.com
                      enabled:
                        type: boolean
                        example: true
      tags:
        - 'Site Management'
    delete:
      summary: 'Delete a site.'
      operationId: deleteASite
      description: 'Remove a site and optionally its associated database/user.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                database:
                  type: boolean
                  description: 'Also delete associated database.'
                  example: true
                database_user:
                  type: boolean
                  description: 'Also delete associated database user.'
                  example: true
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/agent/token':
    post:
      summary: 'Generate a JWT token for the agent associated with the given Site.'
      operationId: generateAJWTTokenForTheAgentAssociatedWithTheGivenSite
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/ip-remote-check':
    post:
      summary: 'Check DNS records.'
      operationId: checkDNSRecords
      description: "Verify that the site's DNS A records point to the correct server IP."
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    domain:
                      type: string
                      example: example.com
                    ip:
                      type: string
                      example: 192.168.1.1
                    success:
                      type: boolean
                      example: true
                example:
                  -
                    domain: example.com
                    ip: 192.168.1.1
                    success: true
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/name':
    put:
      summary: 'Update site name.'
      operationId: updateSiteName
      description: 'Change the domain name and related settings of a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        204:
          description: 'no changes'
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: 'New domain name.'
                  example: newdomain.com
                wildcards:
                  type: boolean
                  description: 'Enable wildcard subdomains.'
                  example: false
                enable_redirect:
                  type: boolean
                  description: 'Enable HTTP redirects.'
                  example: true
                enable_redirect_ssl:
                  type: boolean
                  description: 'Enable HTTPS redirect.'
                  example: true
                preferred_url:
                  type: string
                  description: 'Preferred URL format: www, non-www.'
                  example: www
              required:
                - name
                - wildcards
                - enable_redirect
                - enable_redirect_ssl
                - preferred_url
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/favorite':
    post:
      summary: 'Toggle site favorite.'
      operationId: toggleSiteFavorite
      description: 'Toggle the favorite status of a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/clone':
    post:
      summary: 'Clone site.'
      operationId: cloneSite
      description: 'Create copies of a site to the same or different server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                server_id:
                  type: integer
                  description: 'Target server ID.'
                  example: 1
                sites:
                  type: array
                  description: 'Array of new domain names.'
                  example:
                    - clone1.com
                    - clone2.com
                  items:
                    type: string
                database:
                  type: boolean
                  description: 'Clone database.'
                  example: false
                  nullable: true
                deploy_script:
                  type: boolean
                  description: 'Clone deploy script.'
                  example: true
                  nullable: true
              required:
                - server_id
                - sites
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/uninstall':
    delete:
      summary: 'Uninstall code.'
      operationId: uninstallCode
      description: 'Uninstall the source code from a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reset:
                  type: boolean
                  description: 'Reset to default site.'
                  example: true
                delete_database:
                  type: boolean
                  description: 'Delete associated database.'
                  example: false
                delete_database_user:
                  type: boolean
                  description: 'Delete associated database user.'
                  example: false
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/chmod':
    post:
      summary: 'Change the permissions of a file or folder in a site.'
      operationId: changeThePermissionsOfAFileOrFolderInASite
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                folder:
                  type: string
                  description: 'The string must not be greater than 3 characters.'
                  example: b
                file:
                  type: string
                  description: 'The string must not be greater than 3 characters.'
                  example: 'n'
              required:
                - folder
                - file
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/chown':
    post:
      summary: 'Change the ownership of the root folder of a site.'
      operationId: changeTheOwnershipOfTheRootFolderOfASite
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/toggle':
    post:
      summary: 'Enable or Disable site'
      operationId: enableOrDisableSite
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
                  description: ''
                  example: true
              required:
                - enabled
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/protect':
    post:
      summary: 'Toggle site protection'
      operationId: toggleSiteProtection
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                protected:
                  type: boolean
                  description: ''
                  example: false
              required:
                - protected
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/owner':
    put:
      summary: 'Updates the owner of the site.'
      operationId: updatesTheOwnerOfTheSite
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                username:
                  type: string
                  description: 'Must contain only letters, numbers, dashes and underscores. The string must not be greater than 32 characters.'
                  example: b
                  nullable: true
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/action':
    post:
      summary: 'Run a code action'
      operationId: runACodeAction
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                action:
                  type: string
                  description: ''
                  example: architecto
                note:
                  type: string
                  description: ''
                  example: architecto
              required:
                - action
                - note
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/bindings':
    post:
      summary: 'Link a resources to a site.'
      operationId: linkAResourcesToASite
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                database:
                  type: integer
                  description: ''
                  example: 16
                user:
                  type: integer
                  description: ''
                  example: 16
              required:
                - database
                - user
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/lockdown':
    post:
      summary: 'Toggle Lockdown protection'
      operationId: toggleLockdownProtection
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enable:
                  type: boolean
                  description: ''
                  example: true
              required:
                - enable
    parameters:
      -
        in: path
        name: site
        description: 'The site.'
        example: 101443
        required: true
        schema:
          type: integer
  '/api/sites/{site}/directory':
    put:
      summary: 'Update web directory.'
      operationId: updateWebDirectory
      description: 'Change the web root directory of a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        204:
          description: 'no changes'
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                directory:
                  type: string
                  description: 'New directory path.'
                  example: /public
                sync:
                  type: boolean
                  description: ''
                  example: true
                  nullable: true
              required:
                - directory
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/branch':
    put:
      summary: 'Update git branch.'
      operationId: updateGitBranch
      description: 'Change the git branch for the site deployment.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                branch:
                  type: string
                  description: 'Git branch name.'
                  example: main
              required:
                - branch
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/php_version':
    put:
      summary: 'Update PHP version.'
      operationId: updatePHPVersion
      description: 'Update the PHP version for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        204:
          description: no_change
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                php_version:
                  type: string
                  description: 'PHP version.'
                  example: php8.3
              required:
                - php_version
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/type':
    put:
      summary: 'Update site type.'
      operationId: updateSiteType
      description: 'Change the code type of a site (custom, laravel, wordpress).'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Site type: custom, laravel, wordpress.'
                  example: laravel
              required:
                - type
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/proxy_port':
    put:
      summary: 'Update proxy port.'
      operationId: updateProxyPort
      description: 'Update the reverse proxy port for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
        204:
          description: no_change
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                proxy_port:
                  type: integer
                  description: 'Proxy port (1-65535, excludes 80, 443, 2022).'
                  example: 3000
                  nullable: true
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/phpmyadmin':
    post:
      summary: 'Install phpMyAdmin.'
      operationId: installPhpMyAdmin
      description: 'Install phpMyAdmin on a site for database management.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/wordpress':
    post:
      summary: 'Install WordPress.'
      operationId: installWordPress
      description: 'Install WordPress on a site with automatic database setup.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  event:
                    id: 1
                    status: running
                properties:
                  event:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      status:
                        type: string
                        example: running
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: string
                  description: 'WordPress version to install.'
                  example: latest
                  nullable: true
                title:
                  type: string
                  description: 'Site title.'
                  example: 'My Blog'
                username:
                  type: string
                  description: 'WordPress admin username.'
                  example: admin
                password:
                  type: string
                  description: 'WordPress admin password (min 8 chars).'
                  example: SecureP@ss
                email:
                  type: string
                  description: 'WordPress admin email.'
                  example: admin@example.com
                searchEngineOff:
                  type: boolean
                  description: 'Discourage search engines.'
                  example: false
                user:
                  type: integer
                  description: 'Existing database user ID.'
                  example: 1
                  nullable: true
                database:
                  type: integer
                  description: 'Existing database ID.'
                  example: 1
                  nullable: true
                scripts:
                  type: string
                  description: 'Post-install scripts.'
                  example: 'wp plugin install akismet'
                  nullable: true
              required:
                - title
                - username
                - password
                - email
                - searchEngineOff
    get:
      summary: 'Get WordPress info.'
      operationId: getWordPressInfo
      description: 'Get WordPress plugins and themes information.'
      parameters:
        -
          in: query
          name: type
          description: 'Type: plugins or themes.'
          example: plugins
          required: true
          schema:
            type: string
            description: 'Type: plugins or themes.'
            example: plugins
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  plugins:
                    -
                      name: Akismet
                      status: active
                      version: '5.0'
                properties:
                  plugins:
                    type: array
                    example:
                      -
                        name: Akismet
                        status: active
                        version: '5.0'
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          example: Akismet
                        status:
                          type: string
                          example: active
                        version:
                          type: string
                          example: '5.0'
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: ''
                  example: plugins
                  enum:
                    - plugins
                    - themes
              required:
                - type
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/roundcube':
    post:
      summary: 'Install Roundcube.'
      operationId: installRoundcube
      description: 'Install Roundcube Webmail on a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - 'Site Management'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Database type: mysql or postgresql.'
                  example: mysql
                imap_host:
                  type: array
                  description: 'IMAP hosts for the webmail.'
                  example:
                    - 'ssl://mail.domain.tld:993'
                  items:
                    type: string
                smtp_host:
                  type: array
                  description: 'SMTP hosts for the webmail.'
                  example:
                    - 'ssl://mail.domain.tld:465'
                  items:
                    type: string
                user:
                  type: string
                  description: 'Existing database username (auto-created if empty).'
                  example: roundcube_user
                database:
                  type: string
                  description: 'Existing database name (auto-created if empty).'
                  example: roundcube_db
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/github':
    post:
      summary: 'Install GitHub repository.'
      operationId: installGitHubRepository
      description: 'Install Git code from GitHub repository.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orgName:
                  type: string
                  description: 'Organization name.'
                  example: my-org
                repository:
                  type: string
                  description: 'SSH repository URL.'
                  example: 'git@github.com:user/repo.git'
                branch:
                  type: string
                  description: 'Branch name.'
                  example: main
              required:
                - repository
                - branch
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/gitlab':
    post:
      summary: 'Install GitLab repository.'
      operationId: installGitLabRepository
      description: 'Install Git code from GitLab repository.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                repository:
                  type: string
                  description: 'SSH repository URL.'
                  example: 'git@gitlab.com:user/repo.git'
                branch:
                  type: string
                  description: 'Branch name.'
                  example: main
              required:
                - repository
                - branch
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/bitbucket':
    post:
      summary: 'Install Bitbucket repository.'
      operationId: installBitbucketRepository
      description: 'Install Git code from Bitbucket repository.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                repository:
                  type: string
                  description: 'SSH repository URL.'
                  example: 'git@bitbucket.org:user/repo.git'
                branch:
                  type: string
                  description: 'Branch name.'
                  example: main
              required:
                - repository
                - branch
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/git':
    post:
      summary: 'Install Git repository.'
      operationId: installGitRepository
      description: 'Clone a Git repository to the site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                repository:
                  type: string
                  description: 'SSH repository URL.'
                  example: 'git@github.com:user/repo.git'
                branch:
                  type: string
                  description: 'Branch name.'
                  example: main
              required:
                - repository
                - branch
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/uptime-kuma':
    post:
      summary: 'Install Uptime Kuma.'
      operationId: installUptimeKuma
      description: 'Install Uptime Kuma monitoring tool on the site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                port:
                  type: integer
                  description: 'Port to run Uptime Kuma on.'
                  example: 3001
              required:
                - port
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/imunifyav':
    post:
      summary: 'Install Imunify Antivirus.'
      operationId: installImunifyAntivirus
      description: 'Install Imunify Antivirus dashboard on the site. Requires Imunify360 to be installed on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/chatwoot':
    post:
      summary: 'Install Chatwoot.'
      operationId: installChatwoot
      description: 'Install Chatwoot customer support platform on the site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                port:
                  type: integer
                  description: 'Port to run Chatwoot on.'
                  example: 3000
              required:
                - port
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/n8n':
    post:
      summary: 'Install N8N.'
      operationId: installN8N
      description: 'Install N8N workflow automation on the site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                port:
                  type: integer
                  description: 'Port to run N8N on.'
                  example: 5678
                database:
                  type: string
                  description: 'Database type: postgresql or sqlite.'
                  example: postgresql
                env:
                  type: string
                  description: 'Additional environment variables.'
                  example: N8N_BASIC_AUTH_ACTIVE=true
                  nullable: true
              required:
                - port
                - database
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/sync':
    post:
      summary: 'Sync web server config.'
      operationId: syncWebServerConfig
      description: 'Synchronize the web server configuration for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Management'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/repository':
    put:
      summary: 'Update repository.'
      operationId: updateRepository
      description: 'Update the Git repository for a site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'Site Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                provider:
                  type: string
                  description: 'Git provider: github, gitlab, bitbucket, custom.'
                  example: github
                repository:
                  type: string
                  description: 'Repository URL (must end with .git).'
                  example: 'git@github.com:user/repo.git'
                branch:
                  type: string
                  description: 'Branch name.'
                  example: main
              required:
                - provider
                - repository
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/configs':
    get:
      summary: 'List web server configs.'
      operationId: listWebServerConfigs
      description: 'Get all web server configurations for a site.'
      parameters:
        -
          in: query
          name: webserver
          description: 'Web server type: nginx or apache2.'
          example: nginx
          required: true
          schema:
            type: string
            description: 'Web server type: nginx or apache2.'
            example: nginx
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      name: 'Custom config'
                      position: before
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        name: 'Custom config'
                        position: before
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        name:
                          type: string
                          example: 'Custom config'
                        position:
                          type: string
                          example: before
      tags:
        - 'Site Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                webserver:
                  type: string
                  description: ''
                  example: architecto
              required:
                - webserver
    post:
      summary: 'Create web server config.'
      operationId: createWebServerConfig
      description: 'Add a custom web server configuration rule.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Config type: custom, rewrite, security.'
                  example: custom
                webserver:
                  type: string
                  description: 'Web server: nginx or apache2.'
                  example: nginx
                name:
                  type: string
                  description: 'Config name.'
                  example: 'My custom rule'
                position:
                  type: string
                  description: 'Position: before, server, after.'
                  example: before
                content:
                  type: string
                  description: 'Configuration content (for custom type).'
                  example: 'add_header X-Frame-Options "SAMEORIGIN";'
                from:
                  type: string
                  description: 'Source pattern (for rewrite type).'
                  example: ^/old-path$
                to:
                  type: string
                  description: 'Target path (for rewrite type).'
                  example: /new-path
                flag:
                  type: string
                  description: 'Rewrite flag: redirect, permanent, last, break.'
                  example: permanent
                path:
                  type: string
                  description: 'Protected path (for security type).'
                  example: /admin
                users:
                  type: array
                  description: 'Users for basic auth (for security type).'
                  example:
                    - []
                  items:
                    type: object
                    properties:
                      username:
                        type: string
                        description: 'Username for basic auth.'
                        example: admin
                      password:
                        type: string
                        description: 'Password for basic auth.'
                        example: pass123
                    required:
                      - username
              required:
                - type
                - webserver
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/configs/{config}':
    put:
      summary: 'Update web server config.'
      operationId: updateWebServerConfig
      description: 'Update an existing web server configuration rule.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - 'Site Settings'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                type:
                  type: string
                  description: 'Config type: custom, rewrite, security.'
                  example: custom
                webserver:
                  type: string
                  description: 'Web server: nginx or apache2.'
                  example: nginx
                name:
                  type: string
                  description: 'Config name.'
                  example: 'Updated rule'
                content:
                  type: string
                  description: 'Configuration content (for custom type).'
                  example: 'add_header X-Custom "value";'
              required:
                - type
                - webserver
    delete:
      summary: 'Delete web server config.'
      operationId: deleteWebServerConfig
      description: 'Delete a web server configuration rule.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        204:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
        400:
          description: cannot_delete
          content:
            application/json:
              schema:
                type: object
                example:
                  message: 'Cannot delete this web server config'
                properties:
                  message:
                    type: string
                    example: 'Cannot delete this web server config'
      tags:
        - 'Site Settings'
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: config
        description: 'The config ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor/{supervisor}/log':
    get:
      summary: 'Get Supervisor log.'
      operationId: getSupervisorLog
      description: 'Retrieve the last 500 lines of the Supervisor process log.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: string
                example: 'log content here...'
      tags:
        - Supervisor
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: supervisor
        description: 'The Supervisor config ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor/{supervisor}/status':
    get:
      summary: 'Retrieves the status of a Supervisor.'
      operationId: retrievesTheStatusOfASupervisor
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        401:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  message: Unauthenticated.
                properties:
                  message:
                    type: string
                    example: Unauthenticated.
      tags:
        - Supervisor
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: supervisor
        description: 'The supervisor.'
        example: 3
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor/{supervisor}/clear-log':
    post:
      summary: 'Clear Supervisor log.'
      operationId: clearSupervisorLog
      description: 'Clear the Supervisor process log file.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: string
                example: ''
      tags:
        - Supervisor
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: supervisor
        description: 'The Supervisor config ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor/{supervisor}/restart':
    post:
      summary: 'Restarts the Supervisor configuration.'
      operationId: restartsTheSupervisorConfiguration
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Supervisor
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: supervisor
        description: 'The supervisor.'
        example: 3
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor/{supervisor}/start':
    post:
      summary: 'Starts the Supervisor configuration.'
      operationId: startsTheSupervisorConfiguration
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Supervisor
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: supervisor
        description: 'The supervisor.'
        example: 3
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor/{supervisor}/stop':
    post:
      summary: 'Stops a Supervisor.'
      operationId: stopsASupervisor
      description: ''
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses: {  }
      tags:
        - Supervisor
    parameters:
      -
        in: path
        name: server
        description: 'The server.'
        example: 282
        required: true
        schema:
          type: integer
      -
        in: path
        name: supervisor
        description: 'The supervisor.'
        example: 3
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor':
    post:
      summary: 'Create Supervisor config.'
      operationId: createSupervisorConfig
      description: 'Create a new Supervisor process configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  status: installing
                  command: 'php artisan queue:work'
                properties:
                  id:
                    type: integer
                    example: 1
                  status:
                    type: string
                    example: installing
                  command:
                    type: string
                    example: 'php artisan queue:work'
      tags:
        - Supervisor
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                description:
                  type: string
                  description: 'Process description.'
                  example: 'Laravel Queue Worker'
                  nullable: true
                command:
                  type: string
                  description: 'Command to run.'
                  example: 'php /home/site/artisan queue:work'
                directory:
                  type: string
                  description: 'Working directory.'
                  example: /home/site
                  nullable: true
                user:
                  type: string
                  description: 'Linux user to run as.'
                  example: flashvps
                processes:
                  type: integer
                  description: 'Number of processes.'
                  example: 2
                start_secs:
                  type: integer
                  description: 'Seconds to wait before considering started.'
                  example: 1
              required:
                - command
                - user
                - processes
                - start_secs
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/supervisor/{supervisor}':
    delete:
      summary: 'Delete Supervisor config.'
      operationId: deleteSupervisorConfig
      description: 'Remove a Supervisor process configuration.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  id: 1
                  status: deleting
                properties:
                  id:
                    type: integer
                    example: 1
                  status:
                    type: string
                    example: deleting
      tags:
        - Supervisor
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: supervisor
        description: 'The Supervisor config ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/wireguard/{wireguard}/download':
    get:
      summary: 'Download client config.'
      operationId: downloadClientConfig
      description: 'Download the WireGuard configuration file for a client.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'File download stream'
      tags:
        - 'WireGuard VPN'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: wireguard
        description: 'The WireGuard client ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/wireguard':
    get:
      summary: 'List WireGuard clients.'
      operationId: listWireGuardClients
      description: 'Get the list of WireGuard VPN clients.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    -
                      id: 1
                      client_name: client1
                      address: 10.8.0.2
                properties:
                  data:
                    type: array
                    example:
                      -
                        id: 1
                        client_name: client1
                        address: 10.8.0.2
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          example: 1
                        client_name:
                          type: string
                          example: client1
                        address:
                          type: string
                          example: 10.8.0.2
      tags:
        - 'WireGuard VPN'
    post:
      summary: 'Create WireGuard client.'
      operationId: createWireGuardClient
      description: 'Creates a new WireGuard VPN client.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'WireGuard VPN'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                client_name:
                  type: string
                  description: 'Client name (max 15 chars, alphanumeric).'
                  example: client1
              required:
                - client_name
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/wireguard/{wireguard}':
    delete:
      summary: 'Delete WireGuard client.'
      operationId: deleteWireGuardClient
      description: 'Remove a client from the WireGuard VPN.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - 'WireGuard VPN'
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: wireguard
        description: 'The WireGuard client ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/servers/{server}/wordpress/auto-login':
    delete:
      summary: 'Uninstall auto login.'
      operationId: uninstallAutoLogin
      description: 'Remove the auto login plugin from all WordPress sites on the server.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: success
                    type: object
                    example:
                      event:
                        id: 1
                        status: running
                    properties:
                      event:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 1
                          status:
                            type: string
                            example: running
                  -
                    description: no_sites
                    type: object
                    example:
                      event: null
                    properties:
                      event:
                        type: string
                        example: null
      tags:
        - WordPress
    parameters:
      -
        in: path
        name: server
        description: 'The server ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/wordpress/{type}/auto-update':
    post:
      summary: 'Toggle auto-update.'
      operationId: toggleAutoUpdate
      description: 'Enable or disable auto-update for a WordPress plugin or theme.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: ''
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enable:
                  type: boolean
                  description: 'Enable auto-update.'
                  example: true
                plugin:
                  type: string
                  description: 'Plugin/theme slug.'
                  example: akismet
              required:
                - enable
                - plugin
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: type
        description: 'Type: plugins or themes.'
        example: plugins
        required: true
        schema:
          type: string
  '/api/sites/{site}/wordpress/{type}/toggle':
    post:
      summary: 'Toggle plugin/theme.'
      operationId: togglePlugintheme
      description: 'Activate or deactivate a WordPress plugin or theme.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enable:
                  type: boolean
                  description: 'Activate plugin/theme.'
                  example: true
                plugin:
                  type: string
                  description: 'Plugin/theme slug.'
                  example: akismet
              required:
                - enable
                - plugin
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: type
        description: 'Type: plugins or themes.'
        example: plugins
        required: true
        schema:
          type: string
  '/api/sites/{site}/wordpress/{type}/search':
    post:
      summary: 'Search plugins/themes.'
      operationId: searchPluginsthemes
      description: 'Search for WordPress plugins or themes from the WordPress.org repository.'
      parameters:
        -
          in: query
          name: search
          description: 'Search query.'
          example: seo
          required: true
          schema:
            type: string
            description: 'Search query.'
            example: seo
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    text:
                      type: string
                      example: 'Yoast SEO'
                    value:
                      type: string
                      example: wordpress-seo
                    short_description:
                      type: string
                      example: 'SEO plugin'
                example:
                  -
                    text: 'Yoast SEO'
                    value: wordpress-seo
                    short_description: 'SEO plugin'
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                search:
                  type: string
                  description: ''
                  example: architecto
              required:
                - search
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: type
        description: 'Type: plugins or themes.'
        example: plugins
        required: true
        schema:
          type: string
  '/api/sites/{site}/wordpress/{type}/install':
    post:
      summary: 'Install plugin/theme.'
      operationId: installPlugintheme
      description: 'Install a WordPress plugin or theme from the WordPress.org repository.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                plugin:
                  type: string
                  description: 'Plugin/theme slug.'
                  example: wordpress-seo
                version:
                  type: string
                  description: 'Specific version to install.'
                  example: '21.0'
                  nullable: true
                activate:
                  type: boolean
                  description: 'Activate after install.'
                  example: true
                  nullable: true
              required:
                - plugin
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: type
        description: 'Type: plugins or themes.'
        example: plugins
        required: true
        schema:
          type: string
  '/api/sites/{site}/wordpress/{type}/update':
    post:
      summary: 'Update plugin/theme.'
      operationId: updatePlugintheme
      description: 'Update a WordPress plugin or theme to the latest version.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                plugin:
                  type: string
                  description: 'Plugin/theme slug.'
                  example: wordpress-seo
              required:
                - plugin
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: type
        description: 'Type: plugins or themes.'
        example: plugins
        required: true
        schema:
          type: string
  '/api/sites/{site}/wordpress/{type}/delete':
    post:
      summary: 'Delete plugin/theme.'
      operationId: deletePlugintheme
      description: 'Delete a WordPress plugin or theme.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                plugin:
                  type: string
                  description: 'Plugin/theme slug.'
                  example: hello-dolly
              required:
                - plugin
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
      -
        in: path
        name: type
        description: 'Type: plugins or themes.'
        example: plugins
        required: true
        schema:
          type: string
  '/api/sites/{site}/wordpress/optimization':
    post:
      summary: 'Optimize WordPress.'
      operationId: optimizeWordPress
      description: 'Optimize WordPress according to the desired optimization conditions.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                optimizations:
                  type: array
                  description: 'List of optimization commands.'
                  example:
                    - 'cache flush'
                    - 'transient delete --all'
                  items:
                    type: string
              required:
                - optimizations
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/wordpress/optimization/log':
    get:
      summary: 'Get optimization log.'
      operationId: getOptimizationLog
      description: 'Retrieves the optimization log for a WordPress site.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  -
                    description: success
                    type: object
                    example:
                      time: '2 hours ago'
                      log: 'Optimization completed successfully'
                    properties:
                      time:
                        type: string
                        example: '2 hours ago'
                      log:
                        type: string
                        example: 'Optimization completed successfully'
                  -
                    description: no_log
                    type: object
                    example:
                      time: null
                      log: null
                    properties:
                      time:
                        type: string
                        example: null
                      log:
                        type: string
                        example: null
      tags:
        - WordPress
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/wordpress/wprocket':
    post:
      summary: 'Toggle WP Rocket.'
      operationId: toggleWPRocket
      description: 'Enable or disable WordPress Rocket cache integration with Nginx.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enable:
                  type: boolean
                  description: 'Enable WP Rocket.'
                  example: true
              required:
                - enable
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/wordpress/user':
    put:
      summary: 'Update WordPress user.'
      operationId: updateWordPressUser
      description: 'Updates the WordPress admin user credentials.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: success
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: 21449
                    description: xxx
                    status: RUNNING
                    total_seconds: 0.848489
                    created_at: '2025-12-04T06:06:45.000000Z'
                    created_at_display: '0 giây trước'
                    updated_at: '2025-12-04T06:06:45.000000Z'
                    output: xxx
                    user_id: 1
                    server_id: 384
                    site_id: null
                    color: info
                    is_finished: false
                    user_name: 'User Name'
                    user_avatar: 'https://example.com/avatar.png'
                    type: xxx
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 21449
                      description:
                        type: string
                        example: xxx
                      status:
                        type: string
                        example: RUNNING
                      total_seconds:
                        type: number
                        example: 0.848489
                      created_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      created_at_display:
                        type: string
                        example: '0 giây trước'
                      updated_at:
                        type: string
                        example: '2025-12-04T06:06:45.000000Z'
                      output:
                        type: string
                        example: xxx
                      user_id:
                        type: integer
                        example: 1
                      server_id:
                        type: integer
                        example: 384
                      site_id:
                        type: string
                        example: null
                      color:
                        type: string
                        example: info
                      is_finished:
                        type: boolean
                        example: false
                      user_name:
                        type: string
                        example: 'User Name'
                      user_avatar:
                        type: string
                        example: 'https://example.com/avatar.png'
                      type:
                        type: string
                        example: xxx
      tags:
        - WordPress
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                wp_user:
                  type: string
                  description: 'WordPress username.'
                  example: admin
                wp_password:
                  type: string
                  description: 'New password.'
                  example: SecureP@ss123
              required:
                - wp_user
                - wp_password
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
  '/api/sites/{site}/wordpress/login':
    get:
      summary: 'Magic login.'
      operationId: magicLogin
      description: 'Perform a passwordless login into WordPress by generating a secure token.'
      parameters:
        -
          in: header
          name: X-Code
          description: ''
          example: '{{AUTH_CODE}}'
          schema:
            type: string
      responses:
        200:
          description: not_wordpress
          content:
            application/json:
              schema:
                type: string
                example: 'This website is not a WordPress website'
        302:
          description: success
          content:
            text/plain:
              schema:
                type: string
                example: 'Redirect to WordPress dashboard'
      tags:
        - WordPress
    parameters:
      -
        in: path
        name: site
        description: 'The site ID.'
        example: 1
        required: true
        schema:
          type: integer
