{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/x-road-global/json-schema/x-road-global-management-request-schema.json",
  "title": "ManagementRequest",
  "description": "Management request",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/x-road-global-central-server-admin-openapi.yml#/components/schemas/ManagementRequest",
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/ModificationTimestamps"
    }
  ],
  "properties": {
    "id": {
      "type": "integer",
      "description": "request id",
      "readOnly": true
    },
    "type": {
      "$ref": "#/$defs/ManagementRequestType"
    },
    "origin": {
      "$ref": "#/$defs/ManagementRequestOrigin"
    },
    "security_server_owner": {
      "type": "string",
      "readOnly": true
    },
    "security_server_id": {
      "type": "string",
      "description": "Encoded Security Server ID"
    },
    "status": {
      "$ref": "#/$defs/ManagementRequestStatus"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    }
  },
  "required": [
    "type",
    "origin",
    "security_server_id"
  ],
  "$defs": {
    "ManagementRequestOrigin": {
      "type": "string",
      "description": "request source",
      "enum": [
        "CENTER",
        "SECURITY_SERVER"
      ]
    },
    "ManagementRequestStatus": {
      "type": "string",
      "readOnly": true,
      "description": "request status",
      "enum": [
        "WAITING",
        "APPROVED",
        "DECLINED",
        "REVOKED",
        "SUBMITTED FOR APPROVAL"
      ]
    },
    "ManagementRequestType": {
      "type": "string",
      "enum": [
        "AUTH_CERT_REGISTRATION_REQUEST",
        "CLIENT_REGISTRATION_REQUEST",
        "OWNER_CHANGE_REQUEST",
        "CLIENT_DELETION_REQUEST",
        "CLIENT_DISABLE_REQUEST",
        "CLIENT_ENABLE_REQUEST",
        "CLIENT_RENAME_REQUEST",
        "AUTH_CERT_DELETION_REQUEST",
        "ADDRESS_CHANGE_REQUEST",
        "SYSTEM_DID_REGISTRATION_REQUEST",
        "MEMBER_DID_REGISTRATION_REQUEST",
        "MAINTENANCE_MODE_ENABLE_REQUEST",
        "MAINTENANCE_MODE_DISABLE_REQUEST"
      ]
    },
    "ModificationTimestamps": {
      "description": "created_at and updated_at timestamps",
      "properties": {
        "created_at": {
          "description": "object creation time",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "updated_at": {
          "description": "last time updated",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}