{
 "openapi": "3.1.0",
 "info": {
  "title": "Vardion API",
  "version": "0.9.0",
  "description": "Reads what the console shows; writes through the console's own forms. Tokens are made under Settings > API."
 },
 "servers": [
  {
   "url": "/"
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "A token from Settings > API. Scopes: read, write:findings, write:assets, write:suppliers, write:risks, write:incidents, write:evidence, admin."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean"
     },
     "error": {
      "type": "string"
     }
    },
    "required": [
     "error"
    ]
   },
   "Done": {
    "type": "object",
    "properties": {
     "ok": {
      "type": "boolean",
      "const": true
     },
     "location": {
      "type": "string"
     }
    },
    "required": [
     "ok"
    ]
   }
  }
 },
 "paths": {
  "/api/v1": {
   "get": {
    "summary": "The endpoints this console serves and whether it takes writes",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/findings": {
   "get": {
    "summary": "Findings, with the findings page's filter",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "severity",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "owner",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "sla",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "host",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "port",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "check",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cve",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "age",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "surface",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/findings/{id}": {
   "get": {
    "summary": "One finding",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/assets": {
   "get": {
    "summary": "Assets",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/approvals": {
   "get": {
    "summary": "Addresses and their approval state",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/runs": {
   "get": {
    "summary": "Runs",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/score": {
   "get": {
    "summary": "The current risk score of each surface",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/openapi.json": {
   "get": {
    "summary": "This document",
    "security": [
     {
      "bearer": []
     }
    ],
    "parameters": [],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Not this account's workspace",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "Not found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/findings/accept": {
   "post": {
    "summary": "Runs the console form /finding/accept",
    "description": "Needs a token with the write:findings or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:findings"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "finding id"
         },
         "reason": {
          "type": "string",
          "description": "why the risk is accepted"
         },
         "by": {
          "type": "string",
          "description": "who accepts it"
         },
         "review_by": {
          "type": "string",
          "description": "YYYY-MM-DD"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/findings/assign": {
   "post": {
    "summary": "Runs the console form /finding/work",
    "description": "Needs a token with the write:findings or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:findings"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "finding id"
         },
         "assignee": {
          "type": "string",
          "description": "account name"
         },
         "state": {
          "type": "string",
          "description": "work state"
         },
         "note": {
          "type": "string",
          "description": "note"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/findings/comment": {
   "post": {
    "summary": "Runs the console form /finding/comment",
    "description": "Needs a token with the write:findings or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:findings"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "finding id"
         },
         "text": {
          "type": "string",
          "description": "comment"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/findings/close": {
   "post": {
    "summary": "Runs the console form /finding/false-positive",
    "description": "Needs a token with the write:findings or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:findings"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "id": {
          "type": "string",
          "description": "finding id"
         },
         "reason": {
          "type": "string",
          "description": "why it is not a real issue"
         },
         "by": {
          "type": "string",
          "description": "who decided"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/assets/owner": {
   "post": {
    "summary": "Runs the console form /assets/meta",
    "description": "Needs a token with the write:assets or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:assets"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "hosts": {
          "type": "string",
          "description": "hosts, one per line"
         },
         "owner": {
          "type": "string",
          "description": "owner"
         },
         "criticality": {
          "type": "string",
          "description": "low, medium, high or critical"
         },
         "tags": {
          "type": "string",
          "description": "tags"
         },
         "mode": {
          "type": "string",
          "description": "set or add"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/suppliers": {
   "post": {
    "summary": "Runs the console form /suppliers/watch/add",
    "description": "Needs a token with the write:suppliers or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:suppliers"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "domain": {
          "type": "string",
          "description": "the supplier's domain"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/risks": {
   "post": {
    "summary": "Runs the console form /risk/register",
    "description": "Needs a token with the write:risks or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:risks"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "description": "risk title"
         },
         "likelihood": {
          "type": "string",
          "description": "1 to 5"
         },
         "impact": {
          "type": "string",
          "description": "1 to 5"
         },
         "treatment": {
          "type": "string",
          "description": "treatment"
         },
         "owner": {
          "type": "string",
          "description": "owner"
         },
         "id": {
          "type": "string",
          "description": "existing risk id, to change it"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/incidents": {
   "post": {
    "summary": "Runs the console form /incidents/add",
    "description": "Needs a token with the write:incidents or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:incidents"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string",
          "description": "title"
         },
         "regime": {
          "type": "string",
          "description": "nis2, dora or gdpr"
         },
         "aware_at": {
          "type": "string",
          "description": "when you became aware, ISO 8601"
         },
         "findings": {
          "type": "string",
          "description": "finding ids"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/evidence": {
   "post": {
    "summary": "Runs the console form /evidence/upload",
    "description": "Needs a token with the write:evidence or admin scope, and the role the form needs. Off until the platform owner turns the write API on.",
    "security": [
     {
      "bearer": [
       "write:evidence"
      ]
     }
    ],
    "parameters": [
     {
      "name": "workspace",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "format": "binary",
          "description": "the file"
         },
         "links": {
          "type": "string",
          "description": "the controls it evidences, one per line"
         },
         "note": {
          "type": "string",
          "description": "note"
         },
         "review": {
          "type": "string",
          "description": "review date, YYYY-MM-DD"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Done",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Done"
        }
       }
      }
     },
     "400": {
      "description": "Refused by the form, with its reason",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No valid token, or the token lacks the scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The account's role is not enough",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The write API is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Body over 1 MB"
     }
    }
   }
  },
  "/api/v1/mcp": {
   "get": {
    "summary": "No event stream: answers 405",
    "security": [
     {
      "bearer": []
     }
    ],
    "responses": {
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The MCP server is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "Use POST"
     }
    }
   },
   "post": {
    "summary": "The read-only MCP server, Streamable HTTP transport",
    "description": "One JSON-RPC message of the Model Context Protocol per request, answered with JSON. Its tools read what the token reads from this API and change nothing. Off until the platform owner turns it on.",
    "security": [
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "A JSON-RPC response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "202": {
      "description": "A notification, acknowledged"
     },
     "400": {
      "description": "Not a message this server reads"
     },
     "401": {
      "description": "No valid token",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Refused: a page elsewhere, a support grant not given, or a workspace this account may not open",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "The MCP server is off",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 }
}
