{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pentest-tools-com/json-schema/pentest-tools-com-scan-schema.json",
  "title": "Scan",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pentest-tools-com-openapi.yml#/components/schemas/Scan",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "readOnly": true,
      "type": "integer"
    },
    "tool_id": {
      "type": "integer"
    },
    "target_id": {
      "type": "integer",
      "description": "only one of `target_id` and `target_name` should be used"
    },
    "target_name": {
      "type": [
        "string",
        "null"
      ],
      "writeOnly": true,
      "description": "only one of `target_id` and `target_name` should be used"
    },
    "workspace_id": {
      "type": [
        "integer",
        "null"
      ],
      "writeOnly": true,
      "description": "Workspace where the scan is started. It has to match the workspace ID of the target"
    },
    "vpn_profile_uuid": {
      "type": [
        "string",
        "null"
      ],
      "writeOnly": true,
      "description": "VPN profile to use for the scan. If null, there will be no VPN profile used. If not specified, the profile attached to the workspace will be used."
    },
    "status_name": {
      "type": "string",
      "enum": [
        "running",
        "finished",
        "failed to start",
        "stopped",
        "timed out",
        "waiting",
        "aborted",
        "VPN connection error",
        "auth failed",
        "connection error"
      ],
      "readOnly": true
    },
    "vpn_scan": {
      "type": "boolean",
      "readOnly": true
    },
    "max_scan_time": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1440,
      "default": 1440,
      "writeOnly": true,
      "description": "Maximum number of minutes that the scan should run. Not supported by: Sniper, tools with short scan duration (like Website Recon or ICMP Ping)."
    },
    "report_callback": {
      "type": "object",
      "description": "Send the report in a specific format to this URL when the scan finishes",
      "writeOnly": true,
      "properties": {
        "url": {
          "type": "string",
          "format": "url",
          "description": "Send the report to this URL when the scan finishes"
        },
        "format": {
          "type": "string",
          "description": "Send the report in a specific format",
          "default": "raw_status",
          "enum": [
            "raw_json",
            "raw_status",
            "pdf_report"
          ]
        }
      },
      "required": [
        "url"
      ]
    },
    "progress": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "readOnly": true,
      "description": "Current progress of the scan"
    },
    "result_summary": {
      "type": [
        "object",
        "null"
      ],
      "readOnly": true,
      "properties": {
        "text": {
          "type": [
            "string",
            "null"
          ],
          "description": "A text description of the summary. Present for discovery scanners"
        },
        "critical": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Number of critical risk vulnerabilities. `null` for discovery scanners"
        },
        "high": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Number of high risk vulnerabilities. `null` for discovery scanners"
        },
        "medium": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Number of medium risk vulnerabilities. `null` for discovery scanners"
        },
        "low": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Number of low risk vulnerabilities. `null` for discovery scanners"
        },
        "info": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Number of informational findings. `null` for discovery scanners"
        }
      }
    },
    "start_time": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "end_time": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "End time of the scan. `null` if the scan is not finished"
    },
    "duration": {
      "type": "integer",
      "readOnly": true,
      "description": "Duration of the scan in seconds"
    },
    "num_tests": {
      "deprecated": true,
      "type": "integer",
      "readOnly": true,
      "description": "This field is deprecated and will be removed in a future version. Use `/scans/{id}/tests` instead.\nNumber of tests run by the scanner. Always `1` for discovery scanners.\n"
    },
    "num_finished_tests": {
      "deprecated": true,
      "type": "integer",
      "readOnly": true,
      "description": "This field is deprecated and will be removed in a future version. Use `/scans/{id}/tests` instead.\nNumber of currently finished tests. This should be equal to `num_tests` for successfully finished scans.\n"
    },
    "status_message": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "Message describing the current status of the scan. This is `null` if the scan is not currently running."
    },
    "info_text_lines": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "readOnly": true,
      "description": "Informational messages about the scan as a whole, such as a warning that the host may be down or blocked by a firewall when no open ports were found. Empty when there are no messages."
    },
    "scan_original_url": {
      "type": "boolean",
      "default": false,
      "writeOnly": true,
      "description": "If `true`, the original URL is passed to the scanner, even if it redirects. If `false`, the redirected URL will be scanned instead.\n"
    },
    "redirect_level": {
      "type": "string",
      "default": "same_domain",
      "enum": [
        "none",
        "check_accessibility",
        "same_host",
        "same_domain",
        "allow_all"
      ],
      "writeOnly": true,
      "description": "Possible values:\n  * `none` - the target is passed directly to the scanner\n  * `check_accessibility` - the target is checked for accessibility and an error is thrown on any redirect\n  * `same_host` - only redirects within the same host are allowed\n  * `same_domain` - redirects to subdomains are allowed\n  * `allow_all` - any redirects are allowed\n"
    }
  },
  "required": [
    "tool_id"
  ]
}