{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vpsnet-com/json-schema/vpsnet-com-account-event-response-schema.json",
  "title": "AccountEventResponse",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vpsnet-com-openapi.yml#/components/schemas/AccountEventResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "state": {
      "type": [
        "string",
        "null"
      ],
      "description": "created, proccessing, completed or error."
    },
    "message": {
      "type": [
        "string",
        "null"
      ]
    },
    "payload": {
      "description": "Decoded operation payload; secret-looking keys are redacted unless the key holds the matching manage scope.",
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": true
    },
    "guestConfig": {
      "type": [
        "object",
        "null"
      ],
      "description": "Guest configuration files the action left alone because you changed them yourself, or the guest agent update the action needs; null for every other event.",
      "required": [
        "code",
        "files",
        "offlineRetryAvailable"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "guest_config_customer_managed",
            "guest_agent_update_required",
            "guest_config_offline_apply"
          ]
        },
        "offlineRetryAvailable": {
          "type": "boolean",
          "description": "The same change applies while the server is stopped (hostname and nameserver changes refused with guest_agent_update_required)."
        },
        "files": {
          "type": "array",
          "maxItems": 8,
          "description": "Empty unless the full payload is returned.",
          "items": {
            "type": "object",
            "required": [
              "step",
              "paths",
              "snippets"
            ],
            "properties": {
              "step": {
                "type": "string"
              },
              "paths": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "snippets": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "path",
                    "content"
                  ],
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string",
                      "description": "The exact lines the platform would have written; empty when too large to return."
                    }
                  }
                }
              }
            }
          }
        },
        "offlineApply": {
          "type": "object",
          "description": "Only on the event of a bound offline action (offline_confirmed): stop, the change while stopped, start again.",
          "required": [
            "state",
            "outcome",
            "errorCode",
            "changeErrorCode",
            "serverStopped",
            "serverStarted"
          ],
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "accepted",
                "stopping",
                "applying",
                "starting",
                "completed",
                "failed"
              ]
            },
            "outcome": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "applied",
                "not_applied",
                "refused",
                null
              ],
              "description": "Null until the action ends."
            },
            "errorCode": {
              "type": [
                "string",
                "null"
              ],
              "description": "The refusal's own code (refused: serviceSuspended, serviceNotActive, actionInProgress, invalidAction, a private-primary lifecycle code, guest_config_offline_unavailable), the change's code (not_applied, e.g. guest_config_customer_managed, guest_config_offline_stop_failed, guest_config_offline_change_failed) or guest_config_offline_start_failed (the server is still stopped)."
            },
            "changeErrorCode": {
              "type": [
                "string",
                "null"
              ],
              "description": "Why the change itself was not applied, also when errorCode is the start failure."
            },
            "serverStopped": {
              "type": "boolean",
              "description": "The action stopped the server (false when it was already stopped)."
            },
            "serverStarted": {
              "type": [
                "boolean",
                "null"
              ],
              "description": "The stopped server runs again; null when the action did not stop it or has not ended."
            }
          }
        }
      }
    }
  }
}