{
    "openapi": "3.0.3",
    "info": {
        "title": "XServer Server API",
        "description": "XServer API は、エックスサーバー・XServerビジネスのサーバーパネルで提供している主要機能を REST API で利用するためのインターフェースです。",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.xserver.ne.jp",
            "description": "XServer"
        }
    ],
    "security": [
        {
            "BearerAuth": [

            ]
        }
    ],
    "paths": {
        "/v1/me": {
            "get": {
                "tags": [
                    "APIキー情報"
                ],
                "summary": "認証中のAPIキー情報を取得",
                "description": "現在認証に使用しているAPIキーの情報を返します。有効期限・紐づくサーバー名・権限種別を確認できます。",
                "x-scope": "読み取り",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "service_type": {
                                            "type": "string",
                                            "description": "APIキーのサービス種別（server）"
                                        },
                                        "expires_at": {
                                            "type": "string",
                                            "nullable": true,
                                            "description": "有効期限（ISO 8601形式）。無期限の場合は null"
                                        },
                                        "servername": {
                                            "type": "string",
                                            "description": "紐づくサーバー名（初期ドメイン）"
                                        },
                                        "permission_type": {
                                            "type": "string",
                                            "description": "権限種別（full / read / custom）"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/server-info": {
            "get": {
                "tags": [
                    "サーバー情報"
                ],
                "summary": "サーバー情報を取得",
                "description": "サーバーのスペック・ソフトウェアバージョン・ネームサーバーなどの基本情報を返します。サーバーパネルの「サーバー情報」画面に相当します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "server_id": {
                                            "type": "string",
                                            "description": "サーバーID（例: xs123456）"
                                        },
                                        "hostname": {
                                            "type": "string",
                                            "description": "ホスト名（例: sv12345.xserver.jp）"
                                        },
                                        "ip_address": {
                                            "type": "string",
                                            "description": "IPアドレス"
                                        },
                                        "os": {
                                            "type": "string",
                                            "description": "OS名（例: Linux）"
                                        },
                                        "cpu": {
                                            "type": "string",
                                            "nullable": true,
                                            "description": "CPU情報。XServerビジネスのサブアカウントでは null"
                                        },
                                        "memory": {
                                            "type": "string",
                                            "nullable": true,
                                            "description": "メモリ容量（例: 1024GB）。XServerビジネスのサブアカウントでは null"
                                        },
                                        "apache_version": {
                                            "type": "string",
                                            "description": "Apacheバージョン（パッチ番号は x 表記。例: 2.4.x）"
                                        },
                                        "perl_versions": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "利用可能なPerlバージョンの配列"
                                        },
                                        "php_versions": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "利用可能なPHPバージョンの配列（PHP8→PHP7→PHP5→PHP4 の順）"
                                        },
                                        "db_versions": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "利用可能なDB製品＋バージョンの配列。先頭が mysql または mariadb（例: mariadb10.5.x）"
                                        },
                                        "name_servers": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "ネームサーバーの配列（通常 ns1〜ns5）"
                                        },
                                        "domain_validation_token": {
                                            "type": "string",
                                            "description": "ドメイン追加時の所有権確認用トークン。_xserver-verify.{domain} の TXT レコードに xserver-verify={token} を設定して使用する"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/server-info/usage": {
            "get": {
                "tags": [
                    "サーバー情報"
                ],
                "summary": "サーバー利用状況を取得",
                "description": "ディスク使用量・ファイル数・各種設定件数を返します。サーバーパネルのトップページに表示される利用状況に相当します。ディスク容量はサーバーパネルと同じ基準（MB を 1000 で除算した小数2桁）で GB 換算した値を返します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "disk": {
                                            "type": "object",
                                            "properties": {
                                                "quota_gb": {
                                                    "type": "number",
                                                    "description": "ディスク容量の上限（GB、小数2桁）"
                                                },
                                                "used_gb": {
                                                    "type": "number",
                                                    "description": "ディスク使用量（GB、小数2桁）"
                                                },
                                                "file_limit": {
                                                    "type": "integer",
                                                    "description": "ファイル数の上限（プランにより 0 の場合は無制限）"
                                                },
                                                "file_count": {
                                                    "type": "integer",
                                                    "description": "現在のファイル数"
                                                }
                                            }
                                        },
                                        "counts": {
                                            "type": "object",
                                            "properties": {
                                                "domains": {
                                                    "type": "integer",
                                                    "description": "ドメイン設定数（初期ドメインを除く）"
                                                },
                                                "subdomains": {
                                                    "type": "integer",
                                                    "description": "サブドメイン設定数"
                                                },
                                                "mail_accounts": {
                                                    "type": "integer",
                                                    "description": "メールアカウント数"
                                                },
                                                "ftp_accounts": {
                                                    "type": "integer",
                                                    "description": "FTPアカウント数（メインアカウントを除く追加分）"
                                                },
                                                "mysql_databases": {
                                                    "type": "integer",
                                                    "description": "MySQLデータベース数"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/cron": {
            "get": {
                "tags": [
                    "Cron設定"
                ],
                "summary": "Cron一覧を取得",
                "description": "登録済みのCron設定を一覧で返します。各要素の id は PUT/DELETE で指定するハッシュIDです。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "crons": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "CronのハッシュID（PUT/DELETEで使用）"
                                                    },
                                                    "minute": {
                                                        "type": "string",
                                                        "description": "分（0-59, */5 等）"
                                                    },
                                                    "hour": {
                                                        "type": "string",
                                                        "description": "時（0-23, * 等）"
                                                    },
                                                    "day": {
                                                        "type": "string",
                                                        "description": "日（1-31, * 等）"
                                                    },
                                                    "month": {
                                                        "type": "string",
                                                        "description": "月（1-12, * 等）"
                                                    },
                                                    "weekday": {
                                                        "type": "string",
                                                        "description": "曜日（0-7, * 等）"
                                                    },
                                                    "command": {
                                                        "type": "string",
                                                        "description": "実行コマンド"
                                                    },
                                                    "comment": {
                                                        "type": "string",
                                                        "description": "コメント"
                                                    },
                                                    "enabled": {
                                                        "type": "boolean",
                                                        "description": "有効/無効"
                                                    }
                                                }
                                            }
                                        },
                                        "notification_email": {
                                            "type": "string",
                                            "nullable": true,
                                            "description": "Cron実行結果の通知先メールアドレス（未設定時は null）"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "Cron設定"
                ],
                "summary": "Cronを新規追加",
                "description": "新しいCron設定を追加します。レスポンスの id は後続の PUT・DELETE で使用します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "minute": {
                                        "type": "string",
                                        "description": "分（0-59, */5 等）",
                                        "example": "*/5"
                                    },
                                    "hour": {
                                        "type": "string",
                                        "description": "時（0-23, * 等）",
                                        "example": "*"
                                    },
                                    "day": {
                                        "type": "string",
                                        "description": "日（1-31, * 等）",
                                        "example": "*"
                                    },
                                    "month": {
                                        "type": "string",
                                        "description": "月（1-12, * 等）",
                                        "example": "*"
                                    },
                                    "weekday": {
                                        "type": "string",
                                        "description": "曜日（0-7, * 等）",
                                        "example": "*"
                                    },
                                    "command": {
                                        "type": "string",
                                        "description": "実行コマンド（最大1024文字）",
                                        "example": "/usr/bin/php /home/user/cron.php"
                                    },
                                    "comment": {
                                        "type": "string",
                                        "description": "コメント",
                                        "example": "5分毎のバッチ"
                                    }
                                },
                                "required": [
                                    "minute",
                                    "hour",
                                    "day",
                                    "month",
                                    "weekday",
                                    "command"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "string",
                                            "description": "追加されたCronのハッシュID"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/cron/{cron_id}": {
            "put": {
                "tags": [
                    "Cron設定"
                ],
                "summary": "Cronを変更",
                "description": "既存のCron設定を変更します。送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。スケジュール・コマンド・コメントなどの内容を変更すると id が変わります。後続の PUT/DELETE ではレスポンスの新しい id を使用してください。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "cron_id",
                        "in": "path",
                        "required": true,
                        "description": "CronのハッシュID（一覧取得で得られる id）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "minute": {
                                        "type": "string",
                                        "description": "分",
                                        "example": "0"
                                    },
                                    "hour": {
                                        "type": "string",
                                        "description": "時",
                                        "example": "3"
                                    },
                                    "day": {
                                        "type": "string",
                                        "description": "日",
                                        "example": "*"
                                    },
                                    "month": {
                                        "type": "string",
                                        "description": "月",
                                        "example": "*"
                                    },
                                    "weekday": {
                                        "type": "string",
                                        "description": "曜日",
                                        "example": "*"
                                    },
                                    "command": {
                                        "type": "string",
                                        "description": "実行コマンド",
                                        "example": "/usr/bin/php /home/user/cron.php"
                                    },
                                    "comment": {
                                        "type": "string",
                                        "description": "コメント",
                                        "example": "毎日3時のバッチ"
                                    },
                                    "enabled": {
                                        "type": "boolean",
                                        "description": "有効/無効（デフォルト: true）",
                                        "example": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "string",
                                            "description": "変更したCronのハッシュID"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Cron設定"
                ],
                "summary": "Cronを削除",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "cron_id",
                        "in": "path",
                        "required": true,
                        "description": "CronのハッシュID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/wp": {
            "get": {
                "tags": [
                    "WordPress簡単インストール"
                ],
                "summary": "WordPress一覧を取得",
                "description": "簡単インストールでインストール済みのWordPress一覧を返します。domain を指定すると、そのドメインのインストールのみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象のドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定。サブドメインでの絞り込みには対応していません）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "wordpress": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "WordPressのハッシュID（PUT/DELETEで使用）"
                                                    },
                                                    "domain": {
                                                        "type": "string",
                                                        "description": "親ドメイン"
                                                    },
                                                    "url": {
                                                        "type": "string",
                                                        "description": "インストール先URL"
                                                    },
                                                    "title": {
                                                        "type": "string",
                                                        "description": "サイトのタイトル"
                                                    },
                                                    "version": {
                                                        "type": "string",
                                                        "description": "WordPressバージョン"
                                                    },
                                                    "db_name": {
                                                        "type": "string",
                                                        "description": "使用しているデータベース名"
                                                    },
                                                    "db_user": {
                                                        "type": "string",
                                                        "description": "使用しているデータベースユーザー名"
                                                    },
                                                    "memo": {
                                                        "type": "string",
                                                        "description": "メモ"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "WordPress簡単インストール"
                ],
                "summary": "WordPressを新規インストール",
                "description": "指定URLにWordPressを簡単インストールします。URLにはドメインまたはサブドメインを指定でき、パス付きも可能です。スキーム（https:// 等）は省略できます。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "インストール先URL（最大512文字）。スキーム省略可。例: example.com/blog, https://sub.example.com/wp",
                                        "example": "https://example.com/blog"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "サイトタイトル（最大255文字）",
                                        "example": "My Blog"
                                    },
                                    "admin_username": {
                                        "type": "string",
                                        "description": "管理者ユーザー名（最大255文字）",
                                        "example": "admin"
                                    },
                                    "admin_password": {
                                        "type": "string",
                                        "description": "管理者パスワード（7文字以上）",
                                        "example": "SecurePass123"
                                    },
                                    "admin_email": {
                                        "type": "string",
                                        "description": "管理者メールアドレス（最大255文字）",
                                        "example": "admin@example.com"
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ（最大500文字）",
                                        "example": "ブログ用WP"
                                    }
                                },
                                "required": [
                                    "url",
                                    "title",
                                    "admin_username",
                                    "admin_password",
                                    "admin_email"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "string",
                                            "description": "作成されたWordPressのハッシュID"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/wp/{wp_id}": {
            "put": {
                "tags": [
                    "WordPress簡単インストール"
                ],
                "summary": "WordPress設定を変更",
                "description": "現在変更可能な項目はメモのみです。送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "wp_id",
                        "in": "path",
                        "required": true,
                        "description": "WordPressのID（一覧取得で得られる id）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ（省略時は空文字に更新）",
                                        "example": "ブログ用WP"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "WordPress簡単インストール"
                ],
                "summary": "WordPressを削除",
                "description": "WordPressをアンインストールします。関連するデータベース・ユーザー・Cronの削除はオプションで制御できます。デフォルトでは delete_db / delete_cron は true ですが、delete_db_user は false（DBユーザーは残す）である点に注意してください。完全に削除したい場合は delete_db_user: true を明示的に指定してください。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "wp_id",
                        "in": "path",
                        "required": true,
                        "description": "WordPressのID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "delete_db": {
                                        "type": "boolean",
                                        "description": "関連するMySQLデータベースも削除するか（デフォルト: true）",
                                        "example": true
                                    },
                                    "delete_db_user": {
                                        "type": "boolean",
                                        "description": "関連するMySQLユーザーも削除するか（デフォルト: false。完全削除したい場合は明示的に true を指定）",
                                        "example": false
                                    },
                                    "delete_cron": {
                                        "type": "boolean",
                                        "description": "キャッシュ自動削除Cronも削除するか（デフォルト: true）",
                                        "example": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/mail": {
            "get": {
                "tags": [
                    "メールアカウント"
                ],
                "summary": "メールアカウント一覧を取得",
                "description": "サーバーに登録済みのメールアカウントを一覧で返します。domain を指定すると、そのドメインのアカウントのみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象のドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定。サブドメインでの絞り込みには対応していません）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "accounts": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "mail_address": {
                                                        "type": "string",
                                                        "description": "メールアドレス"
                                                    },
                                                    "quota_mb": {
                                                        "type": "integer",
                                                        "description": "メールボックス容量（MB）"
                                                    },
                                                    "memo": {
                                                        "type": "string",
                                                        "description": "メモ"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "メールアカウント"
                ],
                "summary": "メールアカウントを作成",
                "description": "メールアカウントを作成します。作成時にドメイン所有権の確認（TXTレコード検証）が自動で実施されます。詳細は「ドメイン所有権確認」を参照してください。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "mail_address": {
                                        "type": "string",
                                        "description": "メールアドレス",
                                        "example": "info@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "パスワード（8文字以上）",
                                        "example": "SecurePass123"
                                    },
                                    "quota_mb": {
                                        "type": "integer",
                                        "description": "容量(MB) 1-50000",
                                        "example": 2000
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "問い合わせ用"
                                    }
                                },
                                "required": [
                                    "mail_address",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "mail_address": {
                                            "type": "string",
                                            "description": "作成されたメールアドレス"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/mail/{mail_account}": {
            "get": {
                "tags": [
                    "メールアカウント"
                ],
                "summary": "メールアカウント詳細を取得",
                "description": "指定したメールアカウントの詳細情報（容量・使用量を含む）を返します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "mail_account",
                        "in": "path",
                        "required": true,
                        "description": "メールアドレス（例: user@example.com）。URLエンコードすること",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "mail_address": {
                                            "type": "string",
                                            "description": "メールアドレス"
                                        },
                                        "quota_mb": {
                                            "type": "integer",
                                            "description": "メールボックス容量上限（MB）"
                                        },
                                        "used_mb": {
                                            "type": "number",
                                            "description": "メールボックス使用量（MB）"
                                        },
                                        "memo": {
                                            "type": "string",
                                            "description": "メモ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "put": {
                "tags": [
                    "メールアカウント"
                ],
                "summary": "メールアカウントを変更",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "mail_account",
                        "in": "path",
                        "required": true,
                        "description": "メールアドレス",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string",
                                        "description": "パスワード（8文字以上）",
                                        "example": "NewPass456"
                                    },
                                    "quota_mb": {
                                        "type": "integer",
                                        "description": "容量(MB)",
                                        "example": 3000
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "営業部用"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "メールアカウント"
                ],
                "summary": "メールアカウントを削除",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "mail_account",
                        "in": "path",
                        "required": true,
                        "description": "メールアドレス",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/mail/{mail_account}/forwarding": {
            "get": {
                "tags": [
                    "メールアカウント"
                ],
                "summary": "メール転送設定を取得",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "mail_account",
                        "in": "path",
                        "required": true,
                        "description": "メールアドレス",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "forwarding_addresses": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "description": "転送先メールアドレスの配列"
                                        },
                                        "keep_in_mailbox": {
                                            "type": "boolean",
                                            "description": "転送後もメールボックスに残すかどうか"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "put": {
                "tags": [
                    "メールアカウント"
                ],
                "summary": "メール転送設定を更新",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。転送先アドレスは上書きで設定されます。空配列を送ると転送先をクリアできます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "mail_account",
                        "in": "path",
                        "required": true,
                        "description": "メールアドレス",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "forwarding_addresses": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "description": "転送先メールアドレスの配列",
                                        "example": [
                                            "forward@example.com"
                                        ]
                                    },
                                    "keep_in_mailbox": {
                                        "type": "boolean",
                                        "description": "転送後もメールボックスに残すか",
                                        "example": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/mail-filter": {
            "get": {
                "tags": [
                    "メール振り分け"
                ],
                "summary": "振り分け設定一覧を取得",
                "description": "条件とアクションで定義された振り分けルールの一覧を返します。domain を指定すると、そのドメインのルールのみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象のドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定。サブドメインでの絞り込みには対応していません）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "filters": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "description": "振り分けルールのID（DELETEで使用）"
                                                    },
                                                    "domain": {
                                                        "type": "string",
                                                        "description": "対象ドメイン"
                                                    },
                                                    "priority": {
                                                        "type": "integer",
                                                        "description": "ドメイン内での優先度（1から連番。番号が小さいほど先に評価される）"
                                                    },
                                                    "conditions": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object"
                                                        },
                                                        "description": "条件の配列。複数条件はすべてANDで評価される"
                                                    },
                                                    "conditions[]": {
                                                        "type": "object",
                                                        "properties": {
                                                            "keyword": {
                                                                "type": "string",
                                                                "description": "マッチさせるキーワード"
                                                            },
                                                            "field": {
                                                                "type": "string",
                                                                "description": "対象フィールド。subject: 件名 / from: 差出人 / to: あて先 / body: 本文 / header: ヘッダー全体"
                                                            },
                                                            "match_type": {
                                                                "type": "string",
                                                                "description": "一致条件。contain: キーワードを含む / match: キーワードと完全一致 / start_from: キーワードから始まる"
                                                            }
                                                        }
                                                    },
                                                    "action": {
                                                        "type": "object",
                                                        "description": "振り分けアクション",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "description": "転送先種別。mail_address: 指定メールアドレスに転送 / spam_folder: 迷惑メールフォルダに振り分け / trash: ゴミ箱に振り分け / delete: メールを削除"
                                                            },
                                                            "target": {
                                                                "type": "string",
                                                                "description": "転送先メールアドレス。type が mail_address の場合に値が入り、それ以外では空文字"
                                                            },
                                                            "method": {
                                                                "type": "string",
                                                                "description": "処理方法。move: 転送（元のメールボックスには残さない） / copy: コピー転送（元のメールボックスにも残す）"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "メール振り分け"
                ],
                "summary": "振り分け設定を追加",
                "description": "条件を1つ以上、アクションを必須で指定します。複数条件はすべてANDで評価されます。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "domain": {
                                        "type": "string",
                                        "description": "ドメイン（最大253文字。日本語ドメインの場合はPunycodeで指定）"
                                    },
                                    "conditions": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "keyword": {
                                                    "type": "string",
                                                    "description": "マッチさせるキーワード"
                                                },
                                                "field": {
                                                    "type": "string",
                                                    "description": "対象フィールド。subject: 件名 / from: 差出人 / to: あて先 / body: 本文 / header: ヘッダー全体"
                                                },
                                                "match_type": {
                                                    "type": "string",
                                                    "description": "一致条件。contain: キーワードを含む / match: キーワードと完全一致 / start_from: キーワードから始まる"
                                                }
                                            }
                                        }
                                    },
                                    "action": {
                                        "type": "object",
                                        "properties": {
                                            "type": {
                                                "type": "string",
                                                "description": "転送先種別。mail_address: 指定メールアドレスに転送 / spam_folder: 迷惑メールフォルダに振り分け / trash: ゴミ箱に振り分け / delete: メールを削除"
                                            },
                                            "target": {
                                                "type": "string",
                                                "description": "転送先メールアドレス。type が mail_address の場合に指定（それ以外では省略可）"
                                            },
                                            "method": {
                                                "type": "string",
                                                "description": "処理方法。move: 転送（元のメールボックスには残さない） / copy: コピー転送（元のメールボックスにも残す）"
                                            }
                                        }
                                    }
                                },
                                "required": [
                                    "domain",
                                    "conditions",
                                    "action"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "string",
                                            "description": "追加された振り分けルールのID"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/mail-filter/{filter_id}": {
            "delete": {
                "tags": [
                    "メール振り分け"
                ],
                "summary": "振り分け設定を削除",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "filter_id",
                        "in": "path",
                        "required": true,
                        "description": "振り分けルールのID（一覧取得で得られる id）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/ftp": {
            "get": {
                "tags": [
                    "FTPアカウント"
                ],
                "summary": "FTPアカウント一覧を取得",
                "description": "登録済みFTPアカウントを一覧で返します。メインアカウントは含まれません。domain を指定すると、そのドメインのアカウントのみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象のドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定。サブドメインでの絞り込みには対応していません）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "accounts": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "ftp_account": {
                                                        "type": "string",
                                                        "description": "FTPアカウント（user@domain 形式）"
                                                    },
                                                    "directory": {
                                                        "type": "string",
                                                        "description": "アクセス先ディレクトリ"
                                                    },
                                                    "quota_mb": {
                                                        "type": "integer",
                                                        "description": "容量制限（MB。0 は無制限）"
                                                    },
                                                    "memo": {
                                                        "type": "string",
                                                        "description": "メモ"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "FTPアカウント"
                ],
                "summary": "FTPアカウントを追加",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "ftp_account": {
                                        "type": "string",
                                        "description": "FTPアカウント（user@domain 形式。例: ftpuser@example.com）",
                                        "example": "ftpuser@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "パスワード（8文字以上）",
                                        "example": "FtpPass123!"
                                    },
                                    "directory": {
                                        "type": "string",
                                        "description": "ディレクトリ（デフォルト: /）",
                                        "example": "/public_html"
                                    },
                                    "quota_mb": {
                                        "type": "integer",
                                        "description": "容量(MB)",
                                        "example": 5000
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "開発用"
                                    }
                                },
                                "required": [
                                    "ftp_account",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ftp_account": {
                                            "type": "string",
                                            "description": "作成されたFTPアカウント（user@domain 形式）"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/ftp/{ftp_account}": {
            "put": {
                "tags": [
                    "FTPアカウント"
                ],
                "summary": "FTPアカウントを変更",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "ftp_account",
                        "in": "path",
                        "required": true,
                        "description": "FTPアカウント（user@domain 形式）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string",
                                        "description": "パスワード（8文字以上）",
                                        "example": "NewFtpPass456!"
                                    },
                                    "directory": {
                                        "type": "string",
                                        "description": "ディレクトリ",
                                        "example": "/public_html"
                                    },
                                    "quota_mb": {
                                        "type": "integer",
                                        "description": "容量(MB)",
                                        "example": 1000
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "本番用"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "FTPアカウント"
                ],
                "summary": "FTPアカウントを削除",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "ftp_account",
                        "in": "path",
                        "required": true,
                        "description": "FTPアカウント",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/db": {
            "get": {
                "tags": [
                    "MySQL"
                ],
                "summary": "データベース一覧を取得",
                "description": "MySQLデータベースの一覧を返します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "databases": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "db_name": {
                                                        "type": "string",
                                                        "description": "データベース名"
                                                    },
                                                    "version_name": {
                                                        "type": "string",
                                                        "description": "バージョン表示名（例: MariaDB10.5）"
                                                    },
                                                    "size_mb": {
                                                        "type": "number",
                                                        "description": "データベースサイズ（MB）"
                                                    },
                                                    "granted_users": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        },
                                                        "description": "アクセス権限を持つMySQLユーザー名の配列"
                                                    },
                                                    "memo": {
                                                        "type": "string",
                                                        "description": "メモ"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "MySQL"
                ],
                "summary": "データベースを作成",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name_suffix": {
                                        "type": "string",
                                        "description": "データベース名のサフィックス（サーバーID_に続く部分、例: db01 → xs123456_db01）",
                                        "example": "db01"
                                    },
                                    "character_set": {
                                        "type": "string",
                                        "description": "文字コード（省略時 utf8mb4）。utf8mb4 / UTF-8 / EUC-JP / SHIFT-JIS / Binary",
                                        "example": "utf8mb4"
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "本番用DB"
                                    }
                                },
                                "required": [
                                    "name_suffix"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "db_name": {
                                            "type": "string",
                                            "description": "作成されたデータベース名（サーバーID_サフィックス）"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/db/{db_name}": {
            "put": {
                "tags": [
                    "MySQL"
                ],
                "summary": "データベースのメモを更新",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "db_name",
                        "in": "path",
                        "required": true,
                        "description": "データベース名",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "本番用DB"
                                    }
                                },
                                "required": [
                                    "memo"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "MySQL"
                ],
                "summary": "データベースを削除",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "db_name",
                        "in": "path",
                        "required": true,
                        "description": "データベース名",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/db/user": {
            "get": {
                "tags": [
                    "MySQL"
                ],
                "summary": "MySQLユーザー一覧を取得",
                "description": "MySQLユーザーの一覧を返します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "users": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "db_user": {
                                                        "type": "string",
                                                        "description": "MySQLユーザー名"
                                                    },
                                                    "version_name": {
                                                        "type": "string",
                                                        "description": "バージョン表示名"
                                                    },
                                                    "memo": {
                                                        "type": "string",
                                                        "description": "メモ"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "MySQL"
                ],
                "summary": "MySQLユーザーを作成",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name_suffix": {
                                        "type": "string",
                                        "description": "ユーザー名のサフィックス（サーバーID_に続く部分、例: user01 → xs123456_user01）",
                                        "example": "user01"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "パスワード（8文字以上）",
                                        "example": "DbPass123!"
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "アプリ用ユーザー"
                                    }
                                },
                                "required": [
                                    "name_suffix",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "db_user": {
                                            "type": "string",
                                            "description": "作成されたMySQLユーザー名（サーバーID_サフィックス）"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/db/user/{db_user}": {
            "put": {
                "tags": [
                    "MySQL"
                ],
                "summary": "MySQLユーザーを変更",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "db_user",
                        "in": "path",
                        "required": true,
                        "description": "MySQLユーザー名",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "password": {
                                        "type": "string",
                                        "description": "パスワード（8文字以上）",
                                        "example": "NewDbPass456!"
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "WP用ユーザー"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "MySQL"
                ],
                "summary": "MySQLユーザーを削除",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "db_user",
                        "in": "path",
                        "required": true,
                        "description": "MySQLユーザー名",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/db/user/{db_user}/grant": {
            "get": {
                "tags": [
                    "MySQL"
                ],
                "summary": "データベース権限を取得",
                "description": "指定したMySQLユーザーがアクセス権限を持つデータベースの一覧を返します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "db_user",
                        "in": "path",
                        "required": true,
                        "description": "MySQLユーザー名",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "databases": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "description": "アクセス権限を持つデータベース名の配列"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "MySQL"
                ],
                "summary": "データベース権限を付与",
                "description": "指定したMySQLユーザーにデータベースへのアクセス権限を付与します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "db_user",
                        "in": "path",
                        "required": true,
                        "description": "MySQLユーザー名",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "db_name": {
                                        "type": "string",
                                        "description": "データベース名",
                                        "example": "xs123456_db01"
                                    }
                                },
                                "required": [
                                    "db_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "MySQL"
                ],
                "summary": "データベース権限を削除",
                "description": "指定したMySQLユーザーからデータベースへのアクセス権限を削除します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "db_user",
                        "in": "path",
                        "required": true,
                        "description": "MySQLユーザー名",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "db_name": {
                                        "type": "string",
                                        "description": "データベース名",
                                        "example": "xs123456_db01"
                                    }
                                },
                                "required": [
                                    "db_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/php-version": {
            "get": {
                "tags": [
                    "PHPバージョン"
                ],
                "summary": "PHPバージョン設定を取得",
                "description": "選択可能なPHPバージョン一覧と、ドメインごとの現在のバージョンを返します。domain を指定すると、そのドメインの情報のみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象のドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定。サブドメインでの絞り込みには対応していません）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "available_versions": {
                                            "type": "object",
                                            "description": "選択可能なPHPバージョン。キーがバージョン番号、値が表示名称（例: {\"8.3\": \"PHP8.3.21\", \"8.2\": \"PHP8.2.28\"}）",
                                            "additionalProperties": {
                                                "type": "string"
                                            }
                                        },
                                        "domains": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "domain": {
                                                        "type": "string",
                                                        "description": "ドメイン名"
                                                    },
                                                    "current_version": {
                                                        "type": "string",
                                                        "description": "現在設定されているPHPバージョン"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/php-version/{domain}": {
            "put": {
                "tags": [
                    "PHPバージョン"
                ],
                "summary": "PHPバージョンを変更",
                "description": "指定ドメインのPHPバージョンを変更します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "domain",
                        "in": "path",
                        "required": true,
                        "description": "ドメイン名（日本語ドメインの場合はPunycodeで指定）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "version": {
                                        "type": "string",
                                        "description": "PHPバージョン（例: 8.2）",
                                        "example": "8.2"
                                    }
                                },
                                "required": [
                                    "version"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/domain": {
            "get": {
                "tags": [
                    "ドメイン設定"
                ],
                "summary": "ドメイン一覧を取得",
                "description": "サーバーに追加済みのドメインの一覧を返します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "domains": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "domain": {
                                                        "type": "string",
                                                        "description": "ドメイン名"
                                                    },
                                                    "type": {
                                                        "type": "string",
                                                        "description": "ドメイン種別（例: addon = 追加ドメイン）"
                                                    },
                                                    "ssl": {
                                                        "type": "boolean",
                                                        "description": "SSL設定の有無"
                                                    },
                                                    "memo": {
                                                        "type": "string",
                                                        "description": "メモ"
                                                    },
                                                    "is_awaiting": {
                                                        "type": "boolean",
                                                        "description": "ドメイン設定反映待ちかどうか"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "ドメイン設定"
                ],
                "summary": "ドメインを追加",
                "description": "追加型ドメインをサーバーに追加します。追加時にドメイン所有権の確認（TXTレコード検証）が自動で実施されます。詳細は「ドメイン所有権確認」を参照してください。ssl を true にすると無料SSLも設定されます。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "domain": {
                                        "type": "string",
                                        "description": "ドメイン名",
                                        "example": "example.com"
                                    },
                                    "ssl": {
                                        "type": "boolean",
                                        "description": "SSL設定（デフォルト: true）",
                                        "example": true
                                    },
                                    "redirect_https": {
                                        "type": "boolean",
                                        "description": "HTTPS転送設定（デフォルト: ssl と同じ値）",
                                        "example": true
                                    },
                                    "ai_crawler_block_enabled": {
                                        "type": "boolean",
                                        "description": "AIクローラー遮断設定（デフォルト: true）",
                                        "example": true
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": ""
                                    }
                                },
                                "required": [
                                    "domain"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "domain": {
                                            "type": "string",
                                            "description": "追加されたドメイン名"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        },
                                        "ssl_status": {
                                            "type": "string",
                                            "description": "SSL設定結果（ssl=true 指定時のみ）。success: 成功 / failed: 失敗 / failed_nameserver: ネームサーバー未設定のため失敗"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/domain/{domain}": {
            "get": {
                "tags": [
                    "ドメイン設定"
                ],
                "summary": "ドメイン詳細を取得",
                "description": "ドキュメントルート、PHPバージョン、SSL設定状況を含む詳細情報を返します。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "domain",
                        "in": "path",
                        "required": true,
                        "description": "ドメイン名（日本語ドメインの場合はPunycodeで指定。URLエンコードすること）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "domain": {
                                            "type": "string",
                                            "description": "ドメイン名"
                                        },
                                        "type": {
                                            "type": "string",
                                            "description": "ドメイン種別（例: addon = 追加ドメイン）"
                                        },
                                        "document_root": {
                                            "type": "string",
                                            "description": "ドキュメントルートの絶対パス"
                                        },
                                        "url": {
                                            "type": "string",
                                            "description": "サイトURL（SSL設定時は https）"
                                        },
                                        "php_version": {
                                            "type": "string",
                                            "description": "現在のPHPバージョン（例: 8.3）"
                                        },
                                        "ssl": {
                                            "type": "boolean",
                                            "description": "SSL証明書が設定されているかどうか"
                                        },
                                        "memo": {
                                            "type": "string",
                                            "description": "メモ"
                                        },
                                        "is_awaiting": {
                                            "type": "boolean",
                                            "description": "ドメイン設定反映待ちかどうか"
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "description": "追加日"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "put": {
                "tags": [
                    "ドメイン設定"
                ],
                "summary": "ドメインのメモを更新",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "domain",
                        "in": "path",
                        "required": true,
                        "description": "ドメイン名（日本語ドメインの場合はPunycodeで指定）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "メインサイト"
                                    }
                                },
                                "required": [
                                    "memo"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "ドメイン設定"
                ],
                "summary": "ドメインを削除",
                "description": "ドメインを削除します。delete_files を true にすると、ユーザー公開領域のドメインディレクトリも合わせて削除します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "domain",
                        "in": "path",
                        "required": true,
                        "description": "ドメイン名（日本語ドメインの場合はPunycodeで指定）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "delete_files": {
                                        "type": "boolean",
                                        "description": "ユーザー公開領域のドメインディレクトリも削除するか（デフォルト: false）",
                                        "example": false
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/domain/{domain}/reset": {
            "post": {
                "tags": [
                    "ドメイン設定"
                ],
                "summary": "ドメイン設定を初期化",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "domain",
                        "in": "path",
                        "required": true,
                        "description": "ドメイン名（日本語ドメインの場合はPunycodeで指定）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "description": "リセット種別。all: 全初期化 / web: Web領域のみ初期化 / other: Web以外の設定を初期化",
                                        "example": "all"
                                    }
                                },
                                "required": [
                                    "type"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/subdomain": {
            "get": {
                "tags": [
                    "サブドメイン"
                ],
                "summary": "サブドメイン一覧を取得",
                "description": "登録済みサブドメインの一覧を返します。domain を指定すると、その親ドメインのサブドメインのみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象の親ドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "subdomains": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "subdomain": {
                                                        "type": "string",
                                                        "description": "サブドメイン名（FQDN 形式。例: blog.example.com）"
                                                    },
                                                    "domain": {
                                                        "type": "string",
                                                        "description": "親ドメイン名"
                                                    },
                                                    "document_root": {
                                                        "type": "string",
                                                        "description": "ドキュメントルートのパス"
                                                    },
                                                    "ssl": {
                                                        "type": "boolean",
                                                        "description": "SSL設定の有無"
                                                    },
                                                    "memo": {
                                                        "type": "string",
                                                        "description": "メモ"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "サブドメイン"
                ],
                "summary": "サブドメインを追加",
                "description": "短時間に連続して作成すると、一時的にエラーが返る場合があります。間隔をあけて再試行してください。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subdomain": {
                                        "type": "string",
                                        "description": "サブドメイン（例: blog.example.com）。日本語ドメインの場合はドメイン部分をPunycodeで指定",
                                        "example": "blog.example.com"
                                    },
                                    "ssl": {
                                        "type": "boolean",
                                        "description": "SSL設定（デフォルト: true）",
                                        "example": true
                                    },
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "ブログ用"
                                    }
                                },
                                "required": [
                                    "subdomain"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "subdomain": {
                                            "type": "string",
                                            "description": "追加されたサブドメイン（FQDN 形式）"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        },
                                        "ssl_status": {
                                            "type": "string",
                                            "description": "SSL設定結果（ssl=true 指定時のみ）。success: 成功 / failed: 失敗 / failed_nameserver: ネームサーバー未設定のため失敗"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/subdomain/{subdomain}": {
            "put": {
                "tags": [
                    "サブドメイン"
                ],
                "summary": "サブドメインのメモを更新",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。更新するフィールドが1つも指定されなかった場合は422を返します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "subdomain",
                        "in": "path",
                        "required": true,
                        "description": "サブドメイン（日本語ドメインの場合はドメイン部分をPunycodeで指定）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "memo": {
                                        "type": "string",
                                        "description": "メモ",
                                        "example": "ブログ用"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "サブドメイン"
                ],
                "summary": "サブドメインを削除",
                "description": "サブドメインを削除します。delete_files を true にすると、ユーザー公開領域のサブドメインディレクトリも合わせて削除します。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "subdomain",
                        "in": "path",
                        "required": true,
                        "description": "サブドメイン（日本語ドメインの場合はドメイン部分をPunycodeで指定）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "delete_files": {
                                        "type": "boolean",
                                        "description": "ユーザー公開領域のサブドメインディレクトリも削除するか（デフォルト: false）",
                                        "example": false
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/ssl": {
            "get": {
                "tags": [
                    "SSL設定"
                ],
                "summary": "SSL設定一覧を取得",
                "description": "無料SSL（Let's Encrypt）およびオプションSSLの一覧を返します。domain を指定すると、そのドメインの証明書のみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象のドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定。サブドメインでの絞り込みには対応していません）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "ssl_list": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "description": "SSL設定のID"
                                                    },
                                                    "common_name": {
                                                        "type": "string",
                                                        "description": "コモンネーム（ドメイン名）"
                                                    },
                                                    "type": {
                                                        "type": "string",
                                                        "description": "証明書種別。letsencrypt: 無料SSL（Let's Encrypt） / option: オプション独自SSL"
                                                    },
                                                    "expires_at": {
                                                        "type": "string",
                                                        "description": "有効期限（ISO 8601形式）"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "description": "状態。active: 有効 / expired: 期限切れ"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "SSL設定"
                ],
                "summary": "無料SSLをインストール",
                "description": "指定ドメインに対して無料SSL証明書（Let's Encrypt）を発行・インストールします。対象ドメインのネームサーバーが当社ネームサーバーの場合のみ利用可能です。外部ネームサーバーを利用中の場合はサーバーパネルから操作してください。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "common_name": {
                                        "type": "string",
                                        "description": "コモンネーム（ドメイン名。日本語ドメインの場合はPunycodeで指定）",
                                        "example": "example.com"
                                    }
                                },
                                "required": [
                                    "common_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/ssl/{common_name}": {
            "delete": {
                "tags": [
                    "SSL設定"
                ],
                "summary": "無料SSLをアンインストール",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "common_name",
                        "in": "path",
                        "required": true,
                        "description": "Common Name（日本語ドメインの場合はPunycodeで指定）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/dns": {
            "get": {
                "tags": [
                    "DNSレコード"
                ],
                "summary": "DNSレコード一覧を取得",
                "description": "ドメインに登録されたDNSレコードを一覧で返します。domain を指定すると、そのドメインのレコードのみに絞り込めます。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込み対象のドメイン（省略時は全ドメイン。日本語ドメインの場合はPunycodeで指定。サブドメインでの絞り込みには対応していません）"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "records": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "description": "DNSレコードID（PUT/DELETEで使用）"
                                                    },
                                                    "domain": {
                                                        "type": "string",
                                                        "description": "対象ドメイン"
                                                    },
                                                    "host": {
                                                        "type": "string",
                                                        "description": "ホスト名（@ は apex）"
                                                    },
                                                    "type": {
                                                        "type": "string",
                                                        "description": "レコードタイプ。A / AAAA / CNAME / MX / TXT / SRV / CAA"
                                                    },
                                                    "content": {
                                                        "type": "string",
                                                        "description": "レコードの値"
                                                    },
                                                    "ttl": {
                                                        "type": "integer",
                                                        "description": "TTL（秒）"
                                                    },
                                                    "priority": {
                                                        "type": "integer",
                                                        "description": "MX/SRVレコードの優先度。それ以外のレコードでは 0"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "post": {
                "tags": [
                    "DNSレコード"
                ],
                "summary": "DNSレコードを追加",
                "description": "A, AAAA, CNAME, MX, TXT 等のレコードを追加します。MX の場合は priority を指定できます。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "domain": {
                                        "type": "string",
                                        "description": "ドメイン（最大253文字。日本語ドメインの場合はPunycodeで指定）",
                                        "example": "example.com"
                                    },
                                    "host": {
                                        "type": "string",
                                        "description": "ホスト名（@ で apex、最大255文字）",
                                        "example": "www"
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "レコードタイプ。A / AAAA / CNAME / MX / TXT / SRV / CAA",
                                        "example": "A"
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "内容",
                                        "example": "192.0.2.1"
                                    },
                                    "ttl": {
                                        "type": "integer",
                                        "description": "TTL（60-86400。省略時 3600）",
                                        "example": 3600
                                    },
                                    "priority": {
                                        "type": "integer",
                                        "description": "MX レコードの優先度",
                                        "example": 10
                                    }
                                },
                                "required": [
                                    "domain",
                                    "host",
                                    "type",
                                    "content"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "description": "追加されたDNSレコードのID（PUT/DELETEで使用）"
                                        },
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/dns/{dns_id}": {
            "put": {
                "tags": [
                    "DNSレコード"
                ],
                "summary": "DNSレコードを更新",
                "description": "送信した項目のみ更新され、省略した項目は現在の設定が維持されます。空文字を明示送信した場合は空で上書きされます。レコードを自動解決できない場合は domain, host, type, content の指定が必要です。",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "dns_id",
                        "in": "path",
                        "required": true,
                        "description": "DNSレコードID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "domain": {
                                        "type": "string",
                                        "description": "ドメイン（日本語ドメインの場合はPunycodeで指定）",
                                        "example": "example.com"
                                    },
                                    "host": {
                                        "type": "string",
                                        "description": "ホスト名",
                                        "example": "www"
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "レコードタイプ",
                                        "example": "A"
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "内容",
                                        "example": "192.0.2.1"
                                    },
                                    "ttl": {
                                        "type": "integer",
                                        "description": "TTL（60-86400）",
                                        "example": 3600
                                    },
                                    "priority": {
                                        "type": "integer",
                                        "description": "MXレコードの優先度（省略時は現在の設定を維持）",
                                        "example": 10
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            },
            "delete": {
                "tags": [
                    "DNSレコード"
                ],
                "summary": "DNSレコードを削除",
                "x-scope": "書き込み",
                "parameters": [
                    {
                        "name": "dns_id",
                        "in": "path",
                        "required": true,
                        "description": "DNSレコードID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "処理結果メッセージ"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "409": {
                        "description": "サーバー側の制約により操作を完了できなかった（OPERATION_ERROR）"
                    },
                    "422": {
                        "description": "バリデーションエラー（VALIDATION_ERROR）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/access-log": {
            "get": {
                "tags": [
                    "アクセスログ"
                ],
                "summary": "アクセスログを取得",
                "description": "指定ドメインのアクセスログを取得します。lines で末尾からの取得行数、keyword で絞り込みが可能です。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "ドメイン（日本語ドメインの場合はPunycodeで指定）"
                        }
                    },
                    {
                        "name": "lines",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "description": "取得行数（末尾から。省略時は全件）"
                        }
                    },
                    {
                        "name": "keyword",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込みキーワード"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "domain": {
                                            "type": "string",
                                            "description": "対象ドメイン"
                                        },
                                        "log": {
                                            "type": "string",
                                            "description": "アクセスログ本文（改行区切り）"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        },
        "/v1/server/{servername}/error-log": {
            "get": {
                "tags": [
                    "エラーログ"
                ],
                "summary": "エラーログを取得",
                "description": "指定ドメインのエラーログを取得します。lines で末尾からの取得行数、keyword で絞り込みが可能です。",
                "x-scope": "読み取り",
                "parameters": [
                    {
                        "name": "servername",
                        "in": "path",
                        "required": true,
                        "description": "サーバー名（初期ドメイン）",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "description": "ドメイン（日本語ドメインの場合はPunycodeで指定）"
                        }
                    },
                    {
                        "name": "lines",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "integer",
                            "description": "取得行数（末尾から）"
                        }
                    },
                    {
                        "name": "keyword",
                        "in": "query",
                        "required": false,
                        "schema": {
                            "type": "string",
                            "description": "絞り込みキーワード"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "domain": {
                                            "type": "string",
                                            "description": "対象ドメイン"
                                        },
                                        "log": {
                                            "type": "string",
                                            "description": "エラーログ本文（改行区切り）"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "リクエストの形式が不正（BAD_REQUEST）"
                    },
                    "401": {
                        "description": "認証エラー（UNAUTHORIZED）"
                    },
                    "403": {
                        "description": "権限不足またはIP制限（FORBIDDEN）"
                    },
                    "404": {
                        "description": "リソースまたはエンドポイントが見つからない（NOT_FOUND）"
                    },
                    "429": {
                        "description": "レート制限超過（RATE_LIMIT_EXCEEDED）"
                    },
                    "500": {
                        "description": "サーバー内部エラー（INTERNAL_ERROR）"
                    },
                    "502": {
                        "description": "バックエンド通信エラー（BACKEND_ERROR）"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "BearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "APIキーを Bearer トークンとして送信"
            }
        }
    }
}