Can I check my server health with the API?

I want to configure my monitoring software to check and report the status of the Octopus server. Is there an API endpoint for that?

The /api/serverstatus/health endpoint will return the server health and status.

When working normally, it will return:

{
  "IsOperatingNormally": true,
  "Description": "The Octopus Server cluster is operating normally.",
  "IsEntireClusterReadOnly": false,
  "IsEntireClusterDrainingTasks": false,
  "IsCompliantWithLicense": true,
  "Links": {
    "Self": "/api/serverstatus/health",
    "Index": "/api/serverstatus"
  }
}

If maintenance mode is enabled, it will return:

{
  "IsOperatingNormally": false,
  "Description": "Maintenance Mode is enabled making the cluster read-only for most users.",
  "IsEntireClusterReadOnly": true,
  "IsEntireClusterDrainingTasks": false,
  "IsCompliantWithLicense": true,
  "Links": {
    "Self": "/api/serverstatus/health",
    "Index": "/api/serverstatus"
  }
}

The other fields will change depending on if all nodes in the cluster are draining or if the license is out of compliance.