{
    "openapi": "3.1.0",
    "info": {
        "title": "Protez API",
        "version": "1.0.0",
        "summary": "Programmatic access to scans, schedules, CVEs and notifications.",
        "description": "Public REST API for the Protez security scanning platform.\n\n**Authentication:** create a token in *Tokens de API* (`/api-tokens`) and send it as\n`Authorization: Bearer <token>` together with `Accept: application/json`.\n\n**Token abilities:** `read` \u2192 GET endpoints only; `scan` \u2192 read + create/update/delete.\nA read-only token calling a write endpoint gets `403 insufficient_token_ability`.\n\n**Organizations:** requests run in your current organization. Send\n`X-Organization-Id: <id>` (see `GET /organizations`) to act in another one you belong to.\n\n**Limits:** 60 requests/min per user (`429` + `Retry-After`). Scan creation also\nhonours the plan's monthly quota (`429 monthly_scan_quota_exceeded`, see `GET /me/quota`).\n\n**Typical flow:** `POST /scans` \u2192 `202` with the scan `id` \u2192 poll `GET /scans/{id}` until\n`status` is `completed` or `failed` \u2192 read `vulnerabilities`, `grade`, `GET /scans/{id}/diff`\nor `GET /scans/{id}/export/sarif` (GitHub code scanning).\n\n**Versioning:** every breaking change creates a new path prefix (`/api/v2/`,\n`/api/v3/`); the previous version stays live for the documented deprecation\nwindow. Customer CI integrations don't break on platform upgrades.\n\n**Webhooks:** see `docs/FEATURES.md` and the drop-in receiver SDKs at\n`/sdk/ProtezWebhookVerifier.php`, `/sdk/protez-webhook-verifier.cjs`,\nand `/sdk/protez_webhook_verifier.py`.\n\n**Security policy:** [SECURITY.md](/SECURITY.md). Responsible disclosure\nvia security@protez.app.",
        "contact": {
            "name": "Protez Security Team",
            "email": "security@protez.app",
            "url": "https://protez.app/SECURITY.md"
        },
        "license": {
            "name": "Commercial \u2014 see Terms of Service",
            "url": "https://protez.app/terms"
        }
    },
    "servers": [
        {
            "url": "https://protez.app/api/v1",
            "description": "Production"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "Scans",
            "description": "Create, list, fetch and diff security scans."
        },
        {
            "name": "Schedules",
            "description": "Recurring scan policies for continuous monitoring."
        },
        {
            "name": "CVEs",
            "description": "Search the curated CVE database powering the matcher."
        },
        {
            "name": "Notifications",
            "description": "In-platform delivery log + read state."
        },
        {
            "name": "Account",
            "description": "Authenticated user + organization context."
        },
        {
            "name": "SAST",
            "description": "Source-code static analysis via Semgrep (pattern engine fallback)."
        },
        {
            "name": "Containers",
            "description": "Container image vulnerability scanning via Trivy/Grype."
        },
        {
            "name": "Mobile",
            "description": "Android (APK) and iOS (IPA) static analysis \u2014 manifest checks, embedded secrets."
        },
        {
            "name": "Policy",
            "description": "OPA/Rego policy-as-code rules evaluated against findings."
        },
        {
            "name": "Health",
            "description": "Public liveness check \u2014 no auth required."
        }
    ],
    "paths": {
        "/health": {
            "get": {
                "tags": [
                    "Health"
                ],
                "summary": "Liveness + per-subsystem status. No auth.",
                "security": [],
                "responses": {
                    "200": {
                        "description": "Health envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Health"
                                }
                            }
                        }
                    }
                },
                "operationId": "getHealth"
            }
        },
        "/me": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Current authenticated user + token + organization.",
                "description": "Use it to validate a token in CI before running scans.",
                "responses": {
                    "200": {
                        "description": "Me payload",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Me"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getMe"
            }
        },
        "/me/quota": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Plan and monthly scan quota snapshot.",
                "description": "Call before a CI loop to know how many scans are left this month. `per_month` = -1 means unlimited.",
                "responses": {
                    "200": {
                        "description": "Quota snapshot",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Quota"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getMeQuota"
            }
        },
        "/organizations": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "List organizations the authenticated user belongs to.",
                "responses": {
                    "200": {
                        "description": "Organization list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OrganizationList"
                                }
                            }
                        }
                    }
                },
                "operationId": "getOrganizations"
            }
        },
        "/scans": {
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "List scans of the current organization (newest first).",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "",
                        "schema": {
                            "type": "integer",
                            "default": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1\u2013100)",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter by status",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "pending",
                                "running",
                                "completed",
                                "failed"
                            ]
                        }
                    },
                    {
                        "name": "target",
                        "in": "query",
                        "required": false,
                        "description": "Substring match on target_url",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Paginated scan list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScanList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getScans"
            },
            "post": {
                "tags": [
                    "Scans"
                ],
                "summary": "Start a new web security scan.",
                "description": "Requires a token with the `scan` ability. The scan runs asynchronously: the response is `202` with the scan `id` and a `Location` header. Poll `GET /scans/{scan}` (typically 1\u201310 minutes). Private, loopback, link-local and cloud-metadata targets are rejected with `422`.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScanCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Scan queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Scan"
                                        }
                                    }
                                }
                            }
                        },
                        "headers": {
                            "Location": {
                                "description": "URL of the new scan",
                                "schema": {
                                    "type": "string",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error (invalid or restricted target_url)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "postScans"
            }
        },
        "/scans/{scan}": {
            "parameters": [
                {
                    "name": "scan",
                    "in": "path",
                    "required": true,
                    "description": "Scan id (UUID)",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "Fetch a scan with its findings.",
                "responses": {
                    "200": {
                        "description": "Scan detail",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Scan"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getScansScan"
            },
            "delete": {
                "tags": [
                    "Scans"
                ],
                "summary": "Delete a scan and its findings (requires `scan` ability).",
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "404": {
                        "description": "Scan not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "deleteScansScan"
            }
        },
        "/scans/{scan}/diff": {
            "parameters": [
                {
                    "name": "scan",
                    "in": "path",
                    "required": true,
                    "description": "Scan id (UUID)",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "Diff this scan against the previous completed scan of the same target.",
                "responses": {
                    "200": {
                        "description": "Diff envelope",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/ScanDiff"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getScansScanDiff"
            }
        },
        "/scans/{scan}/export/sarif": {
            "parameters": [
                {
                    "name": "scan",
                    "in": "path",
                    "required": true,
                    "description": "Scan id (UUID)",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "Scans"
                ],
                "summary": "Export findings as SARIF 2.1.0 (GitHub / GitLab code scanning).",
                "responses": {
                    "200": {
                        "description": "SARIF 2.1.0 log",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "description": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getScansScanExportSarif"
            }
        },
        "/scan-schedules": {
            "get": {
                "tags": [
                    "Schedules"
                ],
                "summary": "List recurring scan schedules.",
                "responses": {
                    "200": {
                        "description": "Schedule list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ScheduleList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getScanSchedules"
            },
            "post": {
                "tags": [
                    "Schedules"
                ],
                "summary": "Create a recurring schedule (requires `scan` ability).",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScheduleCreateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Newly created schedule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Schedule"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "postScanSchedules"
            }
        },
        "/scan-schedules/{schedule}": {
            "parameters": [
                {
                    "name": "schedule",
                    "in": "path",
                    "required": true,
                    "description": "Schedule id",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "patch": {
                "tags": [
                    "Schedules"
                ],
                "summary": "Update, pause or resume a schedule.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ScheduleUpdate"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated schedule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Schedule"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "patchScanSchedulesSchedule"
            },
            "delete": {
                "tags": [
                    "Schedules"
                ],
                "summary": "Delete a schedule.",
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "deleteScanSchedulesSchedule"
            }
        },
        "/cves": {
            "get": {
                "tags": [
                    "CVEs"
                ],
                "summary": "Search the CVE catalogue (ordered by CVSS, highest first).",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Free-text search (id, description, vendor, product)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "severity",
                        "in": "query",
                        "required": false,
                        "description": "Severity",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "critical",
                                "high",
                                "medium",
                                "low"
                            ]
                        }
                    },
                    {
                        "name": "vendor",
                        "in": "query",
                        "required": false,
                        "description": "Filter by vendor",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "product",
                        "in": "query",
                        "required": false,
                        "description": "Filter by product",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "year",
                        "in": "query",
                        "required": false,
                        "description": "CVE year, e.g. 2026",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "min_cvss",
                        "in": "query",
                        "required": false,
                        "description": "Minimum CVSS base score",
                        "schema": {
                            "type": "number"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Items per page (1\u2013100)",
                        "schema": {
                            "type": "integer",
                            "default": 25
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "CVE list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CveList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getCves"
            }
        },
        "/cves/{cve_id}": {
            "parameters": [
                {
                    "name": "cve_id",
                    "in": "path",
                    "required": true,
                    "description": "CVE id (CVE-YYYY-NNNNN)",
                    "schema": {
                        "type": "string"
                    }
                }
            ],
            "get": {
                "tags": [
                    "CVEs"
                ],
                "summary": "Fetch a CVE with verification metadata + mitigations.",
                "responses": {
                    "200": {
                        "description": "CVE record",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "required": [
                                        "data"
                                    ],
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Cve"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "CVE not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or invalid token",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Token lacks the required ability, or resource belongs to another organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Rate limit exceeded (see Retry-After header)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getCvesCveId"
            }
        },
        "/notifications": {
            "get": {
                "tags": [
                    "Notifications"
                ],
                "summary": "List in-platform notifications, most-recent first.",
                "responses": {
                    "200": {
                        "description": "Notification list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/NotificationList"
                                }
                            }
                        }
                    }
                },
                "operationId": "getNotifications"
            }
        },
        "/notifications/{notification}/read": {
            "parameters": [
                {
                    "name": "notification",
                    "in": "path",
                    "required": true,
                    "description": "Notification id",
                    "schema": {
                        "type": "integer"
                    }
                }
            ],
            "patch": {
                "tags": [
                    "Notifications"
                ],
                "summary": "Mark a notification as read.",
                "responses": {
                    "200": {
                        "description": "Updated notification",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Notification"
                                }
                            }
                        }
                    }
                },
                "operationId": "patchNotificationsNotificationRead"
            }
        },
        "/sast/scans": {
            "post": {
                "tags": [
                    "SAST"
                ],
                "summary": "Upload source for SAST scan",
                "description": "Multipart upload (`archive` field) of a zip or single source file. Returns 202; the actual scan runs in the background. Poll the resource endpoint (or subscribe to the `sast.completed` webhook event) for findings.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "archive"
                                ],
                                "properties": {
                                    "archive": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "zip \u2264 20MB or single source file (.php/.js/.ts/.py/.java/.rb/.go)"
                                    },
                                    "label": {
                                        "type": "string",
                                        "maxLength": 120
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Scan queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SastScan"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Invalid archive or validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "postSastScans"
            }
        },
        "/sast/scans/{scan}": {
            "get": {
                "tags": [
                    "SAST"
                ],
                "summary": "Fetch a SAST scan + findings",
                "parameters": [
                    {
                        "name": "scan",
                        "in": "path",
                        "required": true,
                        "description": "Scan id",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Scan with embedded findings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SastScanDetailed"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Scan is not in this organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Scan not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getSastScansScan"
            }
        },
        "/container/scans": {
            "get": {
                "tags": [
                    "Containers"
                ],
                "summary": "List container image scan findings",
                "parameters": [
                    {
                        "name": "image_ref",
                        "in": "query",
                        "required": false,
                        "description": "Filter by image reference",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Image scan findings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ImageScanList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No active organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getContainerScans"
            },
            "post": {
                "tags": [
                    "Containers"
                ],
                "summary": "Queue an image scan",
                "description": "Trivy preferred, Grype fallback. The image must already be reachable by the scan host. Returns 202 \u2014 poll the GET endpoint (or subscribe to `image_scan.completed`) for findings.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "image_ref"
                                ],
                                "properties": {
                                    "image_ref": {
                                        "type": "string",
                                        "pattern": "^[A-Za-z0-9._:/@\\-]+$",
                                        "maxLength": 512
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Image scan queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ImageScanQueued"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Invalid image_ref",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "postContainerScans"
            }
        },
        "/container/sbom": {
            "get": {
                "tags": [
                    "Containers"
                ],
                "summary": "Generate a CycloneDX SBOM for an image",
                "description": "Returns a CycloneDX 1.5 software bill of materials. Trivy preferred, Syft fallback. The response body is the SBOM document wrapped in `{ data: { ..., sbom: { bomFormat, ... } } }`.",
                "parameters": [
                    {
                        "name": "image_ref",
                        "in": "query",
                        "required": false,
                        "description": "Image reference (alpine:3.18, registry/app@sha256:...)",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "CycloneDX SBOM",
                        "content": {
                            "application/vnd.cyclonedx+json": {
                                "schema": {
                                    "$ref": "#/components/schemas/SbomResponse"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Generation failed or invalid image_ref",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getContainerSbom"
            }
        },
        "/container/sarif": {
            "get": {
                "tags": [
                    "Containers"
                ],
                "summary": "Export image findings as SARIF 2.1.0",
                "description": "Returns persisted findings for the most recent scan of `image_ref` in SARIF 2.1.0 format. Pipe straight into `github/codeql-action/upload-sarif` to surface image CVEs in GitHub Code Scanning.",
                "parameters": [
                    {
                        "name": "image_ref",
                        "in": "query",
                        "required": false,
                        "description": "Image reference of a previously-scanned image",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SARIF document",
                        "content": {
                            "application/sarif+json": {
                                "schema": {
                                    "type": "object",
                                    "description": "OASIS SARIF 2.1.0"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No scans for this image yet",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getContainerSarif"
            }
        },
        "/mobile/scans": {
            "get": {
                "tags": [
                    "Mobile"
                ],
                "summary": "List mobile app scan findings",
                "parameters": [
                    {
                        "name": "label",
                        "in": "query",
                        "required": false,
                        "description": "Filter by bundle label",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Mobile scan findings",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/MobileScanList"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No active organization",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getMobileScans"
            },
            "post": {
                "tags": [
                    "Mobile"
                ],
                "summary": "Upload an APK/IPA for scanning",
                "description": "Multipart upload (`bundle` field). The bundle is deleted after scanning; only findings are kept. Returns 202 \u2014 subscribe to `mobile_scan.completed` for completion notification.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "bundle"
                                ],
                                "properties": {
                                    "bundle": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "APK / IPA / zip \u2264 75MB"
                                    },
                                    "label": {
                                        "type": "string",
                                        "maxLength": 120,
                                        "pattern": "^[A-Za-z0-9._@:/+\\- ]+$"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Mobile scan queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/MobileScanQueued"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Authentication required",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Invalid bundle or label",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "postMobileScans"
            }
        },
        "/mobile/sarif": {
            "get": {
                "tags": [
                    "Mobile"
                ],
                "summary": "Export mobile findings as SARIF 2.1.0",
                "description": "Returns persisted findings for `label` in SARIF 2.1.0 format. Pipe into `github/codeql-action/upload-sarif` to surface mobile misconfigs in GitHub Code Scanning.",
                "parameters": [
                    {
                        "name": "label",
                        "in": "query",
                        "required": false,
                        "description": "Bundle label of a previously-scanned APK/IPA",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "SARIF document",
                        "content": {
                            "application/sarif+json": {
                                "schema": {
                                    "type": "object",
                                    "description": "OASIS SARIF 2.1.0"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "No scans yet for this org",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "getMobileSarif"
            }
        },
        "/policy-rules": {
            "get": {
                "tags": [
                    "Policy"
                ],
                "summary": "List the organization's policy rules",
                "responses": {
                    "200": {
                        "description": "Policy rule list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PolicyRuleList"
                                }
                            }
                        }
                    }
                },
                "operationId": "getPolicyRules"
            },
            "post": {
                "tags": [
                    "Policy"
                ],
                "summary": "Create or update a policy rule",
                "description": "Idempotent by `rule_id`. Sources accepted: OPA Rego, YAML DSL, JSON DSL.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/PolicyRuleInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Rule updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PolicyRuleSummary"
                                }
                            }
                        }
                    },
                    "201": {
                        "description": "Rule created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PolicyRuleSummary"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Compile error or validation failure",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "postPolicyRules"
            }
        },
        "/policy-rules/dry-run": {
            "post": {
                "tags": [
                    "Policy"
                ],
                "summary": "Dry-run a policy rule against the org's recent records",
                "description": "Compile and evaluate a rule without persisting violations. Used by CI/CD pipelines to validate a Rego change before merging, and by the UI's \"Test rule\" button.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "target",
                                    "source_format",
                                    "source"
                                ],
                                "properties": {
                                    "target": {
                                        "type": "string",
                                        "enum": [
                                            "vulnerability",
                                            "cloud_finding",
                                            "scan"
                                        ]
                                    },
                                    "source_format": {
                                        "type": "string",
                                        "enum": [
                                            "rego",
                                            "yaml",
                                            "json"
                                        ]
                                    },
                                    "source": {
                                        "type": "string",
                                        "maxLength": 20000
                                    },
                                    "sample_size": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 1000,
                                        "default": 200
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Dry-run result",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PolicyDryRunResult"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Compile error or validation failure",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "postPolicyRulesDryRun"
            }
        },
        "/policy-rules/{ruleId}": {
            "delete": {
                "tags": [
                    "Policy"
                ],
                "summary": "Delete a policy rule",
                "parameters": [
                    {
                        "name": "ruleId",
                        "in": "path",
                        "required": true,
                        "description": "Stable rule_id assigned at create time",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "404": {
                        "description": "Rule not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "operationId": "deletePolicyRulesRuleId"
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "Sanctum personal access token",
                "description": "Issue tokens from Profile \u2192 API tokens. Send as `Authorization: Bearer <token>`."
            }
        },
        "schemas": {
            "Health": {
                "type": "object",
                "properties": {
                    "status": {
                        "type": "string",
                        "enum": [
                            "ok",
                            "degraded",
                            "down"
                        ]
                    },
                    "checks": {
                        "type": "object",
                        "properties": {
                            "database": {
                                "type": "string",
                                "enum": [
                                    "ok",
                                    "degraded",
                                    "fail"
                                ]
                            },
                            "queue": {
                                "type": "string",
                                "enum": [
                                    "ok",
                                    "degraded",
                                    "fail"
                                ]
                            },
                            "cache": {
                                "type": "string",
                                "enum": [
                                    "ok",
                                    "degraded",
                                    "fail"
                                ]
                            }
                        }
                    },
                    "time": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "disclosure": {
                        "type": "string"
                    }
                },
                "required": [
                    "status",
                    "checks",
                    "time"
                ]
            },
            "Me": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "email": {
                        "type": "string",
                        "format": "email"
                    },
                    "name": {
                        "type": "string"
                    },
                    "is_admin": {
                        "type": "boolean"
                    },
                    "token_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "token_abilities": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "current_organization": {
                        "$ref": "#/components/schemas/Organization"
                    }
                }
            },
            "Organization": {
                "type": [
                    "object",
                    "null"
                ],
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "slug": {
                        "type": "string"
                    },
                    "role": {
                        "type": "string",
                        "enum": [
                            "owner",
                            "admin",
                            "member",
                            "viewer"
                        ]
                    }
                }
            },
            "OrganizationList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Organization"
                        }
                    },
                    "current_organization_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                }
            },
            "Quota": {
                "type": "object",
                "properties": {
                    "plan": {
                        "type": "string",
                        "examples": [
                            "free",
                            "professional",
                            "enterprise"
                        ]
                    },
                    "per_minute": {
                        "type": "integer"
                    },
                    "per_month": {
                        "type": "integer",
                        "description": "-1 = unlimited"
                    },
                    "used_this_month": {
                        "type": "integer"
                    },
                    "remaining": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "description": "null when unlimited"
                    }
                }
            },
            "ScanCreateRequest": {
                "type": "object",
                "required": [
                    "target_url"
                ],
                "properties": {
                    "target_url": {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048,
                        "examples": [
                            "https://www.example.com"
                        ]
                    },
                    "scan_type": {
                        "type": "string",
                        "enum": [
                            "full",
                            "quick",
                            "deep"
                        ],
                        "description": "Accepted for compatibility; every API scan runs the full web profile."
                    }
                }
            },
            "Scan": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid"
                    },
                    "target_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "scan_type": {
                        "type": "string",
                        "enum": [
                            "full"
                        ]
                    },
                    "scan_mode": {
                        "type": "string",
                        "enum": [
                            "web",
                            "ssh",
                            "sftp",
                            "ftp",
                            "ftps"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "running",
                            "completed",
                            "failed"
                        ]
                    },
                    "progress": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                    },
                    "security_score": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                    },
                    "grade": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "A+",
                            "A",
                            "B",
                            "C",
                            "D",
                            "F",
                            null
                        ]
                    },
                    "error": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Failure reason when status = failed"
                    },
                    "severity_counts": {
                        "type": "object",
                        "properties": {
                            "critical": {
                                "type": "integer"
                            },
                            "high": {
                                "type": "integer"
                            },
                            "medium": {
                                "type": "integer"
                            },
                            "low": {
                                "type": "integer"
                            }
                        }
                    },
                    "vulnerabilities_found": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "started_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "vulnerabilities": {
                        "type": "array",
                        "description": "Only on GET /scans/{scan}",
                        "items": {
                            "$ref": "#/components/schemas/Vulnerability"
                        }
                    },
                    "links": {
                        "type": "object",
                        "properties": {
                            "self": {
                                "type": "string",
                                "format": "uri"
                            },
                            "diff": {
                                "type": "string",
                                "format": "uri"
                            },
                            "sarif": {
                                "type": "string",
                                "format": "uri"
                            },
                            "web": {
                                "type": "string",
                                "format": "uri"
                            },
                            "pdf": {
                                "type": "string",
                                "format": "uri",
                                "description": "PDF report (browser session required)"
                            }
                        }
                    }
                }
            },
            "ScanList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Scan"
                        }
                    },
                    "links": {
                        "type": "object",
                        "properties": {
                            "first": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "last": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "prev": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "next": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            }
                        }
                    },
                    "meta": {
                        "type": "object",
                        "properties": {
                            "current_page": {
                                "type": "integer"
                            },
                            "from": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "to": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "per_page": {
                                "type": "integer"
                            },
                            "total": {
                                "type": "integer"
                            },
                            "last_page": {
                                "type": "integer"
                            },
                            "path": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    }
                },
                "required": [
                    "data"
                ]
            },
            "DiffItem": {
                "type": "object",
                "properties": {
                    "key": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer"
                    },
                    "title": {
                        "type": "string"
                    },
                    "cve_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "severity": {
                        "type": "string"
                    },
                    "cvss_score": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "affected_component": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "confidence_status": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "confidence_score": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    }
                }
            },
            "ScanDiff": {
                "type": "object",
                "properties": {
                    "previous_scan_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "current_scan_id": {
                        "type": "integer"
                    },
                    "previous_scanned_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "current_scanned_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "new": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/DiffItem"
                        }
                    },
                    "resolved": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/DiffItem"
                        }
                    },
                    "escalated": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/DiffItem"
                        }
                    },
                    "de_escalated": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/DiffItem"
                        }
                    },
                    "unchanged": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/DiffItem"
                        }
                    },
                    "summary": {
                        "type": "object",
                        "properties": {
                            "new_count": {
                                "type": "integer"
                            },
                            "resolved_count": {
                                "type": "integer"
                            },
                            "escalated_count": {
                                "type": "integer"
                            },
                            "de_escalated_count": {
                                "type": "integer"
                            },
                            "unchanged_count": {
                                "type": "integer"
                            },
                            "net_change": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "Vulnerability": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "scan_id": {
                        "type": "integer"
                    },
                    "cve_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "severity": {
                        "type": "string",
                        "enum": [
                            "critical",
                            "high",
                            "medium",
                            "low",
                            "info"
                        ]
                    },
                    "cvss_score": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 10
                    },
                    "affected_component": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "recommendation": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "is_false_positive": {
                        "type": "boolean"
                    },
                    "confidence_status": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "confirmed",
                            "potential",
                            "informational",
                            null
                        ]
                    },
                    "confidence_score": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0,
                        "maximum": 100
                    },
                    "verification_evidence": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "additionalProperties": true
                    },
                    "reproduction_steps": {
                        "type": [
                            "array",
                            "null"
                        ]
                    },
                    "mitigation_steps": {
                        "type": [
                            "array",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "required": [
                    "id",
                    "severity"
                ]
            },
            "AttackTechnique": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "description": "MITRE ATT&CK technique id, e.g. T1190 or T1505.003"
                    },
                    "name": {
                        "type": "string"
                    },
                    "tactic": {
                        "type": "string",
                        "description": "MITRE tactic slug, e.g. initial-access"
                    }
                }
            },
            "Schedule": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "target_url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "scan_type": {
                        "type": "string"
                    },
                    "cadence": {
                        "type": "string",
                        "enum": [
                            "hourly",
                            "every_6h",
                            "daily",
                            "weekly",
                            "monthly"
                        ]
                    },
                    "alert_on": {
                        "type": "string",
                        "enum": [
                            "any_change",
                            "new_finding",
                            "severity_increase",
                            "critical_only"
                        ]
                    },
                    "alert_email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "last_run_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "next_run_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "runs_completed": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "runs_failed": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "ScheduleList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Schedule"
                        }
                    },
                    "links": {
                        "type": "object",
                        "properties": {
                            "first": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "last": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "prev": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "next": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            }
                        }
                    },
                    "meta": {
                        "type": "object",
                        "properties": {
                            "current_page": {
                                "type": "integer"
                            },
                            "from": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "to": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "per_page": {
                                "type": "integer"
                            },
                            "total": {
                                "type": "integer"
                            },
                            "last_page": {
                                "type": "integer"
                            },
                            "path": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    }
                },
                "required": [
                    "data"
                ]
            },
            "ScheduleCreateRequest": {
                "type": "object",
                "required": [
                    "name",
                    "target_url",
                    "cadence",
                    "alert_on"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120
                    },
                    "target_url": {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                    },
                    "cadence": {
                        "type": "string",
                        "enum": [
                            "hourly",
                            "every_6h",
                            "daily",
                            "weekly",
                            "monthly"
                        ]
                    },
                    "alert_on": {
                        "type": "string",
                        "enum": [
                            "any_change",
                            "new_finding",
                            "severity_increase",
                            "critical_only"
                        ]
                    },
                    "alert_email": {
                        "type": "string",
                        "format": "email"
                    },
                    "scan_type": {
                        "type": "string",
                        "enum": [
                            "full",
                            "quick",
                            "deep"
                        ]
                    }
                }
            },
            "ScheduleUpdate": {
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 120
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "cadence": {
                        "type": "string",
                        "enum": [
                            "hourly",
                            "every_6h",
                            "daily",
                            "weekly",
                            "monthly"
                        ]
                    },
                    "alert_on": {
                        "type": "string",
                        "enum": [
                            "any_change",
                            "new_finding",
                            "severity_increase",
                            "critical_only"
                        ]
                    },
                    "alert_email": {
                        "type": "string",
                        "format": "email"
                    }
                }
            },
            "Cve": {
                "type": "object",
                "properties": {
                    "cve_id": {
                        "type": "string"
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "year": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "severity": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cvss_score": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "cvss_vector": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "attack_vector": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "vendor": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "product": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "version": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "cwe_ids": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "references": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "published_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "modified_date": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "verification": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "additionalProperties": true
                    },
                    "reproduction_steps": {
                        "type": [
                            "array",
                            "null"
                        ]
                    },
                    "false_positive_checks": {
                        "type": [
                            "array",
                            "null"
                        ]
                    },
                    "mitigation_steps": {
                        "type": [
                            "array",
                            "null"
                        ]
                    },
                    "false_positive_risk": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                }
            },
            "CveList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Cve"
                        }
                    },
                    "links": {
                        "type": "object",
                        "properties": {
                            "first": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "last": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "prev": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "next": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            }
                        }
                    },
                    "meta": {
                        "type": "object",
                        "properties": {
                            "current_page": {
                                "type": "integer"
                            },
                            "from": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "to": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "per_page": {
                                "type": "integer"
                            },
                            "total": {
                                "type": "integer"
                            },
                            "last_page": {
                                "type": "integer"
                            },
                            "path": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    }
                },
                "required": [
                    "data"
                ]
            },
            "Notification": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "type": {
                        "type": "string"
                    },
                    "data": {
                        "type": "object"
                    },
                    "read_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "NotificationList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Notification"
                        }
                    },
                    "links": {
                        "type": "object",
                        "properties": {
                            "first": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "last": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "prev": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            },
                            "next": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "uri"
                            }
                        }
                    },
                    "meta": {
                        "type": "object",
                        "properties": {
                            "current_page": {
                                "type": "integer"
                            },
                            "from": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "to": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "per_page": {
                                "type": "integer"
                            },
                            "total": {
                                "type": "integer"
                            },
                            "last_page": {
                                "type": "integer"
                            },
                            "path": {
                                "type": "string",
                                "format": "uri"
                            }
                        }
                    }
                },
                "required": [
                    "data"
                ]
            },
            "SastScan": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "label": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "running",
                            "completed",
                            "failed"
                        ]
                    },
                    "progress": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100
                    },
                    "started_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    },
                    "engine": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "semgrep",
                            "pattern"
                        ]
                    },
                    "severity_counts": {
                        "type": "object",
                        "properties": {
                            "critical": {
                                "type": "integer"
                            },
                            "high": {
                                "type": "integer"
                            },
                            "medium": {
                                "type": "integer"
                            },
                            "low": {
                                "type": "integer"
                            }
                        }
                    },
                    "stats": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "properties": {
                            "files_scanned": {
                                "type": "integer"
                            },
                            "rules_run": {
                                "type": "integer"
                            },
                            "duration_ms": {
                                "type": "integer"
                            },
                            "engine_version": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "SastScanDetailed": {
                "allOf": [
                    {
                        "$ref": "#/components/schemas/SastScan"
                    },
                    {
                        "type": "object",
                        "properties": {
                            "findings": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "title": {
                                            "type": "string"
                                        },
                                        "severity": {
                                            "type": "string"
                                        },
                                        "cwe": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "location": {
                                            "type": "string",
                                            "description": "file:line"
                                        },
                                        "recommendation": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                ]
            },
            "ImageScanQueued": {
                "type": "object",
                "properties": {
                    "image_ref": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "queued"
                        ]
                    },
                    "cloud_account_id": {
                        "type": "integer"
                    }
                }
            },
            "ImageScanList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "cve_id": {
                                    "type": "string"
                                },
                                "package": {
                                    "type": "string"
                                },
                                "installed_version": {
                                    "type": "string"
                                },
                                "fixed_version": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "severity": {
                                    "type": "string",
                                    "enum": [
                                        "CRITICAL",
                                        "HIGH",
                                        "MEDIUM",
                                        "LOW"
                                    ]
                                },
                                "image_ref": {
                                    "type": "string"
                                },
                                "cvss_score": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time"
                                }
                            }
                        }
                    },
                    "meta": {
                        "type": "object",
                        "properties": {
                            "last_scanned_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "last_scan_status": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "MobileScanQueued": {
                "type": "object",
                "properties": {
                    "label": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "queued"
                        ]
                    },
                    "cloud_account_id": {
                        "type": "integer"
                    }
                }
            },
            "MobileScanList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "check_id": {
                                    "type": "string",
                                    "description": "e.g. mobile.android.allow_backup"
                                },
                                "severity": {
                                    "type": "string",
                                    "enum": [
                                        "CRITICAL",
                                        "HIGH",
                                        "MEDIUM",
                                        "LOW",
                                        "INFO"
                                    ]
                                },
                                "label": {
                                    "type": "string"
                                },
                                "resource_id": {
                                    "type": "string"
                                },
                                "title": {
                                    "type": "string"
                                },
                                "description": {
                                    "type": "string"
                                },
                                "recommendation": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "evidence": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "additionalProperties": true
                                },
                                "mapped_controls": {
                                    "type": [
                                        "array",
                                        "null"
                                    ],
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time"
                                }
                            }
                        }
                    },
                    "meta": {
                        "type": "object",
                        "properties": {
                            "last_scanned_at": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "format": "date-time"
                            },
                            "last_scan_status": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "SbomResponse": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "required": [
                            "image_ref",
                            "engine",
                            "sbom"
                        ],
                        "properties": {
                            "image_ref": {
                                "type": "string"
                            },
                            "engine": {
                                "type": "string",
                                "enum": [
                                    "trivy",
                                    "syft"
                                ]
                            },
                            "duration_ms": {
                                "type": "integer"
                            },
                            "sbom": {
                                "type": "object",
                                "description": "CycloneDX 1.5 SBOM. Schema: https://cyclonedx.org/schema/bom-1.5.schema.json"
                            }
                        }
                    }
                }
            },
            "PolicyRuleSummary": {
                "type": "object",
                "properties": {
                    "rule_id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "target": {
                        "type": "string",
                        "enum": [
                            "vulnerability",
                            "cloud_finding",
                            "scan"
                        ]
                    },
                    "severity": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "violation_count": {
                        "type": "integer"
                    },
                    "last_evaluated_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                }
            },
            "PolicyRuleList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/PolicyRuleSummary"
                        }
                    }
                }
            },
            "PolicyRuleInput": {
                "type": "object",
                "required": [
                    "rule_id",
                    "name",
                    "target",
                    "source_format",
                    "source"
                ],
                "properties": {
                    "rule_id": {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9_\\-\\.]*$",
                        "maxLength": 64
                    },
                    "name": {
                        "type": "string",
                        "maxLength": 120
                    },
                    "description": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 1000
                    },
                    "target": {
                        "type": "string",
                        "enum": [
                            "vulnerability",
                            "cloud_finding",
                            "scan"
                        ]
                    },
                    "source_format": {
                        "type": "string",
                        "enum": [
                            "rego",
                            "yaml",
                            "json"
                        ]
                    },
                    "source": {
                        "type": "string",
                        "maxLength": 20000
                    },
                    "enabled": {
                        "type": "boolean"
                    }
                }
            },
            "PolicyDryRunResult": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "compiled": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "severity": {
                                        "type": "string"
                                    },
                                    "action": {
                                        "type": "string",
                                        "enum": [
                                            "violation",
                                            "suppress",
                                            "warn"
                                        ]
                                    }
                                }
                            },
                            "sample_size": {
                                "type": "integer"
                            },
                            "matched_count": {
                                "type": "integer"
                            },
                            "matched_by_action": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "integer"
                                }
                            },
                            "matches": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "severity": {
                                            "type": "string"
                                        },
                                        "action": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        },
                                        "record_summary": {
                                            "type": "object",
                                            "additionalProperties": true
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                },
                "required": [
                    "message"
                ]
            }
        }
    }
}