{
  "openapi": "3.1.0",
  "info": {
    "title": "MindFort API",
    "version": "1.0.0",
    "description": "The MindFort Public API supports targets, Discovery, assessments, finding lifecycle and analytics, and reports. Informational probe results are labeled `secured`."
  },
  "servers": [
    {
      "url": "https://api.mindfort.app",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/discovery": {
      "get": {
        "operationId": "getDiscoveryStatus",
        "summary": "Get Discovery Status",
        "description": "Returns your organization's Discovery status, including the schedule, the active and last runs, the number of pending suggestions, and the context note.",
        "tags": ["Discovery"],
        "responses": {"200": {"description": "Discovery status", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicDiscoveryStatus"}}}}}
      }
    },
    "/v1/discovery/schedule": {
      "put": {
        "operationId": "updateDiscoverySchedule",
        "summary": "Update Discovery Schedule",
        "description": "Enables, disables, or changes the recurring Discovery schedule, including cadence, day of week, time of day, and timezone.",
        "tags": ["Discovery"],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/DiscoveryScheduleUpdate"}}}},
        "responses": {"200": {"description": "Updated Discovery schedule", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicDiscoveryScheduleResponse"}}}}}
      }
    },
    "/v1/discovery/context": {
      "put": {
        "operationId": "updateDiscoveryContext",
        "summary": "Update Discovery Context",
        "description": "Replaces the Discovery context note that tells MindFort which assets, domains, or environments to look for when it suggests new targets.",
        "tags": ["Discovery"],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"context_note": {"type": "string", "maxLength": 4000}}, "required": ["context_note"], "additionalProperties": false}}}},
        "responses": {"200": {"description": "Updated Discovery context", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicDiscoveryContextResponse"}}}}}
      }
    },
    "/v1/discovery/runs": {
      "post": {
        "operationId": "startDiscoveryRun",
        "summary": "Start Discovery Run",
        "description": "Starts an on-demand Discovery run that looks for candidate targets. Use the returned run_id with GET /v1/discovery to follow progress.",
        "tags": ["Discovery"],
        "responses": {"202": {"description": "Discovery run queued", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicDiscoveryRunResponse"}}}}}
      }
    },
    "/v1/discovery/runs/{run_id}/cancel": {
      "post": {
        "operationId": "cancelDiscoveryRun",
        "summary": "Cancel Discovery Run",
        "description": "Requests cancellation of an active Discovery run and returns the run ID with its updated status.",
        "tags": ["Discovery"],
        "parameters": [{"name": "run_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}],
        "responses": {"200": {"description": "Discovery run cancelled", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicDiscoveryCancelResponse"}}}}}
      }
    },
    "/v1/discovery/suggestions": {
      "get": {
        "operationId": "listDiscoverySuggestions",
        "summary": "List Discovery Suggestions",
        "description": "Lists candidate targets suggested by Discovery, optionally filtered by status, with cursor pagination.",
        "tags": ["Discovery"],
        "parameters": [
          {"name": "status", "in": "query", "required": false, "schema": {"type": "string", "enum": ["pending", "accepted", "dismissed", "superseded"], "default": "pending"}},
          {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "maximum": 200, "default": 100}},
          {"name": "cursor", "in": "query", "required": false, "schema": {"type": "string", "maxLength": 2048}}
        ],
        "responses": {"200": {"description": "Discovery suggestions", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicDiscoverySuggestionList"}}}}}
      }
    },
    "/v1/discovery/suggestions/{suggestion_id}/accept": {
      "post": {
        "operationId": "acceptDiscoverySuggestion",
        "summary": "Accept Discovery Suggestion",
        "description": "Accepts a Discovery suggestion and adds it to Target Inventory. Returns the newly created target.",
        "tags": ["Discovery"],
        "parameters": [{"name": "suggestion_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}],
        "responses": {"200": {"description": "Created target", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicTarget"}}}}}
      }
    },
    "/v1/discovery/suggestions/{suggestion_id}/dismiss": {
      "post": {
        "operationId": "dismissDiscoverySuggestion",
        "summary": "Dismiss Discovery Suggestion",
        "description": "Dismisses a Discovery suggestion so it no longer appears among pending candidate targets.",
        "tags": ["Discovery"],
        "parameters": [{"name": "suggestion_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}],
        "responses": {"200": {"description": "Dismissed Discovery suggestion", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicDiscoveryDismissResponse"}}}}}
      }
    },
    "/v1/assessments": {
      "get": {
        "operationId": "listAssessments",
        "summary": "List Assessments",
        "description": "Lists assessments for your organization. Results use cursor pagination and do not include a total count.",
        "tags": [
          "Assessments"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Filter by target UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "assessment_type",
            "in": "query",
            "required": false,
            "description": "Filter by assessment type. `white-box` returns assessments that include code assessment; `black-box` returns assessments that do not.",
            "schema": {
              "type": "string",
              "enum": [
                "black-box",
                "white-box"
              ]
            }
          },
          {
            "name": "assessment_method",
            "in": "query",
            "required": false,
            "description": "Filter by assessment method",
            "schema": {
              "type": "string",
              "enum": [
                "balanced",
                "deep",
                "ultra"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by assessment status",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "completed",
                "failed",
                "canceled"
              ]
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "description": "Sort field for cursor pagination",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "updated_at"
              ],
              "default": "created_at"
            }
          },
          {
            "name": "order_direction",
            "in": "query",
            "required": false,
            "description": "Sort direction for cursor pagination",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of assessments to return",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque URL-safe base64 cursor from `pagination.next_cursor`; it binds `order_by` and `order_direction` and carries the last `sort_at` and `id`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Assessments returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicAssessmentList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter, limit, or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "assessments:read"
      }
    },
    "/v1/assessments/run": {
      "post": {
        "operationId": "triggerAssessment",
        "summary": "Trigger Assessment",
        "description": "Requests a new security assessment against the specified target. Accepted assessments run asynchronously; review their status and available results in the MindFort dashboard.",
        "tags": [
          "Assessments"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TriggerAssessmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assessment triggered successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRunAssessmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Target not found or does not belong to this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Assessment could not be started because the target is not currently startable, for example when another assessment is already running",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Request could not be completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Request could not be completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "assessments:run"
      }
    },
    "/v1/assessments/{assessment_id}/cancel": {
      "post": {
        "operationId": "cancelAssessment",
        "summary": "Cancel Assessment",
        "description": "Requests cancellation of a running assessment. The assessment must belong to your organization.",
        "tags": [
          "Assessments"
        ],
        "parameters": [
          {
            "name": "assessment_id",
            "in": "path",
            "required": true,
            "description": "UUID of the assessment to cancel",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Assessment cancelled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCancelAssessmentResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid assessment_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Assessment not found or does not belong to this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Request could not be completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Request could not be completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "assessments:cancel"
      }
    },
    "/v1/targets": {
      "get": {
        "operationId": "listTargets",
        "summary": "List Targets",
        "description": "List all targets in your organization using limit and offset pagination to discover which applications and assets are available for testing.",
        "tags": [
          "Targets"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of targets to return",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of records to skip for offset pagination",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Targets returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTargetList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit or offset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "targets:read"
      },
      "post": {
        "operationId": "createTarget",
        "summary": "Create Target",
        "description": "Creates a Web Application, API, or Network target in your organization, optionally with credentials and API authentication instructions.",
        "tags": [
          "Targets"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTargetRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTarget"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A target already exists for this domain or IP address",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "targets:write"
      }
    },
    "/v1/findings": {
      "get": {
        "operationId": "listFindings",
        "summary": "List Findings",
        "description": "Lists security findings across your organization, optionally filtered by target and lifecycle status. Defaults to ACTIVE findings. Results include the current retest status, timestamps, and customer-visible failure reason when a retest could not execute. Results use offset pagination and include a total count.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optional target UUID to filter findings",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "assessment_id",
            "in": "query",
            "required": false,
            "description": "Filter findings to a specific assessment run",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "exclude_secured",
            "in": "query",
            "required": false,
            "description": "When true, omit secured probe findings",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Filter by severity. `info` is accepted as a deprecated alias for `secured`.",
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "high",
                "medium",
                "low",
                "secured",
                "info"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by finding lifecycle status",
            "schema": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "RESOLVED",
                "ARCHIVED"
              ],
              "default": "ACTIVE"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "description": "Sort mode for results",
            "schema": {
              "type": "string",
              "enum": [
                "severity",
                "created_at"
              ],
              "default": "severity"
            }
          },
          {
            "name": "order_direction",
            "in": "query",
            "required": false,
            "description": "Sort direction",
            "schema": {
              "type": "string",
              "enum": ["asc", "desc"],
              "default": "desc"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search finding ID, title, description, endpoint, or impact",
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "status_filter",
            "in": "query",
            "required": false,
            "description": "Filter by vulnerability status",
            "schema": {
              "type": "string",
              "enum": ["vulnerable", "secured", "all"]
            }
          },
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "description": "When true, return only active findings",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "org_wide",
            "in": "query",
            "required": false,
            "description": "Compatibility parameter. Results are organization-wide when target_id and assessment_id are omitted.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "assigned_to_me",
            "in": "query",
            "required": false,
            "description": "When true, return only findings assigned to the current user",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "assigned_to",
            "in": "query",
            "required": false,
            "description": "Filter by assignee user ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "unassigned",
            "in": "query",
            "required": false,
            "description": "When true, return only findings without an assignee",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "finding_type",
            "in": "query",
            "required": false,
            "description": "Finding type. Only red-team findings are available through the public API.",
            "schema": {
              "type": "string",
              "enum": ["red-team"]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of findings to return",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of records to skip for offset pagination",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Findings returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicFindingsList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid target_id, assessment_id, exclude_secured, severity, status, sort_by, limit, or offset",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:read"
      }
    },
    "/v1/findings/{finding_id}/status": {
      "post": {
        "operationId": "updateFindingStatus",
        "summary": "Update Finding Status",
        "description": "Update a finding to ACTIVE, RESOLVED, or ARCHIVED to track remediation progress across your organization.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "UUID of the finding",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFindingStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Finding status updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSingleFindingStatusResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid finding_id, request body, or status",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Finding not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:write"
      }
    },
    "/v1/findings/{finding_id}": {
      "get": {
        "operationId": "getFinding",
        "summary": "Get Finding",
        "description": "Retrieve full details for a single security finding, including its description, impact, evidence, reproduction approach, remediation advice, current status, and retest decision context such as why execution failed.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "UUID of the finding",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Finding returned successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicFinding"
                }
              }
            }
          },
          "400": {
            "description": "Invalid finding_id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized – missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Finding not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:read"
      }
    },
    "/v1/findings/patch-count": {
      "get": {
        "operationId": "getPatchCount",
        "summary": "Get Patch Count",
        "description": "Return the number of findings with a generated remediation patch.",
        "tags": ["Findings"],
        "responses": {
          "200": {"description": "Patch count returned", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicPatchCount"}}}}
        },
        "x-required-permission": "findings:read"
      }
    },
    "/v1/targets/email-credentials": {
      "post": {
        "operationId": "generateTargetEmailCredential",
        "summary": "Generate Target Email Credential",
        "description": "Generate a short-lived email address to register for a magic-link or email-MFA credential.",
        "tags": ["Credentials"],
        "responses": {
          "201": {"description": "Pending email generated", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicPendingEmail"}}}}
        },
        "x-required-permission": "targets:write"
      }
    },
    "/v1/targets/sms-credentials/access": {
      "get": {
        "operationId": "getSMSCredentialsAccess",
        "summary": "Get SMS Credential Access",
        "description": "Returns whether SMS credentials are enabled for your organization, so you can check before creating an SMS-based target credential.",
        "tags": ["Credentials"],
        "responses": {
          "200": {"description": "SMS credential entitlement returned", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicSMSCredentialsAccess"}}}}
        },
        "x-required-permission": "targets:read"
      }
    },
    "/v1/targets/sms-credentials/available-countries": {
      "get": {
        "operationId": "listSMSCredentialCountries",
        "summary": "List SMS Credential Countries",
        "description": "Lists the countries where MindFort can provision phone numbers for SMS-based target credentials.",
        "tags": ["Credentials"],
        "responses": {
          "200": {"description": "Supported countries returned", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicSMSAvailableCountries"}}}}
        },
        "x-required-permission": "targets:read"
      }
    },
    "/v1/targets/{target_id}/credentials": {
      "get": {
        "operationId": "listTargetCredentials",
        "summary": "List Target Credentials",
        "description": "Return credential metadata needed to select and use a configured flow. Stored passwords, API keys, TOTP seeds, inbox IDs, and cached one-time codes are never returned.",
        "tags": ["Credentials"],
        "parameters": [
          {"name": "target_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}},
          {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 25}},
          {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0}}
        ],
        "responses": {
          "200": {"description": "Credential metadata returned", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicTargetCredentialList"}}}}
        },
        "x-required-permission": "targets:read"
      },
      "post": {
        "operationId": "createTargetCredential",
        "summary": "Create Target Credential",
        "description": "Store a credential on a target. Email MFA requires pending_email_id; username and password are optional and should be supplied only when the target requests primary credentials. Before adding an api_key credential, the API target must already have non-empty api_auth_instructions; update the target with the validation route, HTTP method, request shape, and successful response first.",
        "tags": ["Credentials"],
        "parameters": [{"name": "target_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TargetCredentialCreateRequest"}}}},
        "responses": {
          "201": {"description": "Credential stored", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicTargetCredential"}}}}
        },
        "x-required-permission": "targets:write"
      }
    },
    "/v1/targets/{target_id}/credentials/{credential_id}": {
      "patch": {
        "operationId": "updateTargetCredential",
        "summary": "Update Target Credential",
        "description": "Updates a stored target credential, such as its name, username, password, role, login instructions, 2FA secret, or API key settings.",
        "tags": ["Credentials"],
        "parameters": [
          {"name": "target_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}},
          {"name": "credential_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}
        ],
        "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/TargetCredentialUpdateRequest"}}}},
        "responses": {
          "200": {"description": "Credential updated", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicTargetCredential"}}}}
        },
        "x-required-permission": "targets:write"
      },
      "delete": {
        "operationId": "deleteTargetCredential",
        "summary": "Delete Target Credential",
        "description": "Deletes a stored credential from a target. Future assessments and retests can no longer use it.",
        "tags": ["Credentials"],
        "parameters": [
          {"name": "target_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}},
          {"name": "credential_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}
        ],
        "responses": {"204": {"description": "Credential deleted"}},
        "x-required-permission": "targets:write"
      }
    },
    "/v1/targets/{target_id}/credentials/{credential_id}/check-email-mfa": {
      "post": {
        "operationId": "checkEmailMFA",
        "summary": "Check Email MFA",
        "description": "Read the newest credential inbox message and return its one-time MFA code or authorization URL when present.",
        "tags": ["Credentials"],
        "parameters": [
          {"name": "target_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}},
          {"name": "credential_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}
        ],
        "responses": {"200": {"description": "Inbox checked", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicEmailMFACheck"}}}}},
        "x-required-permission": "targets:write"
      }
    },
    "/v1/targets/{target_id}/credentials/{credential_id}/check-authenticator-2fa": {
      "post": {
        "operationId": "checkAuthenticator2FA",
        "summary": "Get Authenticator Code",
        "description": "Generate the current TOTP code without returning the stored seed.",
        "tags": ["Credentials"],
        "parameters": [
          {"name": "target_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}},
          {"name": "credential_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}
        ],
        "responses": {"200": {"description": "Current TOTP code returned", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicAuthenticatorCode"}}}}},
        "x-required-permission": "targets:write"
      }
    },
    "/v1/targets/{target_id}/credentials/{credential_id}/check-sms": {
      "post": {
        "operationId": "checkSMSCode",
        "summary": "Check SMS Code",
        "description": "Read the latest inbound SMS and return its one-time code when present.",
        "tags": ["Credentials"],
        "parameters": [
          {"name": "target_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}},
          {"name": "credential_id", "in": "path", "required": true, "schema": {"type": "string", "format": "uuid"}}
        ],
        "responses": {"200": {"description": "Latest SMS checked", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicSMSCode"}}}}},
        "x-required-permission": "targets:write"
      }
    },
    "/v1/coverage": {
      "get": {
        "operationId": "listCoverageChecks",
        "summary": "List Coverage Checks",
        "description": "List tested attack paths and scenarios with their status, latest result, last run time, and active related findings.",
        "tags": ["Coverage"],
        "parameters": [
          {"name": "target_id", "in": "query", "required": false, "description": "Only return checks for this target in the caller organization.", "schema": {"type": "string", "format": "uuid"}},
          {"name": "status", "in": "query", "required": false, "description": "Repeat to include multiple coverage states.", "schema": {"type": "array", "uniqueItems": true, "items": {"type": "string", "enum": ["not_run", "in_progress", "covered", "failing", "incomplete"]}}},
          {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 1, "maximum": 500, "default": 100}},
          {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "minimum": 0, "default": 0}}
        ],
        "responses": {"200": {"description": "Coverage checks returned", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicCoverageCheckList"}}}}},
        "x-required-permission": "targets:read"
      }
    },
    "/v1/coverage/overview": {
      "get": {
        "operationId": "getCoverageOverview",
        "summary": "Get Coverage Overview",
        "description": "Get aggregate coverage-check counts, completion progress, team breakdown, and target/team matrix for the organization or one target. Covered, failing, incomplete, in-progress, and not-run checks remain distinct.",
        "tags": ["Coverage", "Metrics"],
        "parameters": [
          {"name": "target_id", "in": "query", "required": false, "schema": {"type": "string", "format": "uuid"}}
        ],
        "responses": {"200": {"description": "Coverage overview returned", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PublicCoverageOverview"}}}}},
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/targets/{target_id}": {
      "get": {
        "operationId": "getTarget",
        "summary": "Get Target",
        "description": "Returns a single target by ID, including its type, domain or IP address, API authentication instructions, and last assessment time.",
        "tags": [
          "Targets"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "description": "Target UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTarget"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "targets:read"
      },
      "patch": {
        "operationId": "updateTarget",
        "summary": "Update Target",
        "description": "Updates a target's name, description, or API authentication instructions. Returns the updated target.",
        "tags": [
          "Targets"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "description": "Target UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTargetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTarget"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "targets:write"
      },
      "delete": {
        "operationId": "deleteTarget",
        "summary": "Delete Target",
        "description": "Permanently delete a target after confirming its exact name. Deletion is rejected while an assessment is queued or running.",
        "tags": [
          "Targets"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "description": "Target UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteTargetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Target deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteTargetResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Confirmation mismatch or active assessment",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "targets:write"
      }
    },
    "/v1/assessments/{assessment_id}": {
      "get": {
        "operationId": "getAssessment",
        "summary": "Get Assessment",
        "description": "Retrieve dashboard-aligned assessment progress, including stage_progress, planned testing stages, current statuses, and start/completion timestamps when available. Use stage_progress rather than reconciling expected_testing_stages with stages.state yourself.",
        "tags": [
          "Assessments"
        ],
        "parameters": [
          {
            "name": "assessment_id",
            "in": "path",
            "required": true,
            "description": "Assessment UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicAssessmentDetail"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "assessments:read"
      }
    },
    "/v1/findings/status": {
      "post": {
        "operationId": "updateFindingStatuses",
        "summary": "Update Finding Statuses",
        "description": "Updates the status of multiple findings in one request, with an optional resolution reason and context. Returns the number of findings affected.",
        "tags": [
          "Findings"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkFindingStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicBulkStatusResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:write"
      }
    },
    "/v1/findings/{finding_id}/retest": {
      "post": {
        "operationId": "retestFinding",
        "summary": "Retest Finding",
        "description": "Starts a retest that checks whether a finding still reproduces against the live target, optionally using a specific target credential.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "Finding UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicRetestFindingRequest"
              }
            }
          }
        },
        "responses": {
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A retest is already active or credential recovery is unavailable for this finding",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Organization retest capacity reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Retest service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRetestResult"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:retest"
      }
    },
    "/v1/findings/{finding_id}/severity": {
      "patch": {
        "operationId": "updateFindingSeverity",
        "summary": "Update Finding Severity",
        "description": "Overrides a finding's severity and, optionally, its CVSS v3.1 score. Returns both the original and the overridden values.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "Finding UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SeverityOverrideRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicFindingSeverityUpdateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:write"
      }
    },
    "/v1/findings/{finding_id}/comments": {
      "get": {
        "operationId": "listFindingComments",
        "summary": "List Finding Comments",
        "description": "Lists the comments on a finding, with limit and offset pagination.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "Finding UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicFindingComments"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:read"
      },
      "post": {
        "operationId": "addFindingComment",
        "summary": "Add Finding Comment",
        "description": "Adds a comment to a finding, for example to record triage notes or remediation context for your team.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "Finding UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicFindingComment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:write"
      }
    },
    "/v1/findings/{finding_id}/comments/{comment_id}": {
      "patch": {
        "operationId": "editFindingComment",
        "summary": "Edit Finding Comment",
        "description": "Edits the content of an existing comment on a finding. Returns the updated comment.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "Finding UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "comment_id",
            "in": "path",
            "required": true,
            "description": "Comment UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicFindingComment"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:write"
      },
      "delete": {
        "operationId": "deleteFindingComment",
        "summary": "Delete Finding Comment",
        "description": "Deletes a comment from a finding.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "finding_id",
            "in": "path",
            "required": true,
            "description": "Finding UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "comment_id",
            "in": "path",
            "required": true,
            "description": "Comment UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Comment deleted"
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:write"
      }
    },
    "/v1/findings/patches": {
      "get": {
        "operationId": "listFindingPatches",
        "summary": "List Finding Patches",
        "description": "Lists generated remediation patches for findings. Filter to findings assigned to you or search by finding ID, title, endpoint, or impact.",
        "tags": [
          "Findings"
        ],
        "parameters": [
          {
            "name": "assigned_to_me",
            "in": "query",
            "required": false,
            "description": "When true, return only patches for findings assigned to the current user",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Search finding ID, title, description, endpoint, or impact",
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPatchSummaries"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:read"
      }
    },
    "/v1/findings/counts": {
      "get": {
        "operationId": "getFindingCounts",
        "summary": "Get Finding Counts",
        "description": "Returns finding counts grouped by lifecycle, exposure, and severity, for your whole organization or a single target.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicFindingCounts"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "findings:read"
      }
    },
    "/v1/findings/severity-distribution": {
      "get": {
        "operationId": "getSeverityDistribution",
        "summary": "Get Severity Distribution",
        "description": "Returns the number of findings at each severity (critical, high, medium, low, and secured), for your organization or a single target.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSeverityDistribution"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/targets/{target_id}/health-score": {
      "get": {
        "operationId": "getTargetHealthScore",
        "summary": "Get Target Health Score",
        "description": "Returns a target's security health score and letter grade, along with its total number of findings.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "path",
            "required": true,
            "description": "Target UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthScoreResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/findings/category-distribution": {
      "get": {
        "operationId": "getCategoryDistribution",
        "summary": "Get Category Distribution",
        "description": "Returns finding counts by OWASP category and by vulnerability tag, for your organization or a single target.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryDistributionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/findings/severity-score-history": {
      "get": {
        "operationId": "getSeverityScoreHistory",
        "summary": "Get Severity History",
        "description": "Returns a time series of severity scores at the chosen granularity, for your organization or a single target.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "description": "Time bucket for the history series",
            "schema": {
              "type": "string",
              "enum": ["day", "week", "month"],
              "default": "day"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSeverityHistory"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/findings/metrics/current": {
      "get": {
        "operationId": "getCurrentSecurityMetrics",
        "summary": "Get Current Metrics",
        "description": "Returns current finding metrics, including open counts, assigned findings, the age of the oldest open findings, and the health score and grade.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicCurrentMetrics"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/findings/metrics/timeseries": {
      "get": {
        "operationId": "getSecurityMetricsTimeseries",
        "summary": "Get Metrics Timeseries",
        "description": "Returns finding metrics over a date range at the chosen granularity, for your organization or a single target.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Start date, inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "End date, inclusive",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week"
              ],
              "default": "day"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTimeseriesMetrics"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/findings/metrics/remediation": {
      "get": {
        "operationId": "getRemediationMetrics",
        "summary": "Get Remediation Metrics",
        "description": "Returns remediation metrics, including mean time to remediate (MTTR) and p90 remediation time overall and by severity.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Optional inclusive start date",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Optional inclusive end date",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicRemediationMetrics"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/findings/metrics/sla": {
      "get": {
        "operationId": "getSLAMetrics",
        "summary": "Get SLA Metrics",
        "description": "Returns SLA breaches for open findings, for your organization or a single target.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSLAMetrics"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/findings/metrics/aging": {
      "get": {
        "operationId": "getFindingAging",
        "summary": "Get Finding Aging",
        "description": "Returns the number of open findings in each age bucket, for your organization or a single target.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "target_id",
            "in": "query",
            "required": false,
            "description": "Optionally scope organization-wide results to one target",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RedTeamAgingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "metrics:read"
      }
    },
    "/v1/reports": {
      "post": {
        "operationId": "createReport",
        "summary": "Create Report",
        "description": "Starts generating a security assessment report for a target. Choose the detail level and whether to include secured or resolved findings.",
        "tags": [
          "Reports"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReportRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "reports:write"
      },
      "get": {
        "operationId": "listReports",
        "summary": "List Reports",
        "description": "Lists generated reports for your organization, including each report's target, status, and options, with limit and offset pagination.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReportList"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "reports:read"
      }
    },
    "/v1/reports/{report_id}": {
      "get": {
        "operationId": "getReport",
        "summary": "Get Report",
        "description": "Returns a report's generation status and options. If generation failed, the response includes the failure reason.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "description": "Report UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReportStatus"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "reports:read"
      }
    },
    "/v1/reports/{report_id}/download": {
      "get": {
        "operationId": "downloadReport",
        "summary": "Download Report",
        "description": "Returns a short-lived download URL for a completed report, along with the report name and the URL's expiry time.",
        "tags": [
          "Reports"
        ],
        "parameters": [
          {
            "name": "report_id",
            "in": "path",
            "required": true,
            "description": "Report UUID",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReportDownload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Not permitted for this organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "x-required-permission": "reports:read"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key generated from the MindFort dashboard. Pass as `Authorization: Bearer <your-api-key>`."
      }
    },
    "schemas": {
      "DiscoveryScheduleUpdate": {
        "type": "object",
        "properties": {"enabled": {"type": "boolean"}, "cadence": {"type": "string", "enum": ["daily", "weekly"]}, "day_of_week": {"type": ["integer", "null"], "minimum": 0, "maximum": 6}, "time": {"type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"}, "timezone": {"type": "string", "minLength": 1}},
        "required": ["enabled", "cadence", "time", "timezone"],
        "allOf": [{"if": {"properties": {"cadence": {"const": "weekly"}}, "required": ["cadence"]}, "then": {"required": ["day_of_week"], "properties": {"day_of_week": {"type": "integer"}}}, "else": {"properties": {"day_of_week": {"type": "null"}}}}],
        "additionalProperties": false
      },
      "PublicDiscoverySchedule": {
        "type": "object",
        "properties": {"id": {"type": "string", "format": "uuid"}, "schedule_type": {"type": "string", "enum": ["daily", "weekly"]}, "scheduled_time": {"type": "string"}, "day_of_week": {"type": ["integer", "null"]}, "timezone": {"type": "string"}, "is_active": {"type": "boolean"}, "next_run_at": {"type": ["string", "null"], "format": "date-time"}, "last_run_at": {"type": ["string", "null"], "format": "date-time"}, "last_run_errored": {"type": "boolean"}, "error_message": {"type": ["string", "null"]}},
        "required": ["id", "schedule_type", "scheduled_time", "day_of_week", "timezone", "is_active", "next_run_at", "last_run_at", "last_run_errored", "error_message"],
        "additionalProperties": false
      },
      "PublicDiscoveryActiveRun": {
        "type": "object",
        "properties": {"run_id": {"type": "string"}, "status": {"type": "string", "enum": ["queued", "running"]}, "created_at": {"type": "string", "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "updated_at": {"type": "string", "format": "date-time"}},
        "required": ["run_id", "status", "created_at", "started_at", "updated_at"],
        "additionalProperties": false
      },
      "PublicDiscoveryLastRun": {
        "type": "object",
        "properties": {"run_id": {"type": "string"}, "status": {"type": "string", "enum": ["start_failed", "running", "completed", "failed", "cancelled"]}, "error": {"type": ["string", "null"]}, "created_at": {"type": "string", "format": "date-time"}, "started_at": {"type": ["string", "null"], "format": "date-time"}, "completed_at": {"type": ["string", "null"], "format": "date-time"}},
        "required": ["run_id", "status", "error", "created_at", "started_at", "completed_at"],
        "additionalProperties": false
      },
      "PublicDiscoveryStatus": {
        "type": "object",
        "properties": {"schedule": {"anyOf": [{"$ref": "#/components/schemas/PublicDiscoverySchedule"}, {"type": "null"}]}, "active_run": {"anyOf": [{"$ref": "#/components/schemas/PublicDiscoveryActiveRun"}, {"type": "null"}]}, "last_run": {"anyOf": [{"$ref": "#/components/schemas/PublicDiscoveryLastRun"}, {"type": "null"}]}, "pending_count": {"type": "integer"}, "context_note": {"type": "string"}},
        "required": ["schedule", "active_run", "last_run", "pending_count", "context_note"],
        "additionalProperties": false
      },
      "PublicDiscoveryScheduleResponse": {
        "type": "object",
        "properties": {"schedule": {"anyOf": [{"$ref": "#/components/schemas/PublicDiscoverySchedule"}, {"type": "null"}]}},
        "required": ["schedule"],
        "additionalProperties": false
      },
      "PublicDiscoveryContextResponse": {
        "type": "object",
        "properties": {"context_note": {"type": "string"}},
        "required": ["context_note"],
        "additionalProperties": false
      },
      "PublicDiscoveryRunResponse": {
        "type": "object",
        "description": "Use run_id to identify the discovery run and GET /v1/discovery to follow its progress. Additional response fields may be present; clients should ignore fields they do not use.",
        "properties": {"run_id": {"type": "string"}, "status": {"type": "string", "const": "queued"}},
        "required": ["run_id", "status"],
        "additionalProperties": true
      },
      "PublicDiscoveryCancelResponse": {
        "type": "object",
        "properties": {"run_id": {"type": "string"}, "status": {"type": "string", "const": "cancelled"}},
        "required": ["run_id", "status"],
        "additionalProperties": false
      },
      "PublicDiscoverySuggestion": {
        "type": "object",
        "properties": {"id": {"type": "string", "format": "uuid"}, "target_value": {"type": "string"}, "canonical_target": {"type": "string"}, "target_type": {"type": "string", "enum": ["web_app", "api", "network"]}, "explanation": {"type": "string"}, "status": {"type": "string", "enum": ["pending", "accepted", "dismissed", "superseded"]}, "accepted_target_id": {"type": ["string", "null"], "format": "uuid"}, "first_suggested_at": {"type": "string", "format": "date-time"}, "last_suggested_at": {"type": "string", "format": "date-time"}},
        "required": ["id", "target_value", "canonical_target", "target_type", "explanation", "status", "accepted_target_id", "first_suggested_at", "last_suggested_at"],
        "additionalProperties": true
      },
      "PublicDiscoverySuggestionList": {
        "type": "object",
        "properties": {"suggestions": {"type": "array", "items": {"$ref": "#/components/schemas/PublicDiscoverySuggestion"}}, "total": {"type": "integer"}, "limit": {"type": "integer"}, "offset": {"type": "integer"}, "next_cursor": {"type": ["string", "null"]}},
        "required": ["suggestions", "total", "limit", "offset", "next_cursor"],
        "additionalProperties": false
      },
      "PublicDiscoveryDismissResponse": {
        "type": "object",
        "properties": {"id": {"type": "string", "format": "uuid"}, "status": {"type": "string", "const": "dismissed"}},
        "required": ["id", "status"],
        "additionalProperties": false
      },
      "TriggerAssessmentRequest": {
        "type": "object",
        "required": [
          "target_id"
        ],
        "properties": {
          "target_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the target to assess"
          },
          "assessment_type": {
            "type": "string",
            "enum": [
              "black-box",
              "white-box"
            ],
            "default": "black-box",
            "description": "Assessment mode. White-box includes code context and requires an enabled associated repository plus a GitHub App installation that can access it."
          },
          "assessment_method": {
            "type": "string",
            "enum": [
              "balanced",
              "deep",
              "ultra"
            ],
            "default": "balanced",
            "description": "Assessment method. Balanced is the default; Deep and Ultra allow more time for investigation. Coverage depends on the target's scope, available access, and scenarios investigated."
          },
          "target_credential_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the primary stored credential to use for authenticated testing"
          },
          "secondary_target_credential_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of a different secondary stored credential for cross-account authorization testing; requires target_credential_id"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code when one is available"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier for debugging"
          }
        }
      },
      "PublicPatchCount": {
        "type": "object",
        "required": ["patched"],
        "properties": {"patched": {"type": "integer", "minimum": 0}},
        "additionalProperties": false
      },
      "PublicPendingEmail": {
        "type": "object",
        "required": ["id", "generated_email", "created_at", "expires_at", "instructions"],
        "properties": {
          "id": {"type": "string", "format": "uuid"},
          "generated_email": {"type": "string"},
          "created_at": {"type": "string", "format": "date-time"},
          "expires_at": {"type": "string", "format": "date-time"},
          "instructions": {"type": "string"}
        },
        "additionalProperties": false
      },
      "PublicSMSCredentialsAccess": {
        "type": "object",
        "required": ["enabled"],
        "properties": {"enabled": {"type": "boolean"}},
        "additionalProperties": false
      },
      "PublicSMSCountry": {
        "type": "object",
        "required": ["code", "name"],
        "properties": {"code": {"type": "string"}, "name": {"type": "string"}},
        "additionalProperties": false
      },
      "PublicSMSAvailableCountries": {
        "type": "object",
        "required": ["countries"],
        "properties": {"countries": {"type": "array", "items": {"$ref": "#/components/schemas/PublicSMSCountry"}}},
        "additionalProperties": false
      },
      "APIKeyPlacementInput": {
        "type": "object",
        "properties": {
          "kind": {"type": "string", "enum": ["bearer", "header", "query", "json_body"], "default": "header"},
          "header_name": {"type": ["string", "null"], "maxLength": 255, "description": "Valid only for header placement; defaults to X-API-Key."},
          "query_param": {"type": ["string", "null"], "maxLength": 255, "description": "Valid only for query placement; defaults to api_key."},
          "json_field_path": {"type": ["string", "null"], "maxLength": 500, "description": "Required for json_body placement; not accepted for other placement kinds."},
          "bearer_prefix": {"type": ["string", "null"], "maxLength": 100, "description": "Valid only for bearer placement; defaults to Bearer followed by a space."},
          "extra_headers": {"type": ["object", "null"], "additionalProperties": {"type": "string"}}
        },
        "additionalProperties": false
      },
      "APIKeyCredentialInput": {
        "type": "object",
        "writeOnly": true,
        "required": ["secret"],
        "properties": {
          "secret": {"type": "string", "minLength": 1, "writeOnly": true},
          "placement": {"$ref": "#/components/schemas/APIKeyPlacementInput"},
          "additional_fields": {"type": ["object", "null"], "additionalProperties": {"type": "string"}}
        },
        "additionalProperties": false
      },
      "TargetCredentialCreateRequest": {
        "type": "object",
        "required": ["credential_name", "credential_type"],
        "properties": {
          "credential_name": {"type": "string", "minLength": 1, "maxLength": 255},
          "credential_type": {"type": "string", "enum": ["application_login", "magic_link", "email_mfa", "authenticator_2fa", "sms_mfa", "sms_login", "api_key"]},
          "username": {"type": ["string", "null"], "maxLength": 255, "description": "Username for login credential types. Optional for email_mfa."},
          "password": {"type": ["string", "null"], "minLength": 1, "maxLength": 255, "writeOnly": true, "description": "Password for login credential types. Optional for email_mfa."},
          "role": {"type": "string", "enum": ["user", "admin", "viewer", "editor", "custom"], "default": "user"},
          "description": {"type": ["string", "null"], "maxLength": 4000},
          "login_instructions": {"type": ["string", "null"], "maxLength": 10000},
          "additional_auth_instructions": {"type": ["string", "null"], "maxLength": 10000, "description": "Instructions specific to this credential, used during authentication. Plain text only; HTML tags and unsupported control characters are rejected."},
          "pending_email_id": {"type": ["string", "null"], "format": "uuid"},
          "authenticator_2fa_secret": {"type": ["string", "null"], "minLength": 1, "maxLength": 255, "writeOnly": true},
          "api_key_credential": {"anyOf": [{"$ref": "#/components/schemas/APIKeyCredentialInput"}, {"type": "null"}], "writeOnly": true},
          "sms_country_code": {"type": ["string", "null"], "pattern": "^[A-Za-z]{2}$"}
        },
        "additionalProperties": false
      },
      "TargetCredentialUpdateRequest": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "credential_name": {"type": "string", "minLength": 1, "maxLength": 255},
          "credential_type": {"type": "string", "enum": ["application_login", "magic_link", "email_mfa", "authenticator_2fa", "sms_mfa", "sms_login", "api_key"]},
          "username": {"type": "string", "maxLength": 255},
          "password": {"type": "string", "minLength": 1, "maxLength": 255, "writeOnly": true},
          "role": {"type": "string", "enum": ["user", "admin", "viewer", "editor", "custom"]},
          "description": {"type": ["string", "null"], "maxLength": 4000},
          "login_instructions": {"type": ["string", "null"], "maxLength": 10000},
          "additional_auth_instructions": {"type": ["string", "null"], "maxLength": 10000, "description": "Instructions specific to this credential, used during authentication. Plain text only; HTML tags and unsupported control characters are rejected."},
          "pending_email_id": {"type": "string", "format": "uuid"},
          "authenticator_2fa_secret": {"type": "string", "minLength": 1, "maxLength": 255, "writeOnly": true},
          "api_key_credential": {"$ref": "#/components/schemas/APIKeyCredentialInput", "writeOnly": true}
        },
        "additionalProperties": false
      },
      "PublicAPIKeyPlacement": {
        "type": "object",
        "required": ["kind"],
        "properties": {
          "kind": {"type": "string", "enum": ["bearer", "header", "query", "json_body", "aws_sigv4"]},
          "header_name": {"type": ["string", "null"]},
          "query_param": {"type": ["string", "null"]},
          "json_field_path": {"type": ["string", "null"]},
          "bearer_prefix": {"type": ["string", "null"]},
          "extra_headers": {"type": ["object", "null"], "additionalProperties": {"type": "string"}}
        },
        "additionalProperties": false
      },
      "PublicTargetCredential": {
        "type": "object",
        "required": ["id", "role", "api_key_configured", "created_at", "updated_at"],
        "properties": {
          "id": {"type": "string", "format": "uuid"},
          "credential_name": {"type": ["string", "null"]},
          "username": {"type": ["string", "null"]},
          "role": {"type": "string"},
          "description": {"type": ["string", "null"]},
          "login_instructions": {"type": ["string", "null"]},
          "additional_auth_instructions": {"type": ["string", "null"], "maxLength": 10000, "description": "Instructions specific to this credential, used during authentication. Plain text only; HTML tags and unsupported control characters are rejected."},
          "credential_type": {"type": ["string", "null"]},
          "generated_email": {"type": ["string", "null"]},
          "authenticator_phone_number": {"type": ["string", "null"], "description": "System-provisioned phone number for SMS credentials; not a writable authenticator input."},
          "api_key_configured": {"type": "boolean"},
          "api_key_placement": {"anyOf": [{"$ref": "#/components/schemas/PublicAPIKeyPlacement"}, {"type": "null"}]},
          "api_additional_fields": {"type": ["object", "null"], "additionalProperties": {"type": "string"}},
          "created_at": {"type": "string", "format": "date-time"},
          "updated_at": {"type": "string", "format": "date-time"}
        },
        "additionalProperties": false
      },
      "PublicTargetCredentialList": {
        "type": "object",
        "required": ["credentials", "total", "limit", "offset", "next_cursor"],
        "properties": {
          "credentials": {"type": "array", "items": {"$ref": "#/components/schemas/PublicTargetCredential"}},
          "total": {"type": "integer"},
          "limit": {"type": "integer"},
          "offset": {"type": "integer"},
          "next_cursor": {"type": ["string", "null"]}
        },
        "additionalProperties": false
      },
      "PublicEmailMFACheck": {
        "type": "object",
        "required": ["credential_id", "success", "message"],
        "properties": {
          "credential_id": {"type": "string", "format": "uuid"},
          "success": {"type": "boolean"},
          "mfa_code": {"type": ["string", "null"], "description": "One-time code or authorization URL."},
          "email_received_at": {"type": ["string", "null"], "format": "date-time"},
          "message": {"type": "string"}
        },
        "additionalProperties": false
      },
      "PublicAuthenticatorCode": {
        "type": "object",
        "required": ["credential_id", "success", "message"],
        "properties": {
          "credential_id": {"type": "string", "format": "uuid"},
          "success": {"type": "boolean"},
          "code": {"type": ["string", "null"], "description": "Current one-time TOTP code; the seed is never returned."},
          "valid_for_seconds": {"type": ["integer", "null"]},
          "message": {"type": "string"}
        },
        "additionalProperties": false
      },
      "PublicSMSCode": {
        "type": "object",
        "required": ["credential_id", "success", "message"],
        "properties": {
          "credential_id": {"type": "string", "format": "uuid"},
          "success": {"type": "boolean"},
          "code": {"type": ["string", "null"], "description": "One-time code from the latest inbound SMS."},
          "message_time": {"type": ["string", "null"], "format": "date-time"},
          "message": {"type": "string"}
        },
        "additionalProperties": false
      },
      "PublicCoverageFinding": {
        "type": "object",
        "required": ["id", "title", "severity", "status"],
        "properties": {
          "id": {"type": "string", "format": "uuid"},
          "title": {"type": ["string", "null"]},
          "severity": {"type": ["string", "null"]},
          "status": {"type": "string", "const": "ACTIVE"}
        },
        "additionalProperties": false
      },
      "PublicCoverageRun": {
        "type": "object",
        "required": ["id", "assessment_id", "completion_state", "customer_summary", "started_at", "completed_at"],
        "properties": {
          "id": {"type": "string", "format": "uuid"},
          "assessment_id": {"type": "string", "format": "uuid"},
          "completion_state": {"type": "string", "enum": ["pending", "running", "complete", "incomplete"]},
          "customer_summary": {"type": ["string", "null"], "description": "Customer-safe summary of the latest coverage run."},
          "started_at": {"type": ["string", "null"], "format": "date-time"},
          "completed_at": {"type": ["string", "null"], "format": "date-time"}
        },
        "additionalProperties": false
      },
      "PublicCoverageCheck": {
        "type": "object",
        "required": ["id", "target_id", "team_slug", "title", "coverage", "revision", "created_at", "updated_at", "run_count", "last_run_at", "status", "latest_run", "related_findings"],
        "properties": {
          "id": {"type": "string", "format": "uuid"},
          "target_id": {"type": "string", "format": "uuid"},
          "team_slug": {"type": "string"},
          "title": {"type": "string"},
          "coverage": {"type": "string", "description": "Attack path or scenarios tested by this check."},
          "revision": {"type": "integer", "minimum": 1},
          "created_at": {"type": "string", "format": "date-time"},
          "updated_at": {"type": "string", "format": "date-time"},
          "run_count": {"type": "integer", "minimum": 0},
          "last_run_at": {"type": ["string", "null"], "format": "date-time", "description": "Most recent started or completed run time, including earlier history while a new run is pending."},
          "status": {"type": "string", "enum": ["not_run", "in_progress", "covered", "failing", "incomplete"]},
          "latest_run": {"anyOf": [{"$ref": "#/components/schemas/PublicCoverageRun"}, {"type": "null"}]},
          "related_findings": {"type": "array", "description": "Distinct active findings linked across the check's full run history.", "items": {"$ref": "#/components/schemas/PublicCoverageFinding"}}
        },
        "additionalProperties": false
      },
      "PublicCoverageCheckList": {
        "type": "object",
        "required": ["checks", "total", "limit", "offset", "next_cursor"],
        "properties": {
          "checks": {"type": "array", "items": {"$ref": "#/components/schemas/PublicCoverageCheck"}},
          "total": {"type": "integer", "minimum": 0},
          "limit": {"type": "integer", "minimum": 1, "maximum": 500},
          "offset": {"type": "integer", "minimum": 0},
          "next_cursor": {"type": ["string", "null"]}
        },
        "additionalProperties": false
      },
      "PublicCoverageStatusCounts": {
        "type": "object",
        "required": ["covered", "failing", "incomplete", "in_progress", "not_run"],
        "properties": {
          "covered": {"type": "integer", "minimum": 0},
          "failing": {"type": "integer", "minimum": 0},
          "incomplete": {"type": "integer", "minimum": 0},
          "in_progress": {"type": "integer", "minimum": 0},
          "not_run": {"type": "integer", "minimum": 0}
        },
        "additionalProperties": false
      },
      "PublicCoverageTeamBreakdown": {
        "type": "object",
        "required": ["team_slug", "tested_checks", "counts"],
        "properties": {
          "team_slug": {"type": "string"},
          "tested_checks": {"type": "integer", "minimum": 0},
          "counts": {"$ref": "#/components/schemas/PublicCoverageStatusCounts"}
        },
        "additionalProperties": false
      },
      "PublicCoverageMatrixCell": {
        "type": "object",
        "required": ["target_id", "team_slug", "tested_checks", "counts"],
        "properties": {
          "target_id": {"type": "string", "format": "uuid"},
          "team_slug": {"type": "string"},
          "tested_checks": {"type": "integer", "minimum": 0},
          "counts": {"$ref": "#/components/schemas/PublicCoverageStatusCounts"}
        },
        "additionalProperties": false
      },
      "PublicCoverageOverview": {
        "type": "object",
        "required": ["total_checks", "tested_checks", "completion_pct", "counts", "by_team", "matrix"],
        "properties": {
          "total_checks": {"type": "integer", "minimum": 0, "description": "Number of active coverage checks when this summary is requested."},
          "tested_checks": {"type": "integer", "minimum": 0},
          "completion_pct": {"type": "integer", "minimum": 0, "maximum": 100},
          "last_run_at": {"type": ["string", "null"], "format": "date-time", "description": "Most recent coverage run start or completion time, or null if no run has started."},
          "counts": {"$ref": "#/components/schemas/PublicCoverageStatusCounts"},
          "by_team": {"type": "array", "items": {"$ref": "#/components/schemas/PublicCoverageTeamBreakdown"}},
          "matrix": {"type": "array", "items": {"$ref": "#/components/schemas/PublicCoverageMatrixCell"}}
        },
        "additionalProperties": false
      },
      "UpdateFindingStatusRequest": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "RESOLVED",
              "ARCHIVED"
            ],
            "description": "New finding status"
          },
          "resolve_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "FIX",
              "WONT_FIX",
              "FALSE_POSITIVE",
              null
            ],
            "description": "Resolution reason. FALSE_POSITIVE is only valid when status is ARCHIVED and requires resolve_context."
          },
          "resolve_context": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Optional resolution context. Required when archiving a FALSE_POSITIVE."
          }
        },
        "allOf": [
          {
            "if": {
              "required": ["resolve_reason"],
              "properties": {"resolve_reason": {"const": "FALSE_POSITIVE"}}
            },
            "then": {
              "required": ["resolve_context"],
              "properties": {
                "status": {"const": "ARCHIVED"},
                "resolve_context": {"type": "string", "minLength": 1}
              }
            }
          },
          {
            "if": {
              "anyOf": [
                {
                  "required": ["resolve_reason"],
                  "properties": {"resolve_reason": {"enum": ["FIX", "WONT_FIX"]}}
                },
                {
                  "required": ["resolve_context"],
                  "properties": {"resolve_context": {"type": "string"}},
                  "not": {
                    "required": ["resolve_reason"],
                    "properties": {"resolve_reason": {"const": "FALSE_POSITIVE"}}
                  }
                }
              ]
            },
            "then": {"properties": {"status": {"const": "RESOLVED"}}}
          }
        ],
        "additionalProperties": false
      },
      "PublicTarget": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "title": "Description",
            "type": [
              "string",
              "null"
            ]
          },
          "target_type": {
            "type": "string",
            "title": "Target Type"
          },
          "web_domain": {
            "title": "Web Domain",
            "type": [
              "string",
              "null"
            ]
          },
          "ip_address": {
            "title": "Ip Address",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "last_assessment_time": {
            "title": "Last Assessment Time",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "api_auth_instructions": {
            "type": ["string", "null"],
            "maxLength": 10000,
            "description": "Target-level API authentication validation instructions."
          },
          "created_by": {
            "anyOf": [
              {"type": "string", "enum": ["user", "mindfort"]},
              {"type": "null"}
            ],
            "title": "Created By"
          },
          "created_by_user_id": {
            "type": ["string", "null"],
            "title": "Created By User Id"
          },
          "origin_suggestion_id": {
            "type": ["string", "null"],
            "format": "uuid",
            "title": "Origin Suggestion Id"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "target_type",
          "created_at",
          "updated_at"
        ],
        "title": "PublicTarget",
        "additionalProperties": false
      },
      "CreateTargetRequest": {
        "type": "object",
        "required": [
          "name",
          "target_type"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "pattern": "\\S"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "target_type": {
            "type": "string",
            "enum": [
              "web_app",
              "api",
              "network"
            ]
          },
          "web_domain": {
            "type": ["string", "null"],
            "format": "uri",
            "minLength": 1,
            "maxLength": 2083,
            "pattern": "^[Hh][Tt][Tt][Pp][Ss]?://",
            "description": "HTTP(S) target URL required for web_app and api. URL-embedded credentials are rejected; use target credentials instead. A host-only URL may be returned with a trailing slash."
          },
          "ip_address": {
            "type": ["string", "null"],
            "format": "ip-address"
          },
          "api_auth_instructions": {
            "type": ["string", "null"],
            "maxLength": 10000,
            "description": "API authentication validation instructions. Required when an API target is created with one or more credentials."
          },
          "credentials": {
            "type": "array",
            "items": {"$ref": "#/components/schemas/TargetCredentialCreateRequest"},
            "default": []
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {"target_type": {"const": "network"}},
              "required": ["target_type"]
            },
            "then": {
              "required": ["ip_address"],
              "properties": {
                "web_domain": {"type": "null"},
                "credentials": {"maxItems": 0}
              }
            },
            "else": {
              "required": ["web_domain"],
              "properties": {"ip_address": {"type": "null"}}
            }
          },
          {
            "if": {
              "properties": {
                "target_type": {"const": "api"},
                "credentials": {"minItems": 1}
              },
              "required": ["target_type", "credentials"]
            },
            "then": {
              "required": ["api_auth_instructions"],
              "properties": {
                "api_auth_instructions": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "\\S"
                }
              }
            }
          }
        ],
        "additionalProperties": false
      },
      "UpdateTargetRequest": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "api_auth_instructions": {
            "type": ["string", "null"],
            "maxLength": 10000
          }
        },
        "additionalProperties": false
      },
      "DeleteTargetRequest": {
        "type": "object",
        "required": [
          "confirm_target_name"
        ],
        "properties": {
          "confirm_target_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "description": "Exact current target name, obtained from getTarget"
          }
        },
        "additionalProperties": false
      },
      "DeleteTargetResponse": {
        "type": "object",
        "required": [
          "success",
          "target_id"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "target_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "PublicAssessmentLifecycle": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "target_id": {
            "type": "string",
            "format": "uuid",
            "title": "Target Id"
          },
          "target_name": {
            "title": "Target Name",
            "type": [
              "string",
              "null"
            ]
          },
          "assessment_type": {
            "type": "string",
            "enum": [
              "black-box",
              "white-box"
            ],
            "title": "Assessment Type"
          },
          "assessment_method": {
            "title": "Assessment Method",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "balanced",
              "deep",
              "ultra",
              null
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "completed",
              "failed",
              "canceled"
            ],
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "started_at": {
            "title": "Started At",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "completed_at": {
            "title": "Completed At",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "failure_reason": {
            "title": "Failure Reason",
            "type": ["string", "null"],
            "maxLength": 1000,
            "description": "Customer-visible reason recorded for a failed assessment. Null for non-failed assessments or when no reason was recorded."
          }
        },
        "type": "object",
        "required": [
          "id",
          "target_id",
          "target_name",
          "assessment_type",
          "assessment_method",
          "status",
          "created_at",
          "updated_at",
          "started_at",
          "completed_at"
        ],
        "title": "PublicAssessmentLifecycle",
        "additionalProperties": false
      },
      "PublicAssessmentExecutorStage": {
        "type": "object",
        "required": ["status"],
        "properties": {
          "name": {
            "type": ["string", "null"],
            "description": "Name of the test run, when available."
          },
          "status": {
            "type": "string",
            "enum": ["starting", "in_progress", "done", "failed", "cancelled"]
          },
          "attempt": {"type": ["integer", "null"]},
          "started_at": {
            "type": ["string", "null"],
            "format": "date-time",
            "description": "When this test run started, or null when not recorded."
          },
          "completed_at": {
            "type": ["string", "null"],
            "format": "date-time",
            "description": "When this test run finished, or null while active or unrecorded."
          }
        },
        "additionalProperties": false
      },
      "PublicAssessmentStage": {
        "type": "object",
        "required": ["activity_type", "assessment_stage", "name", "status", "attempt", "executors"],
        "properties": {
          "activity_type": {
            "type": "string",
            "enum": ["RECON", "TESTING", "VALIDATION", "AUTHENTICATION"]
          },
          "assessment_stage": {
            "type": "string",
            "description": "Assessment stage identifier."
          },
          "name": {
            "type": "string",
            "description": "Customer-visible stage name."
          },
          "status": {
            "type": "string",
            "enum": ["RUNNING", "ACTIVE", "COMPLETED", "SKIPPED", "FAILED", "TIMED_OUT", "CANCELED", "TERMINATED", "CONTINUED_AS_NEW"]
          },
          "attempt": {"type": "integer", "minimum": 1},
          "executors": {
            "type": ["array", "null"],
            "description": "Individual test run statuses and start/completion times; null when no individual runs are reported for this stage.",
            "items": {"$ref": "#/components/schemas/PublicAssessmentExecutorStage"}
          }
        },
        "additionalProperties": false
      },
      "PublicAssessmentStageProgress": {
        "type": "object",
        "required": ["activity_type", "assessment_stage", "name", "status", "attempt", "executors"],
        "properties": {
          "activity_type": {
            "type": "string",
            "enum": ["RECON", "TESTING", "VALIDATION", "AUTHENTICATION"]
          },
          "assessment_stage": {
            "type": "string",
            "description": "Assessment stage identifier."
          },
          "name": {
            "type": "string",
            "description": "Customer-visible stage name."
          },
          "status": {
            "type": "string",
            "enum": ["NOT_STARTED", "RUNNING", "ACTIVE", "COMPLETED", "SKIPPED", "FAILED", "TIMED_OUT", "CANCELED", "TERMINATED", "CONTINUED_AS_NEW"]
          },
          "attempt": {"type": ["integer", "null"], "minimum": 1},
          "executors": {
            "type": ["array", "null"],
            "description": "Individual test run statuses and start/completion times; null when no individual runs are reported for this stage.",
            "items": {"$ref": "#/components/schemas/PublicAssessmentExecutorStage"}
          }
        },
        "additionalProperties": false
      },
      "PublicAssessmentStages": {
        "type": "object",
        "required": ["state"],
        "properties": {
          "state": {
            "type": "object",
            "description": "Assessment stages indexed by stage identifier.",
            "additionalProperties": {"$ref": "#/components/schemas/PublicAssessmentStage"}
          }
        },
        "additionalProperties": false
      },
      "PublicExpectedAssessmentStage": {
        "type": "object",
        "required": ["id", "name"],
        "properties": {
          "id": {
            "type": "string",
            "description": "Planned testing-stage identifier."
          },
          "name": {
            "type": "string",
            "description": "Customer-visible expected stage name."
          }
        },
        "additionalProperties": false
      },
      "PublicAssessmentDetail": {
        "type": "object",
        "required": ["id", "target_id", "target_name", "assessment_type", "assessment_method", "status", "created_at", "updated_at", "started_at", "completed_at", "expected_testing_stages", "stages", "stage_progress"],
        "properties": {
          "id": {"type": "string", "format": "uuid"},
          "target_id": {"type": "string", "format": "uuid"},
          "target_name": {"type": ["string", "null"]},
          "assessment_type": {
            "type": "string",
            "enum": ["black-box", "white-box"]
          },
          "assessment_method": {
            "type": ["string", "null"],
            "enum": ["balanced", "deep", "ultra", null]
          },
          "status": {
            "type": "string",
            "enum": ["active", "completed", "failed", "canceled"]
          },
          "created_at": {"type": "string", "format": "date-time"},
          "updated_at": {"type": "string", "format": "date-time"},
          "started_at": {"type": ["string", "null"], "format": "date-time"},
          "completed_at": {"type": ["string", "null"], "format": "date-time"},
          "failure_reason": {
            "type": ["string", "null"],
            "maxLength": 1000,
            "description": "Customer-visible reason recorded for a failed assessment. Null for non-failed assessments or when no reason was recorded."
          },
          "expected_testing_stages": {
            "type": "array",
            "description": "Target-specific testing stages expected for this assessment. A stage without a matching entry in stages.state has not started yet.",
            "items": {"$ref": "#/components/schemas/PublicExpectedAssessmentStage"}
          },
          "stages": {
            "description": "Current assessment stages, including their statuses and individual test run times.",
            "anyOf": [
              {"$ref": "#/components/schemas/PublicAssessmentStages"},
              {"type": "null"}
            ]
          },
          "stage_progress": {
            "type": "array",
            "description": "Progress for planned and recorded assessment stages. Use this instead of reconciling expected_testing_stages with stages.state. NOT_STARTED means expected but not yet observed.",
            "items": {"$ref": "#/components/schemas/PublicAssessmentStageProgress"}
          }
        },
        "additionalProperties": false
      },
      "BulkFindingStatusRequest": {
        "type": "object",
        "required": [
          "finding_ids",
          "status"
        ],
        "properties": {
          "finding_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "RESOLVED",
              "ARCHIVED"
            ]
          },
          "resolve_reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "FIX",
              "WONT_FIX",
              "FALSE_POSITIVE",
              null
            ],
            "description": "Resolution reason. FALSE_POSITIVE is only valid when status is ARCHIVED and requires resolve_context."
          },
          "resolve_context": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000,
            "description": "Optional resolution context. Required when archiving a FALSE_POSITIVE."
          }
        },
        "allOf": [
          {
            "if": {
              "required": ["resolve_reason"],
              "properties": {"resolve_reason": {"const": "FALSE_POSITIVE"}}
            },
            "then": {
              "required": ["resolve_context"],
              "properties": {
                "status": {"const": "ARCHIVED"},
                "resolve_context": {"type": "string", "minLength": 1}
              }
            }
          },
          {
            "if": {
              "anyOf": [
                {
                  "required": ["resolve_reason"],
                  "properties": {"resolve_reason": {"enum": ["FIX", "WONT_FIX"]}}
                },
                {
                  "required": ["resolve_context"],
                  "properties": {"resolve_context": {"type": "string"}},
                  "not": {
                    "required": ["resolve_reason"],
                    "properties": {"resolve_reason": {"const": "FALSE_POSITIVE"}}
                  }
                }
              ]
            },
            "then": {"properties": {"status": {"const": "RESOLVED"}}}
          }
        ],
        "additionalProperties": false
      },
      "SeverityOverrideRequest": {
        "type": "object",
        "properties": {
          "severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "critical",
              "high",
              "medium",
              "low",
              "secured",
              "info",
              null
            ],
            "description": "`secured` is the public value. `info` is accepted only as a deprecated input alias. Null clears the override."
          },
          "severity_score": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0.0,
            "maximum": 10.0,
            "multipleOf": 0.1,
            "description": "Optional CVSS v3.1 score override. Null clears the override."
          }
        },
        "anyOf": [
          {
            "required": [
              "severity"
            ]
          },
          {
            "required": [
              "severity_score"
            ]
          }
        ],
        "additionalProperties": false
      },
      "CommentRequest": {
        "type": "object",
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          }
        },
        "additionalProperties": false
      },
      "CreateReportRequest": {
        "type": "object",
        "required": [
          "target_id"
        ],
        "properties": {
          "target_id": {
            "type": "string",
            "format": "uuid"
          },
          "include_secured_findings": {
            "type": "boolean",
            "default": true
          },
          "include_resolved_findings": {
            "type": "boolean",
            "default": false
          },
          "report_detail_level": {
            "type": "string",
            "enum": [
              "full",
              "condensed"
            ],
            "default": "full"
          }
        },
        "additionalProperties": false
      },
      "PublicSeverityCounts": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "All findings in the bucket, including secured findings.",
            "default": 0
          },
          "vulnerable_total": {
            "type": "integer",
            "title": "Vulnerable Total",
            "description": "Critical, high, medium, and low findings in the bucket.",
            "default": 0
          },
          "critical": {
            "type": "integer",
            "title": "Critical",
            "default": 0
          },
          "high": {
            "type": "integer",
            "title": "High",
            "default": 0
          },
          "medium": {
            "type": "integer",
            "title": "Medium",
            "default": 0
          },
          "low": {
            "type": "integer",
            "title": "Low",
            "default": 0
          },
          "secured": {
            "type": "integer",
            "title": "Secured",
            "default": 0
          }
        },
        "type": "object",
        "title": "PublicSeverityCounts",
        "additionalProperties": false
      },
      "PublicSLAMetrics": {
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "org_wide": {
            "type": "boolean",
            "title": "Org Wide"
          },
          "breaches": {
            "items": {
              "$ref": "#/components/schemas/PublicSLABreach"
            },
            "type": "array",
            "title": "Breaches"
          }
        },
        "type": "object",
        "required": [
          "org_wide",
          "breaches"
        ],
        "title": "PublicSLAMetrics",
        "additionalProperties": false
      },
      "PublicReport": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "target_id": {
            "type": "string",
            "format": "uuid",
            "title": "Target Id"
          },
          "target_name": {
            "type": "string",
            "title": "Target Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "include_secured_findings": {
            "type": "boolean",
            "title": "Include Secured Findings"
          },
          "include_resolved_findings": {
            "type": "boolean",
            "title": "Include Resolved Findings"
          },
          "report_detail_level": {
            "type": "string",
            "enum": [
              "full",
              "condensed"
            ],
            "title": "Report Detail Level"
          }
        },
        "type": "object",
        "required": [
          "id",
          "target_id",
          "target_name",
          "status",
          "created_at",
          "include_secured_findings",
          "include_resolved_findings",
          "report_detail_level"
        ],
        "title": "PublicReport",
        "additionalProperties": false
      },
      "PublicCurrentMetrics": {
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "org_wide": {
            "type": "boolean",
            "title": "Org Wide"
          },
          "open": {
            "$ref": "#/components/schemas/PublicSeverityCounts"
          },
          "assigned_open_total": {
            "type": "integer",
            "title": "Assigned Open Total",
            "default": 0
          },
          "oldest_open_age_days": {
            "type": "integer",
            "title": "Oldest Open Age Days",
            "default": 0
          },
          "oldest_critical_age_days": {
            "type": "integer",
            "title": "Oldest Critical Age Days",
            "default": 0
          },
          "oldest_high_age_days": {
            "type": "integer",
            "title": "Oldest High Age Days",
            "default": 0
          },
          "health_score": {
            "title": "Health Score",
            "type": [
              "number",
              "null"
            ]
          },
          "health_grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F",
              "N/A"
            ],
            "title": "Health Grade"
          },
          "total_findings": {
            "type": "integer",
            "title": "Total Findings"
          }
        },
        "type": "object",
        "required": [
          "org_wide",
          "open",
          "health_grade",
          "total_findings"
        ],
        "title": "PublicCurrentMetrics",
        "additionalProperties": false
      },
      "PublicSLABreach": {
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical"
            ],
            "title": "Severity"
          },
          "sla_days": {
            "type": "integer",
            "title": "Sla Days"
          },
          "total_open": {
            "type": "integer",
            "title": "Total Open",
            "default": 0
          },
          "breached": {
            "type": "integer",
            "title": "Breached",
            "default": 0
          },
          "breach_rate": {
            "type": "number",
            "title": "Breach Rate",
            "default": 0.0
          }
        },
        "type": "object",
        "required": [
          "severity",
          "sla_days"
        ],
        "title": "PublicSLABreach",
        "additionalProperties": false
      },
      "PublicReportStatus": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "target_id": {
            "type": "string",
            "format": "uuid",
            "title": "Target Id"
          },
          "target_name": {
            "type": "string",
            "title": "Target Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "include_secured_findings": {
            "type": "boolean",
            "title": "Include Secured Findings"
          },
          "include_resolved_findings": {
            "type": "boolean",
            "title": "Include Resolved Findings"
          },
          "report_detail_level": {
            "type": "string",
            "enum": [
              "full",
              "condensed"
            ],
            "title": "Report Detail Level"
          },
          "failure_reason": {
            "title": "Failure Reason",
            "description": "Reason the report could not be generated.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "target_id",
          "target_name",
          "status",
          "created_at",
          "include_secured_findings",
          "include_resolved_findings",
          "report_detail_level"
        ],
        "title": "PublicReportStatus",
        "additionalProperties": false
      },
      "PublicPatchSummaries": {
        "properties": {
          "patches": {
            "items": {
              "$ref": "#/components/schemas/PublicPatchSummary"
            },
            "type": "array",
            "title": "Patches"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "next_cursor": {
            "type": ["string", "null"],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "patches",
          "total",
          "limit",
          "offset",
          "next_cursor"
        ],
        "title": "PublicPatchSummaries",
        "additionalProperties": false
      },
      "PublicTargetList": {
        "properties": {
          "targets": {
            "items": {
              "$ref": "#/components/schemas/PublicTarget"
            },
            "type": "array",
            "title": "Targets"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "next_cursor": {
            "title": "Next Cursor",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object",
        "required": [
          "targets",
          "total",
          "limit",
          "offset",
          "next_cursor"
        ],
        "title": "PublicTargetList",
        "additionalProperties": false
      },
      "PublicTimeseriesPoint": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "open": {
            "$ref": "#/components/schemas/PublicSeverityCounts"
          },
          "new": {
            "$ref": "#/components/schemas/PublicSeverityCounts"
          },
          "resolved": {
            "$ref": "#/components/schemas/PublicSeverityCounts"
          },
          "net_new": {
            "type": "integer",
            "title": "Net New",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "date",
          "open",
          "new",
          "resolved"
        ],
        "title": "PublicTimeseriesPoint",
        "additionalProperties": false
      },
      "PublicSingleFindingStatusResult": {
        "properties": {
          "finding_id": {
            "type": "string",
            "format": "uuid",
            "title": "Finding Id"
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "RESOLVED",
              "ARCHIVED"
            ],
            "title": "Status"
          },
          "updated": {
            "type": "boolean",
            "title": "Updated"
          }
        },
        "type": "object",
        "required": [
          "finding_id",
          "status",
          "updated"
        ],
        "title": "PublicSingleFindingStatusResult",
        "additionalProperties": false
      },
      "PublicFindingComments": {
        "properties": {
          "finding_id": {
            "type": "string",
            "format": "uuid",
            "title": "Finding Id"
          },
          "comments": {
            "items": {
              "$ref": "#/components/schemas/PublicFindingComment"
            },
            "type": "array",
            "title": "Comments"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "next_cursor": {
            "type": ["string", "null"],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "finding_id",
          "comments",
          "total",
          "limit",
          "offset",
          "next_cursor"
        ],
        "title": "PublicFindingComments",
        "additionalProperties": false
      },
      "RedTeamAgingResponse": {
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "org_wide": {
            "type": "boolean",
            "title": "Org Wide",
            "default": false
          },
          "total_open": {
            "type": "integer",
            "title": "Total Open",
            "default": 0
          },
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/AgingBucket"
            },
            "type": "array",
            "title": "Buckets"
          }
        },
        "type": "object",
        "required": [
          "buckets"
        ],
        "title": "RedTeamAgingResponse",
        "additionalProperties": false
      },
      "VulnerabilityTagDistribution": {
        "properties": {
          "xss": {
            "type": "integer",
            "title": "Xss"
          },
          "sql_injection": {
            "type": "integer",
            "title": "Sql Injection"
          },
          "command_injection": {
            "type": "integer",
            "title": "Command Injection"
          },
          "ssti": {
            "type": "integer",
            "title": "Ssti"
          },
          "xxe": {
            "type": "integer",
            "title": "Xxe"
          },
          "path_traversal": {
            "type": "integer",
            "title": "Path Traversal"
          },
          "broken_access_control": {
            "type": "integer",
            "title": "Broken Access Control"
          },
          "idor": {
            "type": "integer",
            "title": "Idor"
          },
          "csrf": {
            "type": "integer",
            "title": "Csrf"
          },
          "open_redirect": {
            "type": "integer",
            "title": "Open Redirect"
          },
          "information_disclosure": {
            "type": "integer",
            "title": "Information Disclosure"
          },
          "api_security": {
            "type": "integer",
            "title": "Api Security"
          },
          "ssrf": {
            "type": "integer",
            "title": "Ssrf"
          },
          "file_upload": {
            "type": "integer",
            "title": "File Upload"
          },
          "business_logic": {
            "type": "integer",
            "title": "Business Logic"
          },
          "security_misconfiguration": {
            "type": "integer",
            "title": "Security Misconfiguration"
          },
          "clickjacking": {
            "type": "integer",
            "title": "Clickjacking"
          },
          "network_security": {
            "type": "integer",
            "title": "Network Security"
          },
          "authentication": {
            "type": "integer",
            "title": "Authentication"
          },
          "session_management": {
            "type": "integer",
            "title": "Session Management"
          },
          "cryptographic_issues": {
            "type": "integer",
            "title": "Cryptographic Issues"
          },
          "vulnerable_components": {
            "type": "integer",
            "title": "Vulnerable Components"
          },
          "insecure_deserialization": {
            "type": "integer",
            "title": "Insecure Deserialization"
          },
          "logging_monitoring": {
            "type": "integer",
            "title": "Logging Monitoring"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Recognized tag assignments, not distinct findings. A finding with multiple tags contributes to multiple buckets."
          }
        },
        "type": "object",
        "required": [
          "xss",
          "sql_injection",
          "command_injection",
          "ssti",
          "xxe",
          "path_traversal",
          "broken_access_control",
          "idor",
          "csrf",
          "open_redirect",
          "information_disclosure",
          "api_security",
          "ssrf",
          "file_upload",
          "business_logic",
          "security_misconfiguration",
          "clickjacking",
          "network_security",
          "authentication",
          "session_management",
          "cryptographic_issues",
          "vulnerable_components",
          "insecure_deserialization",
          "logging_monitoring",
          "count"
        ],
        "title": "VulnerabilityTagDistribution",
        "additionalProperties": false
      },
      "OwaspCategoryDistribution": {
        "properties": {
          "broken_access_control": {
            "type": "integer",
            "title": "Broken Access Control"
          },
          "cryptographic_failures": {
            "type": "integer",
            "title": "Cryptographic Failures"
          },
          "injection": {
            "type": "integer",
            "title": "Injection"
          },
          "insecure_design": {
            "type": "integer",
            "title": "Insecure Design"
          },
          "security_misconfiguration": {
            "type": "integer",
            "title": "Security Misconfiguration"
          },
          "vulnerable_components": {
            "type": "integer",
            "title": "Vulnerable Components"
          },
          "auth_failures": {
            "type": "integer",
            "title": "Auth Failures"
          },
          "data_integrity_failures": {
            "type": "integer",
            "title": "Data Integrity Failures"
          },
          "logging_monitoring_failures": {
            "type": "integer",
            "title": "Logging Monitoring Failures"
          },
          "ssrf": {
            "type": "integer",
            "title": "Ssrf"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "description": "Recognized OWASP category assignments. Findings without a recognized category are omitted."
          }
        },
        "type": "object",
        "required": [
          "broken_access_control",
          "cryptographic_failures",
          "injection",
          "insecure_design",
          "security_misconfiguration",
          "vulnerable_components",
          "auth_failures",
          "data_integrity_failures",
          "logging_monitoring_failures",
          "ssrf",
          "count"
        ],
        "title": "OwaspCategoryDistribution",
        "additionalProperties": false
      },
      "PublicReportDownload": {
        "properties": {
          "download_url": {
            "type": "string",
            "title": "Download Url"
          },
          "report_name": {
            "type": "string",
            "title": "Report Name"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In"
          }
        },
        "type": "object",
        "required": [
          "download_url",
          "report_name",
          "expires_in"
        ],
        "title": "PublicReportDownload",
        "additionalProperties": false
      },
      "PublicPatchSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "finding_type": {
            "type": "string",
            "const": "red-team",
            "title": "Finding Type",
            "default": "red-team"
          },
          "title": {
            "title": "Title",
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "title": "Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "severity_score": {
            "title": "Severity Score",
            "type": [
              "number",
              "null"
            ]
          },
          "overridden_severity": {
            "title": "Overridden Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "overridden_severity_score": {
            "title": "Overridden Severity Score",
            "type": [
              "number",
              "null"
            ]
          },
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "target_name": {
            "title": "Target Name",
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "status_updated_at": {
            "title": "Status Updated At",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "patch_created_at": {
            "title": "Patch Created At",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "patch_updated_at": {
            "title": "Patch Updated At",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pr_url": {
            "title": "Pr Url",
            "type": [
              "string",
              "null"
            ]
          },
          "patch_status": {
            "description": "Raw patch execution or pull-request event status. A value such as completed means the patch run finished; it does not mean the remediation was accepted. Prefer patch_state for workflow decisions.",
            "title": "Patch Status",
            "type": [
              "string",
              "null"
            ]
          },
          "patch_state": {
            "description": "Remediation status reflecting patch progress, pull-request state, and finding status. Prefer this field for display and workflow decisions.",
            "title": "Patch State",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "created_at"
        ],
        "title": "PublicPatchSummary",
        "additionalProperties": false
      },
      "PublicFinding": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "assessment_id": {
            "title": "Assessment Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "target_name": {
            "title": "Target Name",
            "type": [
              "string",
              "null"
            ]
          },
          "finding_type": {
            "type": "string",
            "const": "red-team",
            "title": "Finding Type",
            "default": "red-team"
          },
          "title": {
            "title": "Title",
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "title": "Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "severity_score": {
            "title": "Severity Score",
            "type": [
              "number",
              "null"
            ]
          },
          "overridden_severity": {
            "title": "Overridden Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "overridden_severity_score": {
            "title": "Overridden Severity Score",
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "status_updated_at": {
            "title": "Status Updated At",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "resolve_reason": {
            "title": "Resolve Reason",
            "type": [
              "string",
              "null"
            ]
          },
          "resolve_context": {
            "title": "Resolve Context",
            "type": [
              "string",
              "null"
            ]
          },
          "endpoint": {
            "type": "string",
            "title": "Endpoint"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "impact": {
            "type": "string",
            "title": "Impact"
          },
          "evidence": {
            "type": "string",
            "title": "Evidence"
          },
          "approach": {
            "type": "string",
            "title": "Approach"
          },
          "remediation_advice": {
            "title": "Remediation Advice",
            "type": [
              "string",
              "null"
            ]
          },
          "vulnerability_tags": {
            "title": "Vulnerability Tags",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "owasp_category": {
            "title": "Owasp Category",
            "type": [
              "string",
              "null"
            ]
          },
          "retest_status": {
            "title": "Retest Status",
            "description": "Execution state: QUEUED, RUNNING, COMPLETED, or FAILED. FAILED means the retest could not execute; COMPLETED means validation finished and applied the result to the finding lifecycle.",
            "type": [
              "string",
              "null"
            ]
          },
          "retest_failure_reason": {
            "title": "Retest Failure Reason",
            "description": "Customer-visible reason the current retest could not execute. Populated when retest_status is FAILED; null otherwise.",
            "type": [
              "string",
              "null"
            ]
          },
          "retest_failure_code": {
            "title": "Retest Failure Code",
            "description": "Safe machine-readable reason the current retest could not execute. AUTHENTICATION_FAILED and CREDENTIAL_UNAVAILABLE allow a replacement target credential for the next retest. BLOCKED_BY_GUARDRAIL means the target's configured restrictions prevented the retest; INCONCLUSIVE means it could not determine an outcome.",
            "type": [
              "string",
              "null"
            ]
          },
          "retest_started_at": {
            "title": "Retest Started At",
            "description": "When execution of the current retest started.",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "retest_completed_at": {
            "title": "Retest Completed At",
            "description": "When the current retest reached COMPLETED or FAILED.",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "retest_in_progress": {
            "type": "boolean",
            "title": "Retest In Progress",
            "description": "True while the current retest is queued or running.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "created_at",
          "updated_at",
          "endpoint",
          "description",
          "impact",
          "evidence",
          "approach"
        ],
        "title": "PublicFinding",
        "additionalProperties": false
      },
      "PublicFindingSeverityUpdateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "severity": {
            "title": "Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "severity_score": {
            "title": "Severity Score",
            "description": "Effective CVSS v3.1 score after the override is applied.",
            "type": [
              "number",
              "null"
            ]
          },
          "overridden_severity": {
            "title": "Overridden Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "overridden_severity_score": {
            "title": "Overridden Severity Score",
            "type": [
              "number",
              "null"
            ]
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "updated_at"
        ],
        "title": "PublicFindingSeverityUpdateResponse",
        "additionalProperties": false
      },
      "PublicBulkStatusResult": {
        "properties": {
          "affected_count": {
            "type": "integer",
            "title": "Affected Count"
          },
          "operation": {
            "type": "string",
            "const": "status_update",
            "title": "Operation"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "affected_count",
          "operation",
          "message"
        ],
        "title": "PublicBulkStatusResult",
        "additionalProperties": false
      },
      "PublicRunAssessmentResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          },
          "assessment_id": {
            "title": "Assessment Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "target_id": {
            "type": "string",
            "format": "uuid",
            "title": "Target Id"
          },
          "assessment_type": {
            "type": "string",
            "enum": [
              "black-box",
              "white-box"
            ],
            "title": "Assessment Type"
          },
          "assessment_method": {
            "type": "string",
            "enum": [
              "balanced",
              "deep",
              "ultra"
            ],
            "title": "Assessment Method"
          },
          "assessment_started": {
            "type": "boolean",
            "title": "Assessment Started"
          }
        },
        "type": "object",
        "required": [
          "message",
          "target_id",
          "assessment_type",
          "assessment_method",
          "assessment_started"
        ],
        "title": "PublicRunAssessmentResponse",
        "additionalProperties": false
      },
      "AgingBucket": {
        "properties": {
          "label": {
            "type": "string",
            "title": "Label",
            "description": "Cumulative age threshold. A finding in an older threshold also contributes to every younger threshold."
          },
          "critical": {
            "type": "integer",
            "title": "Critical",
            "default": 0
          },
          "high": {
            "type": "integer",
            "title": "High",
            "default": 0
          },
          "medium": {
            "type": "integer",
            "title": "Medium",
            "default": 0
          },
          "low": {
            "type": "integer",
            "title": "Low",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "AgingBucket",
        "additionalProperties": false
      },
      "CategoryDistributionResponse": {
        "properties": {
          "owasp_category_distribution": {
            "$ref": "#/components/schemas/OwaspCategoryDistribution"
          },
          "vulnerability_tag_distribution": {
            "$ref": "#/components/schemas/VulnerabilityTagDistribution"
          }
        },
        "type": "object",
        "required": [
          "owasp_category_distribution",
          "vulnerability_tag_distribution"
        ],
        "title": "CategoryDistributionResponse",
        "additionalProperties": false
      },
      "PublicAssessmentPagination": {
        "properties": {
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          },
          "next_cursor": {
            "title": "Next Cursor",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object",
        "required": [
          "limit",
          "has_more",
          "next_cursor"
        ],
        "title": "PublicAssessmentPagination",
        "additionalProperties": false
      },
      "PublicAssessmentList": {
        "properties": {
          "assessments": {
            "items": {
              "$ref": "#/components/schemas/PublicAssessmentLifecycle"
            },
            "type": "array",
            "title": "Assessments"
          },
          "pagination": {
            "$ref": "#/components/schemas/PublicAssessmentPagination"
          }
        },
        "type": "object",
        "required": [
          "assessments",
          "pagination"
        ],
        "title": "PublicAssessmentList",
        "additionalProperties": false
      },
      "PublicSeverityDistribution": {
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "critical": {
            "type": "integer",
            "title": "Critical",
            "default": 0
          },
          "high": {
            "type": "integer",
            "title": "High",
            "default": 0
          },
          "medium": {
            "type": "integer",
            "title": "Medium",
            "default": 0
          },
          "low": {
            "type": "integer",
            "title": "Low",
            "default": 0
          },
          "secured": {
            "type": "integer",
            "title": "Secured",
            "default": 0
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          }
        },
        "type": "object",
        "title": "PublicSeverityDistribution",
        "additionalProperties": false
      },
      "PublicTimeseriesMetrics": {
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "org_wide": {
            "type": "boolean",
            "title": "Org Wide"
          },
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week"
            ],
            "title": "Granularity"
          },
          "date_from": {
            "type": "string",
            "format": "date",
            "title": "Date From"
          },
          "date_to": {
            "type": "string",
            "format": "date",
            "title": "Date To"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicTimeseriesPoint"
            },
            "type": "array",
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "org_wide",
          "granularity",
          "date_from",
          "date_to",
          "data"
        ],
        "title": "PublicTimeseriesMetrics",
        "additionalProperties": false
      },
      "PublicReportList": {
        "properties": {
          "reports": {
            "items": {
              "$ref": "#/components/schemas/PublicReport"
            },
            "type": "array",
            "title": "Reports"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "next_cursor": {
            "type": ["string", "null"],
            "title": "Next Cursor"
          }
        },
        "type": "object",
        "required": [
          "reports",
          "total",
          "limit",
          "offset",
          "next_cursor"
        ],
        "title": "PublicReportList",
        "additionalProperties": false
      },
      "PublicCancelAssessmentResponse": {
        "properties": {
          "assessment_id": {
            "type": "string",
            "format": "uuid",
            "title": "Assessment Id"
          },
          "status": {
            "type": "string",
            "const": "canceled",
            "title": "Status"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "assessment_id",
          "status",
          "message"
        ],
        "title": "PublicCancelAssessmentResponse",
        "additionalProperties": false
      },
      "PublicRetestResult": {
        "properties": {
          "run_id": {
            "type": "string",
            "format": "uuid",
            "title": "Run Id"
          },
          "retest_status": {
            "type": "string",
            "enum": [
              "QUEUED",
              "FAILED"
            ],
            "title": "Retest Status"
          },
          "retest_failure_reason": {
            "type": ["string", "null"],
            "title": "Retest Failure Reason"
          },
          "retest_failure_code": {
            "type": ["string", "null"],
            "title": "Retest Failure Code"
          }
        },
        "type": "object",
        "required": [
          "run_id",
          "retest_status"
        ],
        "title": "PublicRetestResult",
        "additionalProperties": false
      },
      "PublicRetestFindingRequest": {
        "properties": {
          "target_credential_id": {
            "type": ["string", "null"],
            "format": "uuid",
            "title": "Target Credential Id"
          }
        },
        "type": "object",
        "title": "PublicRetestFindingRequest",
        "additionalProperties": false
      },
      "PublicFindingLifecycleCounts": {
        "type": "object",
        "description": "All visible findings partitioned by lifecycle state.",
        "properties": {
          "active": {"type": "integer", "default": 0},
          "resolved": {"type": "integer", "default": 0},
          "archived": {"type": "integer", "default": 0}
        },
        "additionalProperties": false
      },
      "PublicFindingExposureCounts": {
        "type": "object",
        "description": "Active findings partitioned by current customer exposure.",
        "properties": {
          "vulnerable": {"type": "integer", "default": 0},
          "secured": {"type": "integer", "default": 0}
        },
        "additionalProperties": false
      },
      "PublicFindingSeverityCounts": {
        "type": "object",
        "description": "Active findings partitioned by effective severity.",
        "properties": {
          "critical": {"type": "integer", "default": 0},
          "high": {"type": "integer", "default": 0},
          "medium": {"type": "integer", "default": 0},
          "low": {"type": "integer", "default": 0},
          "secured": {"type": "integer", "default": 0}
        },
        "additionalProperties": false
      },
      "PublicFindingCounts": {
        "properties": {
          "lifecycle": {
            "$ref": "#/components/schemas/PublicFindingLifecycleCounts"
          },
          "exposure": {
            "$ref": "#/components/schemas/PublicFindingExposureCounts"
          },
          "severity": {
            "$ref": "#/components/schemas/PublicFindingSeverityCounts"
          }
        },
        "type": "object",
        "required": [
          "lifecycle",
          "exposure",
          "severity"
        ],
        "title": "PublicFindingCounts",
        "additionalProperties": false
      },
      "PublicRemediationBySeverity": {
        "properties": {
          "severity": {
            "type": "string",
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical"
            ],
            "title": "Severity"
          },
          "count": {
            "type": "integer",
            "title": "Count",
            "default": 0
          },
          "mttr_hours": {
            "title": "Mttr Hours",
            "type": [
              "number",
              "null"
            ]
          },
          "p90_hours": {
            "title": "P90 Hours",
            "type": [
              "number",
              "null"
            ]
          }
        },
        "type": "object",
        "required": [
          "severity"
        ],
        "title": "PublicRemediationBySeverity",
        "additionalProperties": false
      },
      "PublicFindingComment": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "finding_id": {
            "type": "string",
            "format": "uuid",
            "title": "Finding Id"
          },
          "finding_type": {
            "type": "string",
            "const": "red-team",
            "title": "Finding Type",
            "default": "red-team"
          },
          "username": {
            "title": "Username",
            "type": [
              "string",
              "null"
            ]
          },
          "profile_picture_url": {
            "title": "Profile Picture Url",
            "type": [
              "string",
              "null"
            ]
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "finding_id",
          "content",
          "created_at",
          "updated_at"
        ],
        "title": "PublicFindingComment",
        "additionalProperties": false
      },
      "PublicSeverityHistory": {
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "granularity": {
            "type": "string",
            "enum": [
              "day",
              "week",
              "month"
            ],
            "title": "Granularity"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/SeverityScoreTimePoint"
            },
            "type": "array",
            "title": "Data"
          }
        },
        "type": "object",
        "required": [
          "granularity",
          "data"
        ],
        "title": "PublicSeverityHistory",
        "additionalProperties": false
      },
      "PublicFindingSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "assessment_id": {
            "title": "Assessment Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "target_name": {
            "title": "Target Name",
            "type": [
              "string",
              "null"
            ]
          },
          "finding_type": {
            "type": "string",
            "const": "red-team",
            "title": "Finding Type",
            "default": "red-team"
          },
          "title": {
            "title": "Title",
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "title": "Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "severity_score": {
            "title": "Severity Score",
            "type": [
              "number",
              "null"
            ]
          },
          "overridden_severity": {
            "title": "Overridden Severity",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "secured",
              "low",
              "medium",
              "high",
              "critical",
              null
            ]
          },
          "overridden_severity_score": {
            "title": "Overridden Severity Score",
            "type": [
              "number",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "resolve_reason": {
            "title": "Resolve Reason",
            "description": "Lifecycle decision classification. FALSE_POSITIVE distinguishes a customer-corrected archive from other archived findings.",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "retest_status": {
            "title": "Retest Status",
            "description": "Execution state: QUEUED, RUNNING, COMPLETED, or FAILED. FAILED means the retest could not execute; COMPLETED means validation finished and applied the result to the finding lifecycle.",
            "type": [
              "string",
              "null"
            ]
          },
          "retest_failure_reason": {
            "title": "Retest Failure Reason",
            "description": "Customer-visible reason the current retest could not execute. Populated when retest_status is FAILED; null otherwise.",
            "type": [
              "string",
              "null"
            ]
          },
          "retest_failure_code": {
            "title": "Retest Failure Code",
            "description": "Safe machine-readable reason the current retest could not execute. AUTHENTICATION_FAILED and CREDENTIAL_UNAVAILABLE allow a replacement target credential for the next retest. BLOCKED_BY_GUARDRAIL means the target's configured restrictions prevented the retest; INCONCLUSIVE means it could not determine an outcome.",
            "type": [
              "string",
              "null"
            ]
          },
          "retest_started_at": {
            "title": "Retest Started At",
            "description": "When execution of the current retest started.",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "retest_completed_at": {
            "title": "Retest Completed At",
            "description": "When the current retest reached COMPLETED or FAILED.",
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "retest_in_progress": {
            "type": "boolean",
            "title": "Retest In Progress",
            "description": "True while the current retest is queued or running.",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "status",
          "created_at",
          "updated_at"
        ],
        "title": "PublicFindingSummary",
        "additionalProperties": false
      },
      "SeverityScoreTimePoint": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date-time",
            "title": "Date"
          },
          "average_severity_score": {
            "type": "number",
            "title": "Average Severity Score"
          },
          "finding_count": {
            "type": "integer",
            "title": "Finding Count"
          },
          "assessment_count": {
            "type": "integer",
            "title": "Assessment Count",
            "description": "Distinct linked assessments in the bucket. This can be zero when the bucket contains orphan findings without an assessment_id."
          }
        },
        "type": "object",
        "required": [
          "date",
          "average_severity_score",
          "finding_count",
          "assessment_count"
        ],
        "title": "SeverityScoreTimePoint",
        "additionalProperties": false
      },
      "HealthScoreResponse": {
        "properties": {
          "target_id": {
            "type": "string",
            "format": "uuid",
            "title": "Target Id"
          },
          "health_score": {
            "title": "Health Score",
            "minimum": 0,
            "maximum": 10,
            "description": "Security health score from 0 to 10; higher is better. Null means the target has not completed a red-team assessment.",
            "type": [
              "number",
              "null"
            ]
          },
          "health_grade": {
            "type": "string",
            "enum": [
              "A",
              "B",
              "C",
              "D",
              "F",
              "N/A"
            ],
            "title": "Health Grade",
            "description": "A >= 9, B >= 8, C >= 7, D >= 6, and F < 6; N/A means not assessed."
          },
          "total_findings": {
            "type": "integer",
            "title": "Total Findings",
            "description": "Active vulnerable findings contributing to the health score."
          }
        },
        "type": "object",
        "required": [
          "target_id",
          "health_grade",
          "total_findings"
        ],
        "title": "HealthScoreResponse",
        "additionalProperties": false
      },
      "PublicRemediationMetrics": {
        "properties": {
          "target_id": {
            "title": "Target Id",
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "org_wide": {
            "type": "boolean",
            "title": "Org Wide"
          },
          "overall_count": {
            "type": "integer",
            "title": "Overall Count",
            "default": 0
          },
          "overall_mttr_hours": {
            "title": "Overall Mttr Hours",
            "type": [
              "number",
              "null"
            ]
          },
          "overall_p90_hours": {
            "title": "Overall P90 Hours",
            "type": [
              "number",
              "null"
            ]
          },
          "by_severity": {
            "items": {
              "$ref": "#/components/schemas/PublicRemediationBySeverity"
            },
            "type": "array",
            "title": "By Severity"
          }
        },
        "type": "object",
        "required": [
          "org_wide",
          "by_severity"
        ],
        "title": "PublicRemediationMetrics",
        "additionalProperties": false
      },
      "PublicFindingsList": {
        "properties": {
          "findings": {
            "items": {
              "$ref": "#/components/schemas/PublicFindingSummary"
            },
            "type": "array",
            "title": "Findings"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "next_cursor": {
            "title": "Next Cursor",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object",
        "required": [
          "findings",
          "total",
          "limit",
          "offset",
          "next_cursor"
        ],
        "title": "PublicFindingsList",
        "additionalProperties": false
      }
    }
  }
}
