{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/prowlarr/json-schema/prowlarr-command-resource-schema.json",
  "title": "CommandResource",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/prowlarr-openapi.json#/components/schemas/CommandResource",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int32"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "commandName": {
      "type": [
        "string",
        "null"
      ]
    },
    "message": {
      "type": [
        "string",
        "null"
      ]
    },
    "body": {
      "$ref": "#/$defs/Command"
    },
    "priority": {
      "$ref": "#/$defs/CommandPriority"
    },
    "status": {
      "$ref": "#/$defs/CommandStatus"
    },
    "queued": {
      "type": "string",
      "format": "date-time"
    },
    "started": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "ended": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "duration": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-span"
    },
    "exception": {
      "type": [
        "string",
        "null"
      ]
    },
    "trigger": {
      "$ref": "#/$defs/CommandTrigger"
    },
    "clientUserAgent": {
      "type": [
        "string",
        "null"
      ]
    },
    "stateChangeTime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "sendUpdatesToClient": {
      "type": "boolean"
    },
    "updateScheduledTask": {
      "type": "boolean"
    },
    "lastExecutionTime": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Command": {
      "type": "object",
      "properties": {
        "sendUpdatesToClient": {
          "type": "boolean"
        },
        "updateScheduledTask": {
          "type": "boolean",
          "readOnly": true
        },
        "completionMessage": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "requiresDiskAccess": {
          "type": "boolean",
          "readOnly": true
        },
        "isExclusive": {
          "type": "boolean",
          "readOnly": true
        },
        "isTypeExclusive": {
          "type": "boolean",
          "readOnly": true
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true
        },
        "lastExecutionTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "lastStartTime": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "trigger": {
          "$ref": "#/$defs/CommandTrigger"
        },
        "suppressMessages": {
          "type": "boolean"
        },
        "clientUserAgent": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "CommandPriority": {
      "enum": [
        "normal",
        "high",
        "low"
      ],
      "type": "string"
    },
    "CommandStatus": {
      "enum": [
        "queued",
        "started",
        "completed",
        "failed",
        "aborted",
        "cancelled",
        "orphaned"
      ],
      "type": "string"
    },
    "CommandTrigger": {
      "enum": [
        "unspecified",
        "manual",
        "scheduled"
      ],
      "type": "string"
    }
  }
}