{
 "openapi": "3.0.3",
 "info": {
  "title": "Dream Command Center API",
  "version": "1.0.0",
  "description": "The health of your Salesforce orgs as data: the Org Health Index and grade, issues, reviews, monitoring, compliance evidence and activity, plus actions for your own tools. Every answer is JSON with ok; errors carry error.code and error.status. Documentation: https://health.dream.cloud/docs/api/",
  "contact": {
   "name": "Dream",
   "url": "https://dream.cloud/contact.html"
  }
 },
 "servers": [
  {
   "url": "https://health.dream.cloud/v1"
  }
 ],
 "security": [
  {
   "bearerAuth": []
  }
 ],
 "tags": [
  {
   "name": "Your token"
  },
  {
   "name": "Orgs"
  },
  {
   "name": "Org Health"
  },
  {
   "name": "Deploy gate"
  },
  {
   "name": "Reviews"
  },
  {
   "name": "Checks of a review"
  },
  {
   "name": "Review documents"
  },
  {
   "name": "Issues"
  },
  {
   "name": "Monitoring"
  },
  {
   "name": "Security Health Check"
  },
  {
   "name": "Deploy windows"
  },
  {
   "name": "Compliance"
  },
  {
   "name": "Evidence exports"
  },
  {
   "name": "Verify an export"
  },
  {
   "name": "Access reviews"
  },
  {
   "name": "Savings and capacity"
  },
  {
   "name": "Improvement plan"
  },
  {
   "name": "Accepted exceptions"
  },
  {
   "name": "Activity"
  },
  {
   "name": "Webhooks"
  },
  {
   "name": "Webhook deliveries"
  },
  {
   "name": "MCP server"
  }
 ],
 "paths": {
  "/me": {
   "get": {
    "operationId": "getMe",
    "summary": "The calling token: its scopes, orgs, expiry and your plan's limits",
    "tags": [
     "Your token"
    ],
    "description": "The calling token: its scopes, orgs, expiry and your plan's limits. Any valid token.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "account": {
             "type": "object",
             "properties": {
              "name": {
               "type": "string"
              },
              "plan": {
               "type": "string"
              }
             }
            },
            "limits": {
             "type": "object",
             "properties": {
              "per_day": {
               "type": "integer"
              },
              "per_minute": {
               "type": "integer"
              },
              "reviews_per_org_per_day": {
               "type": "integer"
              },
              "tokens": {
               "type": "integer"
              },
              "webhooks": {
               "type": "integer"
              }
             }
            },
            "token": {
             "type": "object",
             "properties": {
              "created_at": {
               "type": "string"
              },
              "expires_at": {
               "type": "string"
              },
              "last4": {
               "type": "string"
              },
              "name": {
               "type": "string"
              },
              "orgs": {
               "type": "string"
              },
              "prefix": {
               "type": "string"
              },
              "scopes": {
               "type": "array",
               "items": {
                "type": "string"
               }
              },
              "status": {
               "type": "string"
              }
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/orgs": {
   "get": {
    "operationId": "listOrgs",
    "summary": "Connected orgs with their connection, monitoring and latest review; with id, one org and its planning answers",
    "tags": [
     "Orgs"
    ],
    "description": "Connected orgs with their connection, monitoring and latest review; with id, one org and its planning answers. Scope: `orgs:read`.",
    "parameters": [
     {
      "name": "id",
      "in": "query",
      "required": false,
      "description": "One org",
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "connection": {
              "type": "string"
             },
             "id": {
              "type": "integer"
             },
             "last_review": {
              "type": "object",
              "properties": {
               "finished_at": {
                "type": "string"
               },
               "grade": {
                "type": "string"
               },
               "id": {
                "type": "integer"
               },
               "index": {
                "type": "number"
               },
               "run_id": {
                "type": "string"
               }
              }
             },
             "monitoring": {
              "type": "boolean"
             },
             "name": {
              "type": "string"
             },
             "open_alerts": {
              "type": "integer"
             },
             "type": {
              "type": "string"
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "updatePlanning",
    "summary": "Update an org's five planning answers",
    "tags": [
     "Orgs"
    ],
    "description": "Send a JSON body with `action` and its fields.\n\n- `planning`: Update an org's five planning answers (scope `orgs:write`); needs `org`",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "action"
        ],
        "properties": {
         "action": {
          "type": "string",
          "enum": [
           "planning"
          ],
          "description": "What to do"
         },
         "org": {
          "type": "integer",
          "description": "Org id"
         },
         "renewal_month": {
          "type": "integer",
          "description": "Month (1 to 12) the Salesforce contract renews"
         },
         "retention_notes": {
          "type": "string",
          "description": "Data you must keep, and for how long"
         },
         "release_cadence": {
          "type": "string",
          "enum": [
           "weekly",
           "fortnightly",
           "monthly",
           "quarterly",
           "as_needed"
          ],
          "description": "How often you release"
         },
         "known_exceptions": {
          "type": "string",
          "description": "What is intentional and should stay"
         },
         "priority": {
          "type": "string",
          "enum": [
           "balanced",
           "security",
           "cost",
           "cleanup",
           "compliance"
          ],
          "description": "What matters most"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "additionalProperties": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "409": {
      "description": "Error: conflict",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/health": {
   "get": {
    "operationId": "getHealth",
    "summary": "Latest Org Health Index, grade and areas, the trend, what the quick fixes and your decisions would reach, and the saved plan",
    "tags": [
     "Org Health"
    ],
    "description": "Latest Org Health Index, grade and areas, the trend, what the quick fixes and your decisions would reach, and the saved plan. Scope: `health:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "areas": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "area": {
                "type": "string"
               },
               "checks": {
                "type": "integer"
               },
               "score": {
                "type": "number"
               }
              }
             }
            },
            "grade": {
             "type": "string"
            },
            "healthy_at": {
             "type": "integer"
            },
            "index": {
             "type": "number"
            },
            "org": {
             "type": "object",
             "properties": {
              "id": {
               "type": "integer"
              },
              "name": {
               "type": "string"
              }
             }
            },
            "plan": {
             "type": "object",
             "properties": {
              "items": {
               "type": "integer"
              },
              "gain": {
               "type": "number"
              },
              "to": {
               "type": "number"
              },
              "findings": {
               "type": "array",
               "items": {
                "type": "integer"
               }
              }
             },
             "nullable": true
            },
            "plan_saved_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            },
            "plan_saved_by": {
             "type": "string",
             "nullable": true
            },
            "previous": {
             "type": "object",
             "properties": {
              "review": {
               "type": "integer"
              },
              "run_id": {
               "type": "string"
              },
              "index": {
               "type": "number"
              },
              "grade": {
               "type": "string"
              },
              "projected": {
               "type": "object",
               "nullable": true,
               "properties": {
                "base": {
                 "type": "number"
                },
                "quick": {
                 "type": "object",
                 "nullable": true,
                 "properties": {
                  "n": {
                   "type": "integer"
                  },
                  "gain": {
                   "type": "number"
                  },
                  "to": {
                   "type": "number"
                  }
                 }
                },
                "decision": {
                 "type": "object",
                 "nullable": true,
                 "properties": {
                  "n": {
                   "type": "integer"
                  },
                  "gain": {
                   "type": "number"
                  },
                  "to": {
                   "type": "number"
                  }
                 }
                },
                "project": {
                 "type": "object",
                 "nullable": true,
                 "properties": {
                  "n": {
                   "type": "integer"
                  },
                  "gain": {
                   "type": "number"
                  },
                  "to": {
                   "type": "number"
                  }
                 }
                },
                "renewal": {
                 "type": "object",
                 "nullable": true,
                 "properties": {
                  "n": {
                   "type": "integer"
                  },
                  "gain": {
                   "type": "number"
                  },
                  "to": {
                   "type": "number"
                  }
                 }
                }
               }
              },
              "plan": {
               "type": "object",
               "nullable": true,
               "properties": {
                "items": {
                 "type": "integer"
                },
                "gain": {
                 "type": "number"
                },
                "to": {
                 "type": "number"
                },
                "findings": {
                 "type": "array",
                 "items": {
                  "type": "integer"
                 }
                }
               }
              }
             },
             "nullable": true
            },
            "projection": {
             "type": "object",
             "properties": {
              "base": {
               "type": "number"
              },
              "decision": {
               "type": "object",
               "properties": {
                "gain": {
                 "type": "number"
                },
                "n": {
                 "type": "integer"
                },
                "to": {
                 "type": "number"
                }
               }
              },
              "project": {
               "type": "object",
               "properties": {
                "gain": {
                 "type": "number"
                },
                "n": {
                 "type": "integer"
                },
                "to": {
                 "type": "number"
                }
               }
              },
              "quick": {
               "type": "object",
               "properties": {
                "gain": {
                 "type": "number"
                },
                "n": {
                 "type": "integer"
                },
                "to": {
                 "type": "number"
                }
               }
              },
              "renewal": {
               "type": "object",
               "properties": {
                "gain": {
                 "type": "number"
                },
                "n": {
                 "type": "integer"
                },
                "to": {
                 "type": "number"
                }
               }
              }
             }
            },
            "review": {
             "type": "object",
             "properties": {
              "finished_at": {
               "type": "string"
              },
              "id": {
               "type": "integer"
              },
              "run_id": {
               "type": "string"
              }
             }
            },
            "trend": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "at": {
                "type": "string"
               },
               "grade": {
                "type": "string"
               },
               "index": {
                "type": "number"
               },
               "review": {
                "type": "integer"
               },
               "run_id": {
                "type": "string"
               }
              }
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/gate": {
   "get": {
    "operationId": "checkGate",
    "summary": "Pass or fail against your thresholds, with the reasons: for deploy pipelines",
    "tags": [
     "Deploy gate"
    ],
    "description": "Pass or fail against your thresholds, with the reasons: for deploy pipelines. Scope: `health:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     },
     {
      "name": "min_grade",
      "in": "query",
      "required": false,
      "description": "Lowest acceptable grade",
      "schema": {
       "type": "string",
       "enum": [
        "A",
        "B",
        "C",
        "D",
        "F"
       ]
      },
      "example": "C"
     },
     {
      "name": "min_index",
      "in": "query",
      "required": false,
      "description": "Lowest acceptable Org Health Index (0 to 100)",
      "schema": {
       "type": "number"
      },
      "example": 70
     },
     {
      "name": "max_critical",
      "in": "query",
      "required": false,
      "description": "Most open critical issues allowed",
      "schema": {
       "type": "integer"
      },
      "example": 0
     },
     {
      "name": "max_new_critical",
      "in": "query",
      "required": false,
      "description": "Most critical issues opened by the latest review or in the last 24 hours",
      "schema": {
       "type": "integer"
      },
      "example": 0
     },
     {
      "name": "max_drop",
      "in": "query",
      "required": false,
      "description": "Largest allowed fall of the Index since the previous review",
      "schema": {
       "type": "number"
      },
      "example": 5
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "critical_open": {
             "type": "integer"
            },
            "drop": {
             "type": "number",
             "nullable": true
            },
            "grade": {
             "type": "string"
            },
            "index": {
             "type": "number"
            },
            "new_critical": {
             "type": "integer"
            },
            "org": {
             "type": "object",
             "properties": {
              "id": {
               "type": "integer"
              },
              "name": {
               "type": "string"
              }
             }
            },
            "pass": {
             "type": "boolean"
            },
            "previous_index": {
             "type": "number",
             "nullable": true
            },
            "reasons": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "review": {
             "type": "object",
             "properties": {
              "finished_at": {
               "type": "string"
              },
              "id": {
               "type": "integer"
              },
              "run_id": {
               "type": "string"
              }
             }
            },
            "rules": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "actual": {
                "type": "string"
               },
               "pass": {
                "type": "boolean"
               },
               "required": {
                "type": "string"
               },
               "rule": {
                "type": "string"
               }
              }
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/reviews": {
   "get": {
    "operationId": "listReviews",
    "summary": "Reviews, newest first; with id, one review with its area scores and links",
    "tags": [
     "Reviews"
    ],
    "description": "Reviews, newest first; with id, one review with its area scores and links. Scope: `reviews:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": false,
      "description": "Only this org (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "description": "One review",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "next_cursor from the previous page",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Items per page, 1 to 200 (default 50)",
      "schema": {
       "type": "integer"
      },
      "example": 50
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "finished_at": {
              "type": "string"
             },
             "grade": {
              "type": "string"
             },
             "id": {
              "type": "integer"
             },
             "index": {
              "type": "number"
             },
             "org": {
              "type": "integer"
             },
             "run_id": {
              "type": "string"
             },
             "started_at": {
              "type": "string"
             },
             "status": {
              "type": "string"
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          },
          "next_cursor": {
           "type": "string",
           "nullable": true,
           "description": "Pass as cursor for the next page; null on the last page"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "startReview",
    "summary": "Start an Org Health Review; it runs in the background (poll GET /v1/reviews?org=)",
    "tags": [
     "Reviews"
    ],
    "description": "Send a JSON body with `action` and its fields.\n\n- `start`: Start an Org Health Review; it runs in the background (poll GET /v1/reviews?org=) (scope `reviews:run`); needs `org`",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "action"
        ],
        "properties": {
         "action": {
          "type": "string",
          "enum": [
           "start"
          ],
          "description": "What to do"
         },
         "org": {
          "type": "integer",
          "description": "Org id"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "additionalProperties": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "409": {
      "description": "Error: conflict",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/checks": {
   "get": {
    "operationId": "listChecks",
    "summary": "The checks of a review with value, status, score, weight and how it gets fixed",
    "tags": [
     "Checks of a review"
    ],
    "description": "The checks of a review with value, status, score, weight and how it gets fixed. Scope: `reviews:read`.",
    "parameters": [
     {
      "name": "review",
      "in": "query",
      "required": true,
      "description": "Review id",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "description": "Only this status",
      "schema": {
       "type": "string",
       "enum": [
        "ok",
        "warn",
        "critical",
        "na",
        "info",
        "error"
       ]
      }
     },
     {
      "name": "include_items",
      "in": "query",
      "required": false,
      "description": "Add the affected items (needs issues:items)",
      "schema": {
       "type": "boolean"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "checks": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "area": {
                "type": "string"
               },
               "fixability": {
                "type": "string"
               },
               "key": {
                "type": "string"
               },
               "label": {
                "type": "string"
               },
               "score": {
                "type": "number",
                "nullable": true
               },
               "status": {
                "type": "string"
               },
               "unit": {
                "type": "string"
               },
               "value": {
                "type": "number",
                "nullable": true
               },
               "value_text": {
                "type": "string"
               },
               "weight": {
                "type": "number",
                "nullable": true
               }
              }
             }
            },
            "review": {
             "type": "object",
             "properties": {
              "id": {
               "type": "integer"
              },
              "org": {
               "type": "integer"
              },
              "run_id": {
               "type": "string"
              }
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/documents": {
   "get": {
    "operationId": "getReviewDocument",
    "summary": "A finished review's Executive Brief or Full Review: as text in the answer (the Full Review includes its commentary), or as a PDF download link that works for 15 minutes",
    "tags": [
     "Review documents"
    ],
    "description": "A finished review's Executive Brief or Full Review: as text in the answer (the Full Review includes its commentary), or as a PDF download link that works for 15 minutes. Scope: `reviews:read`.",
    "parameters": [
     {
      "name": "review",
      "in": "query",
      "required": true,
      "description": "Review id (from GET /v1/reviews)",
      "schema": {
       "type": "integer"
      },
      "example": 165
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "description": "Which document (default brief)",
      "schema": {
       "type": "string",
       "enum": [
        "brief",
        "full"
       ]
      }
     },
     {
      "name": "format",
      "in": "query",
      "required": false,
      "description": "text (default) or pdf",
      "schema": {
       "type": "string",
       "enum": [
        "text",
        "pdf"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object"
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/issues": {
   "get": {
    "operationId": "listIssues",
    "summary": "Findings (FND-) and alerts (ALR-); with id, one issue with its history, exceptions and how to fix it",
    "tags": [
     "Issues"
    ],
    "description": "Findings (FND-) and alerts (ALR-); with id, one issue with its history, exceptions and how to fix it. Scope: `issues:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": false,
      "description": "Only this org (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "description": "One issue, for example FND-41",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "description": "open (default: open, acknowledged, snoozed), acknowledged, snoozed, dismissed, resolved or all",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "severity",
      "in": "query",
      "required": false,
      "description": "warn or critical",
      "schema": {
       "type": "string",
       "enum": [
        "warn",
        "critical"
       ]
      }
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "description": "finding or alert",
      "schema": {
       "type": "string",
       "enum": [
        "finding",
        "alert"
       ]
      }
     },
     {
      "name": "updated_since",
      "in": "query",
      "required": false,
      "description": "Only issues changed at or after this ISO time",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "include_items",
      "in": "query",
      "required": false,
      "description": "Add the affected items (needs issues:items)",
      "schema": {
       "type": "boolean"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "next_cursor from the previous page",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Items per page, 1 to 200 (default 50)",
      "schema": {
       "type": "integer"
      },
      "example": 50
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "area": {
              "type": "string"
             },
             "check": {
              "type": "string"
             },
             "due_at": {
              "type": "string"
             },
             "id": {
              "type": "string"
             },
             "items_count": {
              "type": "integer"
             },
             "kind": {
              "type": "string"
             },
             "last_seen_at": {
              "type": "string"
             },
             "occurrences": {
              "type": "integer"
             },
             "opened_at": {
              "type": "string"
             },
             "org": {
              "type": "integer"
             },
             "owner": {
              "type": "string",
              "nullable": true
             },
             "regressed": {
              "type": "boolean"
             },
             "resolved_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "resolved_by": {
              "type": "string",
              "nullable": true
             },
             "severity": {
              "type": "string"
             },
             "snooze_until": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "status": {
              "type": "string"
             },
             "ticket": {
              "type": "object",
              "properties": {
               "ref": {
                "type": "string"
               },
               "url": {
                "type": "string"
               }
              },
              "nullable": true
             },
             "title": {
              "type": "string"
             },
             "updated_at": {
              "type": "string"
             },
             "value_text": {
              "type": "string"
             },
             "verify_state": {
              "type": "string",
              "enum": [
               "pending",
               "confirmed",
               "failed"
              ],
              "nullable": true
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          },
          "next_cursor": {
           "type": "string",
           "nullable": true,
           "description": "Pass as cursor for the next page; null on the last page"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "postIssues",
    "summary": "Issues: actions",
    "tags": [
     "Issues"
    ],
    "description": "Send a JSON body with `action` and its fields.\n\n- `acknowledge`: Acknowledge an issue, optionally naming the owner (scope `issues:write`); needs `id`\n- `assign`: Change the owner (scope `issues:write`); needs `id`, `owner`\n- `snooze`: Snooze until a date (scope `issues:write`); needs `id`, `until`\n- `dismiss`: Dismiss with a reason (scope `issues:write`); needs `id`, `reason`, `note`\n- `resolve`: Report it fixed; the next check or review confirms the fix, or reopens the issue (scope `issues:write`); needs `id`\n- `reopen`: Reopen (scope `issues:write`); needs `id`\n- `comment`: Add a note to the history (scope `issues:write`); needs `id`, `note`\n- `link`: Link a ticket of your own system (Jira, ServiceNow, Azure DevOps, ...) (scope `issues:write`); needs `id`, `ticket_ref`\n- `help`: Ask for help on it (scope `issues:write`); needs `id`\n- `recheck`: Re-run the monitor behind an alert now (scope `issues:write`); needs `id`\n- `exception`: Accept an exception for one affected item, with a reason and a review date (scope `issues:write`); needs `id`, `item`, `reason`",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "action"
        ],
        "properties": {
         "action": {
          "type": "string",
          "enum": [
           "acknowledge",
           "assign",
           "snooze",
           "dismiss",
           "resolve",
           "reopen",
           "comment",
           "link",
           "help",
           "recheck",
           "exception"
          ],
          "description": "What to do"
         },
         "id": {
          "type": "string",
          "description": "Issue id, e.g. FND-41"
         },
         "owner": {
          "type": "string",
          "description": "Email of a user of your account"
         },
         "until": {
          "type": "string",
          "description": "YYYY-MM-DD"
         },
         "reason": {
          "type": "string",
          "enum": [
           "accepted_risk",
           "false_positive",
           "not_applicable"
          ],
          "description": "Why"
         },
         "note": {
          "type": "string",
          "description": "Details"
         },
         "ticket_ref": {
          "type": "string",
          "description": "Ticket key, e.g. OPS-7"
         },
         "ticket_url": {
          "type": "string",
          "description": "https link to the ticket"
         },
         "item": {
          "type": "string",
          "description": "The item's key (from include_items)"
         },
         "review_months": {
          "type": "integer",
          "description": "3, 6, 12 (default) or 24"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "additionalProperties": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "409": {
      "description": "Error: conflict",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/monitors": {
   "get": {
    "operationId": "listMonitors",
    "summary": "The org's monitors with their latest result",
    "tags": [
     "Monitoring"
    ],
    "description": "The org's monitors with their latest result. Scope: `monitoring:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "category": {
              "type": "string"
             },
             "checked_at": {
              "type": "string"
             },
             "critical": {
              "type": "number"
             },
             "enabled": {
              "type": "boolean"
             },
             "interval": {
              "type": "string"
             },
             "issue": {
              "type": "string",
              "nullable": true
             },
             "key": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "status": {
              "type": "string"
             },
             "value": {
              "type": "number"
             },
             "value_text": {
              "type": "string"
             },
             "warn": {
              "type": "number"
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "recheckMonitor",
    "summary": "Re-run one monitor now",
    "tags": [
     "Monitoring"
    ],
    "description": "Send a JSON body with `action` and its fields.\n\n- `recheck`: Re-run one monitor now (scope `monitoring:write`); needs `org`, `key`",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "action"
        ],
        "properties": {
         "action": {
          "type": "string",
          "enum": [
           "recheck"
          ],
          "description": "What to do"
         },
         "org": {
          "type": "integer",
          "description": "Org id"
         },
         "key": {
          "type": "string",
          "description": "Monitor key"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "additionalProperties": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "409": {
      "description": "Error: conflict",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/healthcheck": {
   "get": {
    "operationId": "getHealthCheck",
    "summary": "Salesforce Security Health Check score history and the settings at risk",
    "tags": [
     "Security Health Check"
    ],
    "description": "Salesforce Security Health Check score history and the settings at risk. Scope: `monitoring:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "history": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "checked_at": {
                "type": "string"
               },
               "score": {
                "type": "integer"
               }
              }
             }
            },
            "latest": {
             "type": "object",
             "properties": {
              "checked_at": {
               "type": "string"
              },
              "grade": {
               "type": "string"
              },
              "high_risk": {
               "type": "integer"
              },
              "low_risk": {
               "type": "integer"
              },
              "medium_risk": {
               "type": "integer"
              },
              "meets_standard": {
               "type": "integer"
              },
              "score": {
               "type": "integer"
              },
              "total": {
               "type": "integer"
              }
             }
            },
            "settings": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "group": {
                "type": "string"
               },
               "org_value": {
                "type": "string"
               },
               "risk": {
                "type": "string"
               },
               "setting": {
                "type": "string"
               },
               "standard_value": {
                "type": "string"
               }
              }
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/windows": {
   "get": {
    "operationId": "listWindows",
    "summary": "Deploy windows of an org",
    "tags": [
     "Deploy windows"
    ],
    "description": "Deploy windows of an org. Scope: `monitoring:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "postWindows",
    "summary": "Deploy windows: actions",
    "tags": [
     "Deploy windows"
    ],
    "description": "Send a JSON body with `action` and its fields.\n\n- `open`: Open a deploy window: configuration changes during it are expected, not alerts (scope `monitoring:write`); needs `org`\n- `close`: Close it: the monitors re-check and a summary of the changes is sent to your webhooks (scope `monitoring:write`); needs `org`",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "action"
        ],
        "properties": {
         "action": {
          "type": "string",
          "enum": [
           "open",
           "close"
          ],
          "description": "What to do"
         },
         "org": {
          "type": "integer",
          "description": "Org id"
         },
         "minutes": {
          "type": "integer",
          "description": "Length, 5 to 480 (default 60)"
         },
         "reference": {
          "type": "string",
          "description": "Your deploy or release reference"
         },
         "window": {
          "type": "integer",
          "description": "Window id (default: the open one)"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "additionalProperties": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "409": {
      "description": "Error: conflict",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/compliance": {
   "get": {
    "operationId": "getCompliance",
    "summary": "Control status and evidence for SOC 2, HIPAA, ISO 27001, Ontario PHIPA, PIPEDA, GDPR, UK GDPR or Quebec Law 25",
    "tags": [
     "Compliance"
    ],
    "description": "Control status and evidence for SOC 2, HIPAA, ISO 27001, Ontario PHIPA, PIPEDA, GDPR, UK GDPR or Quebec Law 25. Scope: `compliance:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     },
     {
      "name": "framework",
      "in": "query",
      "required": false,
      "description": "Framework (default: the first that fits the org, from its own answers or your organization's)",
      "schema": {
       "type": "string",
       "enum": [
        "soc2",
        "hipaa",
        "iso27001",
        "phipa",
        "pipeda",
        "gdpr",
        "ukgdpr",
        "law25"
       ]
      },
      "example": "soc2"
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "controls": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "control": {
                "type": "string"
               },
               "evidence": {
                "type": "array",
                "items": {
                 "type": "object",
                 "properties": {
                  "check": {
                   "type": "string"
                  },
                  "issue": {
                   "type": "string"
                  },
                  "status": {
                   "type": "string"
                  },
                  "title": {
                   "type": "string"
                  },
                  "value_text": {
                   "type": "string"
                  }
                 }
                }
               },
               "name": {
                "type": "string"
               },
               "status": {
                "type": "string"
               }
              }
             }
            },
            "counts": {
             "type": "object",
             "properties": {
              "attention": {
               "type": "integer"
              },
              "not_checked": {
               "type": "integer"
              },
              "ok": {
               "type": "integer"
              }
             }
            },
            "framework": {
             "type": "string"
            },
            "generated_at": {
             "type": "string"
            },
            "note": {
             "type": "string"
            },
            "org": {
             "type": "object",
             "properties": {
              "id": {
               "type": "integer"
              },
              "name": {
               "type": "string"
              }
             }
            },
            "review": {
             "type": "object",
             "properties": {
              "id": {
               "type": "integer"
              },
              "run_id": {
               "type": "string"
              },
              "started_at": {
               "type": "string"
              }
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/evidence": {
   "get": {
    "operationId": "exportEvidence",
    "summary": "A signed-off evidence export with its SHA-256, which anyone holding it can verify",
    "tags": [
     "Evidence exports"
    ],
    "description": "A signed-off evidence export with its SHA-256, which anyone holding it can verify. Scope: `compliance:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     },
     {
      "name": "framework",
      "in": "query",
      "required": false,
      "description": "Framework (default: the first that fits the org, from its own answers or your organization's)",
      "schema": {
       "type": "string",
       "enum": [
        "soc2",
        "hipaa",
        "iso27001",
        "phipa",
        "pipeda",
        "gdpr",
        "ukgdpr",
        "law25"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "algorithm": {
             "type": "string"
            },
            "export": {
             "type": "object",
             "properties": {
              "controls": {
               "type": "array",
               "items": {
                "type": "object",
                "properties": {
                 "control": {
                  "type": "string"
                 },
                 "evidence": {
                  "type": "array",
                  "items": {
                   "type": "object",
                   "properties": {
                    "check": {
                     "type": "string"
                    },
                    "issue": {
                     "type": "string"
                    },
                    "status": {
                     "type": "string"
                    },
                    "title": {
                     "type": "string"
                    },
                    "value_text": {
                     "type": "string"
                    }
                   }
                  }
                 },
                 "name": {
                  "type": "string"
                 },
                 "status": {
                  "type": "string"
                 }
                }
               }
              },
              "counts": {
               "type": "object",
               "properties": {
                "attention": {
                 "type": "integer"
                },
                "not_checked": {
                 "type": "integer"
                },
                "ok": {
                 "type": "integer"
                }
               }
              },
              "framework": {
               "type": "string"
              },
              "generated_at": {
               "type": "string"
              },
              "note": {
               "type": "string"
              },
              "org": {
               "type": "object",
               "properties": {
                "id": {
                 "type": "integer"
                },
                "name": {
                 "type": "string"
                }
               }
              },
              "review": {
               "type": "object",
               "properties": {
                "id": {
                 "type": "integer"
                },
                "run_id": {
                 "type": "string"
                },
                "started_at": {
                 "type": "string"
                }
               }
              }
             }
            },
            "export_json": {
             "type": "string"
            },
            "sha256": {
             "type": "string"
            },
            "verify_url": {
             "type": "string"
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/verify": {
   "get": {
    "operationId": "verifyExport",
    "summary": "Check that an evidence export came from the Command Center (no token needed)",
    "tags": [
     "Verify an export"
    ],
    "description": "Check that an evidence export came from the Command Center (no token needed). No token needed.",
    "parameters": [
     {
      "name": "hash",
      "in": "query",
      "required": true,
      "description": "SHA-256 of the export",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "account": {
             "type": "string"
            },
            "framework": {
             "type": "string"
            },
            "issued_at": {
             "type": "string"
            },
            "issued_by": {
             "type": "string"
            },
            "org": {
             "type": "string"
            },
            "valid": {
             "type": "boolean"
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    },
    "security": []
   }
  },
  "/access_reviews": {
   "get": {
    "operationId": "listAccessReviews",
    "summary": "Access reviews of admin-level access, their decisions and sign-off",
    "tags": [
     "Access reviews"
    ],
    "description": "Access reviews of admin-level access, their decisions and sign-off. Scope: `compliance:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "created_at": {
              "type": "string"
             },
             "decisions": {
              "type": "object",
              "properties": {
               "keep": {
                "type": "integer"
               },
               "pending": {
                "type": "integer"
               },
               "remove": {
                "type": "integer"
               }
              }
             },
             "due_at": {
              "type": "string"
             },
             "id": {
              "type": "integer"
             },
             "items": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "signed_off_at": {
              "type": "string"
             },
             "signed_off_by": {
              "type": "string"
             },
             "status": {
              "type": "string"
             },
             "verified_at": {
              "type": "string"
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/savings": {
   "get": {
    "operationId": "getSavings",
    "summary": "Licenses you could reclaim and when storage fills up",
    "tags": [
     "Savings and capacity"
    ],
    "description": "Licenses you could reclaim and when storage fills up. Scope: `health:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "properties": {
            "licenses": {
             "type": "object",
             "properties": {
              "annual_usd": {
               "type": "integer"
              },
              "dormant_users": {
               "type": "integer"
              },
              "note": {
               "type": "string"
              },
              "price_per_user_month": {
               "type": "number"
              },
              "price_source": {
               "type": "string"
              },
              "unassigned_paid": {
               "type": "integer"
              }
             }
            },
            "review": {
             "type": "object",
             "properties": {
              "id": {
               "type": "integer"
              },
              "run_id": {
               "type": "string"
              }
             }
            },
            "storage": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "basis": {
                "type": "string"
               },
               "change_per_month": {
                "type": "string",
                "nullable": true
               },
               "days_to_100": {
                "type": "string",
                "nullable": true
               },
               "days_to_90": {
                "type": "string",
                "nullable": true
               },
               "forecast": {
                "type": "boolean"
               },
               "key": {
                "type": "string"
               },
               "points": {
                "type": "integer"
               },
               "used_pct": {
                "type": "number"
               }
              }
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/plan": {
   "get": {
    "operationId": "getPlan",
    "summary": "The saved improvement plan: each item, its issue and status, projected against achieved",
    "tags": [
     "Improvement plan"
    ],
    "description": "The saved improvement plan: each item, its issue and status, projected against achieved. Scope: `health:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": true,
      "description": "Org id (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "string",
           "nullable": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/exceptions": {
   "get": {
    "operationId": "listExceptions",
    "summary": "Accepted exceptions with their owner, reason and review date",
    "tags": [
     "Accepted exceptions"
    ],
    "description": "Accepted exceptions with their owner, reason and review date. Scope: `issues:read`.",
    "parameters": [
     {
      "name": "org",
      "in": "query",
      "required": false,
      "description": "Only this org (from GET /v1/orgs)",
      "schema": {
       "type": "integer"
      },
      "example": 12
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "at": {
              "type": "string"
             },
             "by": {
              "type": "string"
             },
             "check": {
              "type": "string"
             },
             "id": {
              "type": "integer"
             },
             "item": {
              "type": "string"
             },
             "org": {
              "type": "integer"
             },
             "owner": {
              "type": "string"
             },
             "reason": {
              "type": "string"
             },
             "review_by": {
              "type": "string"
             },
             "status": {
              "type": "string"
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/activity": {
   "get": {
    "operationId": "listActivity",
    "summary": "Who did what, newest first",
    "tags": [
     "Activity"
    ],
    "description": "Who did what, newest first. Scope: `activity:read`.",
    "parameters": [
     {
      "name": "since",
      "in": "query",
      "required": false,
      "description": "Only entries at or after this ISO time",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "next_cursor from the previous page",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Items per page, 1 to 200 (default 50)",
      "schema": {
       "type": "integer"
      },
      "example": 50
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "action": {
              "type": "string"
             },
             "actor": {
              "type": "string"
             },
             "at": {
              "type": "string"
             },
             "detail": {
              "type": "string"
             },
             "id": {
              "type": "integer"
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          },
          "next_cursor": {
           "type": "string",
           "nullable": true,
           "description": "Pass as cursor for the next page; null on the last page"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/webhooks": {
   "get": {
    "operationId": "listWebhooks",
    "summary": "Your webhook endpoints",
    "tags": [
     "Webhooks"
    ],
    "description": "Your webhook endpoints. Scope: `webhooks:manage`.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   },
   "post": {
    "operationId": "postWebhooks",
    "summary": "Webhooks: actions",
    "tags": [
     "Webhooks"
    ],
    "description": "Send a JSON body with `action` and its fields.\n\n- `create`: Add an endpoint; the signing secret is returned once (scope `webhooks:manage`); needs `url`\n- `delete`: Remove an endpoint (scope `webhooks:manage`); needs `endpoint`\n- `rotate`: New signing secret (returned once) (scope `webhooks:manage`); needs `endpoint`\n- `test`: Send a webhook.test event (scope `webhooks:manage`); needs `endpoint`\n- `redeliver`: Send one delivery again (scope `webhooks:manage`); needs `delivery`\n- `enable`: Turn an endpoint on or off (scope `webhooks:manage`); needs `endpoint`, `enabled`",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "action"
        ],
        "properties": {
         "action": {
          "type": "string",
          "enum": [
           "create",
           "delete",
           "rotate",
           "test",
           "redeliver",
           "enable"
          ],
          "description": "What to do"
         },
         "url": {
          "type": "string",
          "description": "https URL"
         },
         "events": {
          "type": "string",
          "description": "Comma-separated events, or all"
         },
         "description": {
          "type": "string",
          "description": "What it is for"
         },
         "endpoint": {
          "type": "integer",
          "description": "Endpoint id"
         },
         "delivery": {
          "type": "integer",
          "description": "Delivery id"
         },
         "enabled": {
          "type": "boolean",
          "description": "true or false"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "additionalProperties": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "409": {
      "description": "Error: conflict",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/deliveries": {
   "get": {
    "operationId": "listDeliveries",
    "summary": "Deliveries, newest first, with status and attempts",
    "tags": [
     "Webhook deliveries"
    ],
    "description": "Deliveries, newest first, with status and attempts. Scope: `webhooks:manage`.",
    "parameters": [
     {
      "name": "endpoint",
      "in": "query",
      "required": false,
      "description": "Only this endpoint",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "status",
      "in": "query",
      "required": false,
      "description": "pending, retrying, delivered or failed",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "description": "next_cursor from the previous page",
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "description": "Items per page, 1 to 200 (default 50)",
      "schema": {
       "type": "integer"
      },
      "example": 50
     }
    ],
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "attempts": {
              "type": "integer"
             },
             "created_at": {
              "type": "string"
             },
             "delivered_at": {
              "type": "string",
              "nullable": true
             },
             "endpoint": {
              "type": "integer"
             },
             "event": {
              "type": "string"
             },
             "event_id": {
              "type": "string"
             },
             "id": {
              "type": "integer"
             },
             "last_error": {
              "type": "string",
              "nullable": true
             },
             "last_status": {
              "type": "integer",
              "nullable": true
             },
             "next_at": {
              "type": "string"
             },
             "status": {
              "type": "string"
             }
            }
           }
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          },
          "next_cursor": {
           "type": "string",
           "nullable": true,
           "description": "Pass as cursor for the next page; null on the last page"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  },
  "/mcp": {
   "post": {
    "operationId": "mcp",
    "summary": "Model Context Protocol (JSON-RPC over HTTP) for AI assistants; tools follow your token's scopes",
    "tags": [
     "MCP server"
    ],
    "description": "Model Context Protocol over HTTP (JSON-RPC 2.0): initialize, ping, tools/list and tools/call. See the MCP section of the docs.",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "jsonrpc": {
          "type": "string",
          "example": "2.0"
         },
         "id": {
          "type": "integer",
          "example": 1
         },
         "method": {
          "type": "string",
          "example": "tools/list"
         },
         "params": {
          "type": "object"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Success (ok is true)",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "required": [
          "ok",
          "request_id"
         ],
         "properties": {
          "ok": {
           "type": "boolean",
           "description": "true on success; false with an error"
          },
          "data": {
           "type": "object",
           "additionalProperties": true
          },
          "request_id": {
           "type": "string",
           "example": "req_4f2a9c0e1b7d3a5c6e8f"
          },
          "error": {
           "$ref": "#/components/schemas/Error"
          }
         }
        }
       }
      }
     },
     "401": {
      "description": "Error: unauthorized",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "403": {
      "description": "Error: plan_required, ip_not_allowed, insufficient_scope",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "404": {
      "description": "Error: not_found",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "409": {
      "description": "Error: conflict",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "422": {
      "description": "Error: invalid",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "429": {
      "description": "Error: limit_reached, rate_limited",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     },
     "500": {
      "description": "Error: internal",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ErrorAnswer"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "drm_...",
    "description": "An API token from Admin > API access, sent as Authorization: Bearer drm_..."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "properties": {
     "code": {
      "type": "string",
      "enum": [
       "conflict",
       "insufficient_scope",
       "internal",
       "invalid",
       "ip_not_allowed",
       "limit_reached",
       "not_found",
       "plan_required",
       "rate_limited",
       "unauthorized"
      ]
     },
     "status": {
      "type": "integer",
      "description": "The HTTP status this error stands for"
     },
     "message": {
      "type": "string"
     },
     "retry_after": {
      "type": "integer",
      "description": "rate_limited only: seconds to wait"
     }
    }
   },
   "ErrorAnswer": {
    "type": "object",
    "required": [
     "ok",
     "error",
     "request_id"
    ],
    "properties": {
     "ok": {
      "type": "boolean",
      "description": "false"
     },
     "error": {
      "$ref": "#/components/schemas/Error"
     },
     "request_id": {
      "type": "string",
      "example": "req_4f2a9c0e1b7d3a5c6e8f"
     }
    }
   },
   "Event": {
    "type": "object",
    "description": "A webhook delivery body",
    "properties": {
     "id": {
      "type": "string",
      "example": "evt_9c1e0f4b2a7d6c3e8f5a1b0d"
     },
     "type": {
      "type": "string",
      "enum": [
       "review.completed",
       "health.grade_changed",
       "health.index_dropped",
       "issue.opened",
       "issue.updated",
       "issue.resolved",
       "issue.reopened",
       "issue.overdue",
       "issue.fix_confirmed",
       "plan.item_done",
       "exception.expiring",
       "exception.expired",
       "connection.expired",
       "deploy_window.closed",
       "token.expiring",
       "token.leaked",
       "webhook.test"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time"
     },
     "api_version": {
      "type": "string",
      "example": "v1"
     },
     "account": {
      "type": "object",
      "properties": {
       "id": {
        "type": "integer"
       },
       "name": {
        "type": "string"
       }
      }
     },
     "data": {
      "type": "object",
      "description": "The object the event is about (issue, review, org, window or token)"
     }
    }
   }
  }
 },
 "x-webhooks": {
  "review.completed": {
   "post": {
    "summary": "A review finished and was scored",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "health.grade_changed": {
   "post": {
    "summary": "A review gave a different grade than the previous review",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "health.index_dropped": {
   "post": {
    "summary": "The Org Health Index fell by 5 points or more since the previous review",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "issue.opened": {
   "post": {
    "summary": "A review or a monitor opened a finding or an alert",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "issue.updated": {
   "post": {
    "summary": "Someone acknowledged, assigned, snoozed, dismissed, commented on or linked an issue",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "issue.resolved": {
   "post": {
    "summary": "An issue was resolved (by a check, a review, a person, Jira or the API)",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "issue.reopened": {
   "post": {
    "summary": "A resolved issue came back, or a fix was not confirmed by the next check",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "issue.overdue": {
   "post": {
    "summary": "An open issue passed its due date",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "issue.fix_confirmed": {
   "post": {
    "summary": "The next check or review confirmed a fix that a person or ticket reported",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "plan.item_done": {
   "post": {
    "summary": "An item of the saved improvement plan was fixed",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "exception.expiring": {
   "post": {
    "summary": "An accepted exception reaches its review date within 14 days",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "exception.expired": {
   "post": {
    "summary": "An accepted exception passed its review date and counts again",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "connection.expired": {
   "post": {
    "summary": "Salesforce refused the stored connection; the org needs to be reconnected",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "deploy_window.closed": {
   "post": {
    "summary": "A deploy window closed; the changes it covered are summarized",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "token.expiring": {
   "post": {
    "summary": "An API token expires within 14 days",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "token.leaked": {
   "post": {
    "summary": "GitHub found an API token in a public place; it was revoked at once",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  },
  "webhook.test": {
   "post": {
    "summary": "A test event sent from the API access page or the API",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Event"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Answer with any 2xx within 10 seconds"
     }
    }
   }
  }
 }
}