{
  "openapi": "3.1.0",
  "info": {
    "title": "Suitaar API",
    "version": "1",
    "description": "Send alerts and heartbeat pings to Suitaar. **Suitaar's own API (`/api/v1`):** creating alerts (`POST /api/v1/alerts`, also with `status` `resolved`) and the webhooks of Uptime Kuma, Healthchecks.io and UptimeRobot are open to everyone. Reading, acknowledging, closing and notes, and the heartbeat ping, are available by request for now: they are behind a feature flag, so they answer 404 until it is on for your team. To get them, write to mail@suitaar.com. The Opsgenie-compatible API (`/api/og/v2`) is open to everyone. Authenticate with the key of a source: `Authorization: Bearer <source key>`. A request body wraps its object in one field (`{\"alert\": {…}}`); an answer has two levels (`{\"data\": {\"alert\": {…}}}`); an error is `{\"error\": {\"code\", \"message\"}}`. Later versions add fields next to these, never change them. An unknown field is refused (422). Every answer has `X-Request-Id`. Limits: a body of 64 KB, 600 requests a minute for each source, for both APIs together. The tag \"Opsgenie-compatible API\" describes the API for tools that speak Opsgenie, as in Opsgenie's own specification."
  },
  "servers": [
    {
      "url": "/",
      "description": "The address of your Suitaar."
    }
  ],
  "security": [
    {
      "sourceKey": []
    }
  ],
  "paths": {
    "/api/v1/alerts": {
      "post": {
        "operationId": "createAlert",
        "summary": "Make an alert, add a repeat, or resolve the open alert with the same key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRequestEnvelope"
              },
              "example": {
                "alert": {
                  "title": "Disk full on db-1",
                  "key": "disk-db-1",
                  "priority": "high",
                  "description": "/var is 95% full.",
                  "tags": [
                    "db",
                    "disk"
                  ],
                  "details": {
                    "host": "db-1"
                  },
                  "entity": "db-1",
                  "source": "prometheus"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new alert.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "A repeat (the open alert with the same key, with a higher count), or a resolve: the closed alert, or alert null when no alert with this key was open.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AlertEnvelope"
                    },
                    {
                      "$ref": "#/components/schemas/ResolvedAlertEnvelope"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "A body that is not `{\"alert\": {…}}`, an unknown field, a wrong type, no title or another priority (`invalid_request`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "Suitaar API"
        ]
      }
    },
    "/api/v1/alerts/{ref}": {
      "get": {
        "operationId": "getAlert",
        "summary": "Read an alert",
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "The alert id (a UUID), else the key of an open alert of this source.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The alert.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not found (`not_found`). Also when the flag of Suitaar's API is off for the team of the key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "Suitaar API"
        ]
      }
    },
    "/api/v1/alerts/{ref}/acknowledge": {
      "post": {
        "operationId": "acknowledgeAlert",
        "summary": "Acknowledge an alert",
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "The alert id (a UUID), else the key of an open alert of this source.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcknowledgeEnvelope"
              },
              "example": {
                "acknowledge": {
                  "note": "On it.",
                  "by": "Ada"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The acknowledged alert, also when it was acknowledged already.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The alert is closed (`conflict`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "A bad body (`invalid_request`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not found (`not_found`). Also when the flag of Suitaar's API is off for the team of the key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "Suitaar API"
        ]
      }
    },
    "/api/v1/alerts/{ref}/close": {
      "post": {
        "operationId": "closeAlert",
        "summary": "Close an alert",
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "The alert id (a UUID), else the key of an open alert of this source.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloseEnvelope"
              },
              "example": {
                "close": {
                  "note": "Fixed: old logs removed.",
                  "by": "Ada"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The closed alert, also when it was closed already.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "A bad body (`invalid_request`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not found (`not_found`). Also when the flag of Suitaar's API is off for the team of the key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "Suitaar API"
        ]
      }
    },
    "/api/v1/alerts/{ref}/notes": {
      "post": {
        "operationId": "addNote",
        "summary": "Add a note to an alert",
        "parameters": [
          {
            "name": "ref",
            "in": "path",
            "required": true,
            "description": "The alert id (a UUID), else the key of an open alert of this source.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteEnvelope"
              },
              "example": {
                "note": {
                  "text": "Disk grows 2% each hour.",
                  "by": "Bob"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The alert.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "No text, or a bad body (`invalid_request`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not found (`not_found`). Also when the flag of Suitaar's API is off for the team of the key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "Suitaar API"
        ]
      }
    },
    "/api/v1/heartbeats/{name}/ping": {
      "post": {
        "operationId": "pingHeartbeat",
        "summary": "Ping a heartbeat (no body)",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "The name of a heartbeat of this source.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The heartbeat. A ping after an expiry also closes its alert.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HeartbeatEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Not found (`not_found`). Also when the flag of Suitaar's API is off for the team of the key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "tags": [
          "Suitaar API"
        ]
      }
    },
    "/v2/alerts": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "post": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "createAlert",
        "summary": "Create Alert",
        "description": "Creates a new alert\n\n**Suitaar:** Suitaar uses message, alias, description, priority, tags, details, entity, source, note and user. It accepts responders, visibleTo and actions and ignores them: Suitaar routes alerts with its channels. As at Opsgenie, the answer has no alert id; the request status (getRequestStatus) has it.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-create-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieCreateAlertPayload"
              },
              "example": {
                "message": "Disk full on db-1",
                "alias": "disk-db-1",
                "priority": "P2",
                "description": "/var is 95% full.",
                "tags": [
                  "db"
                ],
                "details": {
                  "host": "db-1"
                },
                "entity": "db-1",
                "source": "prometheus"
              }
            }
          }
        }
      }
    },
    "/v2/alerts/{identifier}": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "get": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "getAlert",
        "summary": "Get Alert",
        "description": "Returns alert with given id, tiny id or alias\n\n**Suitaar:** Suitaar has no tiny ids: tinyId is empty, and identifierType=tiny answers 422. As at Opsgenie, an alias finds only an alert that is not closed.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alert information for given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieGetAlertResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-get-alert"
        }
      }
    },
    "/v2/alerts/{identifier}/close": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "post": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "closeAlert",
        "summary": "Close Alert",
        "description": "Closes alert with given identifier\n\n**Suitaar:** As at Opsgenie, the answer is 202 at once, also for an unknown alert; the request status shows the result.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-close-alert"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieCloseAlertPayload"
              },
              "example": {
                "user": "Ada",
                "note": "Fixed.",
                "source": "script"
              }
            }
          }
        }
      }
    },
    "/v2/alerts/{identifier}/acknowledge": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "post": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "acknowledgeAlert",
        "summary": "Acknowledge Alert",
        "description": "Acknowledges alert with given identifier\n\n**Suitaar:** As at Opsgenie, the answer is 202 at once, also for an unknown alert; the request status shows the result.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-acknowledge-alert"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieAcknowledgeAlertPayload"
              },
              "example": {
                "user": "Ada",
                "note": "On it.",
                "source": "script"
              }
            }
          }
        }
      }
    },
    "/v2/alerts/{identifier}/notes": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "post": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "addNote",
        "summary": "Add Note",
        "description": "Adds note to alert with given identifier\n\n**Suitaar:** As at Opsgenie, the answer is 202 at once; the request status shows the result. note is required (422 without it).",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-add-note-to-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieAddNoteToAlertPayload"
              },
              "example": {
                "user": "Bob",
                "note": "Disk grows 2% each hour.",
                "source": "script"
              }
            }
          }
        }
      }
    },
    "/v2/alerts/requests/{requestId}": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "get": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "getRequestStatus",
        "summary": "Get Request Status of Alert",
        "description": "Used to track the status and alert details (if any) of the request whose identifier is given\n\n**Suitaar:** The result of an earlier request of the same source.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "description": "Universally unique identifier of the questioned request",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request status information for given id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieGetRequestStatusResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-get-request-status"
        }
      }
    },
    "/v2/heartbeats/{name}/ping": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "get": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "ping",
        "summary": "Ping Heartbeat",
        "description": "Ping Heartbeat for given heartbeat name\n\n**Suitaar:** As at Opsgenie, the answer is 202 also for an unknown name. Opsgenie's specification lists GET; its documentation and Suitaar also accept POST, PUT and PATCH.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Name of the heartbeat",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/heartbeat-api#section-ping-heartbeat-request"
        }
      },
      "post": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "pingPost",
        "summary": "Ping Heartbeat (POST)",
        "description": "Ping Heartbeat for given heartbeat name\n\n**Suitaar:** As at Opsgenie, the answer is 202 also for an unknown name. Opsgenie's specification lists GET; its documentation and Suitaar also accept POST, PUT and PATCH.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Name of the heartbeat",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/heartbeat-api#section-ping-heartbeat-request"
        }
      },
      "put": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "pingPut",
        "summary": "Ping Heartbeat (PUT)",
        "description": "Ping Heartbeat for given heartbeat name\n\n**Suitaar:** As at Opsgenie, the answer is 202 also for an unknown name. Opsgenie's specification lists GET; its documentation and Suitaar also accept POST, PUT and PATCH.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Name of the heartbeat",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/heartbeat-api#section-ping-heartbeat-request"
        }
      },
      "patch": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "pingPatch",
        "summary": "Ping Heartbeat (PATCH)",
        "description": "Ping Heartbeat for given heartbeat name\n\n**Suitaar:** As at Opsgenie, the answer is 202 also for an unknown name. Opsgenie's specification lists GET; its documentation and Suitaar also accept POST, PUT and PATCH.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Name of the heartbeat",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/heartbeat-api#section-ping-heartbeat-request"
        }
      }
    },
    "/v2/alerts/{identifier}/message": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "post": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "updateAlertMessagePost",
        "summary": "Update Alert Message",
        "description": "Updates message of the alert with given identifier\n\n**Suitaar:** POST, PUT and PATCH, as at Opsgenie; Alertmanager's `update_alerts: true` sends PUT. The answer is 202 at once; the request status shows the result. message is required (422 without it), trimmed and cut to 130. A closed alert does not change. No chat message: the next message or edit shows the new title.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-add-note-to-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieUpdateAlertMessagePayload"
              },
              "example": {
                "message": "[FIRING:3] HighCPU (warning)"
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "updateAlertMessage",
        "summary": "Update Alert Message",
        "description": "Updates message of the alert with given identifier\n\n**Suitaar:** POST, PUT and PATCH, as at Opsgenie; Alertmanager's `update_alerts: true` sends PUT. The answer is 202 at once; the request status shows the result. message is required (422 without it), trimmed and cut to 130. A closed alert does not change. No chat message: the next message or edit shows the new title.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-add-note-to-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieUpdateAlertMessagePayload"
              },
              "example": {
                "message": "[FIRING:3] HighCPU (warning)"
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "updateAlertMessagePatch",
        "summary": "Update Alert Message",
        "description": "Updates message of the alert with given identifier\n\n**Suitaar:** POST, PUT and PATCH, as at Opsgenie; Alertmanager's `update_alerts: true` sends PUT. The answer is 202 at once; the request status shows the result. message is required (422 without it), trimmed and cut to 130. A closed alert does not change. No chat message: the next message or edit shows the new title.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-add-note-to-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieUpdateAlertMessagePayload"
              },
              "example": {
                "message": "[FIRING:3] HighCPU (warning)"
              }
            }
          }
        }
      }
    },
    "/v2/alerts/{identifier}/description": {
      "servers": [
        {
          "url": "/api/og",
          "description": "The path form, for tools that take a URL with a path (Alertmanager, Grafana, Zabbix)."
        },
        {
          "url": "https://ogapi.suitaar.com",
          "description": "The host form, for tools that change only the host (Opsgenie SDKs, Terraform)."
        }
      ],
      "post": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "updateAlertDescriptionPost",
        "summary": "Update Alert Description",
        "description": "Updates description of the alert with given identifier\n\n**Suitaar:** POST, PUT and PATCH, as at Opsgenie; Alertmanager's `update_alerts: true` sends PUT. The answer is 202 at once; the request status shows the result. Without description, the description is cleared. Cut to 15,000. A closed alert does not change.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-add-note-to-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieUpdateAlertDescriptionPayload"
              },
              "example": {
                "description": "Alerts Firing:\nLabels:\n - alertname = HighCPU\n - instance = db-1"
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "updateAlertDescription",
        "summary": "Update Alert Description",
        "description": "Updates description of the alert with given identifier\n\n**Suitaar:** POST, PUT and PATCH, as at Opsgenie; Alertmanager's `update_alerts: true` sends PUT. The answer is 202 at once; the request status shows the result. Without description, the description is cleared. Cut to 15,000. A closed alert does not change.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-add-note-to-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieUpdateAlertDescriptionPayload"
              },
              "example": {
                "description": "Alerts Firing:\nLabels:\n - alertname = HighCPU\n - instance = db-1"
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Opsgenie-compatible API"
        ],
        "operationId": "updateAlertDescriptionPatch",
        "summary": "Update Alert Description",
        "description": "Updates description of the alert with given identifier\n\n**Suitaar:** POST, PUT and PATCH, as at Opsgenie; Alertmanager's `update_alerts: true` sends PUT. The answer is 202 at once; the request status shows the result. Without description, the description is cleared. Cut to 15,000. A closed alert does not change.",
        "security": [
          {
            "genieKey": []
          }
        ],
        "parameters": [
          {
            "name": "identifier",
            "in": "path",
            "required": true,
            "description": "Identifier of alert which could be alert id, tiny id or alert alias",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "identifierType",
            "in": "query",
            "required": false,
            "description": "Type of the identifier that is provided as an in-line parameter. Possible values are 'id', 'alias' or 'tiny'",
            "schema": {
              "type": "string",
              "enum": [
                "id",
                "alias",
                "tiny"
              ],
              "default": "id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Returns request id for this async operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieSuccessResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "apiKey is invalid or integration is disabled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "apiKey is valid but the account cannot do this action because of subscription plan",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "apiKey is valid but the apiKey cannot do this operation because of permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Entity cannot be found for the given identifier",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Semantic errors in request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Throttling",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "default": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "Suitaar: the body is larger than 64 KB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpsgenieErrorResponse"
                }
              }
            }
          }
        },
        "externalDocs": {
          "description": "For more information",
          "url": "https://www.opsgenie.com/docs/alert-api#section-add-note-to-alert"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpsgenieUpdateAlertDescriptionPayload"
              },
              "example": {
                "description": "Alerts Firing:\nLabels:\n - alertname = HighCPU\n - instance = db-1"
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/uptimekumapet": {
      "post": {
        "operationId": "uptimeKumaWebhook",
        "tags": [
          "Suitaar API"
        ],
        "summary": "The webhook of Uptime Kuma: down makes an alert, up closes it",
        "description": "Paste this URL into Uptime Kuma with the header `Authorization: Bearer <source key>`. The default JSON body of Uptime Kuma (`{\"heartbeat\", \"monitor\", \"msg\"}`): status 0 down, 1 up; 2 and 3 change nothing. A test notification makes an info test alert. Only the fields that Suitaar uses are stored, never the raw body. The guide has the setup.",
        "parameters": [
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "description": "The priority of a new alert: critical, high, moderate (default), low, info, or P1 to P5.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The default JSON body of Uptime Kuma (`{\"heartbeat\", \"monitor\", \"msg\"}`): status 0 down, 1 up; 2 and 3 change nothing. A test notification makes an info test alert."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new alert (down).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "A repeat (down again), a resolve (the closed alert, or alert null when none is open), or a state that changes nothing (alert null).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AlertEnvelope"
                    },
                    {
                      "$ref": "#/components/schemas/ResolvedAlertEnvelope"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "A body that is not the format of Uptime Kuma (`invalid_request`), with a setup hint; or a wrong `priority`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/healthchecksio": {
      "post": {
        "operationId": "healthchecksWebhook",
        "tags": [
          "Suitaar API"
        ],
        "summary": "The webhook of Healthchecks.io: down makes an alert, up closes it",
        "description": "Paste this URL into Healthchecks.io with the header `Authorization: Bearer <source key>`. The request body `$JSON` (the check), for down and for up. `grace`, `new`, `paused` and `started` change nothing. Only the fields that Suitaar uses are stored, never the raw body. The guide has the setup.",
        "parameters": [
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "description": "The priority of a new alert: critical, high, moderate (default), low, info, or P1 to P5.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The request body `$JSON` (the check), for down and for up. `grace`, `new`, `paused` and `started` change nothing."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new alert (down).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "A repeat (down again), a resolve (the closed alert, or alert null when none is open), or a state that changes nothing (alert null).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AlertEnvelope"
                    },
                    {
                      "$ref": "#/components/schemas/ResolvedAlertEnvelope"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "A body that is not the format of Healthchecks.io (`invalid_request`), with a setup hint; or a wrong `priority`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/uptimerobotcom": {
      "post": {
        "operationId": "uptimeRobotWebhook",
        "tags": [
          "Suitaar API"
        ],
        "summary": "The webhook of UptimeRobot: down makes an alert, up closes it",
        "description": "Paste this URL into UptimeRobot with the header `Authorization: Bearer <source key>`. The default variables as POST parameters (or as JSON): `alertType` 1 down, 2 up, 3 SSL or domain expiry (its own low alert). Only the fields that Suitaar uses are stored, never the raw body. The guide has the setup.",
        "parameters": [
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "description": "The priority of a new alert: critical, high, moderate (default), low, info, or P1 to P5.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "description": "The default variables as POST parameters (or as JSON): `alertType` 1 down, 2 up, 3 SSL or domain expiry (its own low alert)."
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The default variables as POST parameters (or as JSON): `alertType` 1 down, 2 up, 3 SSL or domain expiry (its own low alert)."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new alert (down).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "A repeat (down again), a resolve (the closed alert, or alert null when none is open), or a state that changes nothing (alert null).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AlertEnvelope"
                    },
                    {
                      "$ref": "#/components/schemas/ResolvedAlertEnvelope"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "A body that is not the format of UptimeRobot (`invalid_request`), with a setup hint; or a wrong `priority`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key, another scheme, or a wrong key (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/sentryio": {
      "post": {
        "operationId": "sentryWebhookByKey",
        "tags": [
          "Suitaar API"
        ],
        "summary": "The webhooks of a Sentry internal integration, with the source key in a header",
        "description": "The same as `/api/v1/webhooks/sentryio/{sourceID}`, with the source taken from `Authorization: Bearer <source key>`. When that source keeps a webhook signing secret, the signature is still required.",
        "parameters": [
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "description": "The priority of a new alert, instead of the level: critical, high, moderate, low, info, or P1 to P5.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Sentry-Hook-Resource",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The resource, for example `issue`."
          },
          {
            "name": "Sentry-Hook-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The hex HMAC-SHA256 of the raw body with the source's webhook signing secret. Required when the source keeps a secret."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Sentry's webhook body: `{\"action\", \"installation\", \"data\", \"actor\"}`."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new alert.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "A repeat, a resolve (the closed alert, or alert null when none is open), or a resource or action that changes nothing (alert null).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AlertEnvelope"
                    },
                    {
                      "$ref": "#/components/schemas/ResolvedAlertEnvelope"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "A body that is not a Sentry webhook, or no `Sentry-Hook-Resource` (`invalid_request`), with a setup hint; or a wrong `priority`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "No key or a wrong key, or a missing or wrong signature when the source keeps a secret (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "sourceKey": []
          }
        ]
      }
    },
    "/api/v1/webhooks/sentryio/{sourceID}": {
      "post": {
        "operationId": "sentryWebhook",
        "tags": [
          "Suitaar API"
        ],
        "summary": "The webhooks of a Sentry internal integration: an issue or an alert rule opens an alert, resolved closes it",
        "description": "Two ways to prove the request. With a webhook signing secret on the source (the client secret of the integration), `Sentry-Hook-Signature` must be the hex HMAC-SHA256 of the raw body with it, also when a key is sent. Without a secret, `Authorization: Bearer <source key>` (Sentry's Webhook Headers) is enough; a sent key must belong to the source in the path. `Sentry-Hook-Resource` decides: `issue` `created` and `unresolved`, and `event_alert` `triggered`, open or repeat the alert of the issue; `issue` `resolved`, `ignored` and `archived` close it; `metric_alert` `critical` and `warning` open the alert of the rule, `resolved` closes it; anything else answers alert null. Priority from the level (fatal P1, error P2, warning P3, info and debug P4), or `priority`. Only the fields that Suitaar uses are stored, never the event's user, request or stack trace. The guide has the setup.",
        "parameters": [
          {
            "name": "sourceID",
            "in": "path",
            "required": true,
            "description": "The id of the source (on its page).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "description": "The priority of a new alert, instead of the level: critical, high, moderate, low, info, or P1 to P5.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Sentry-Hook-Resource",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The resource, for example `issue`."
          },
          {
            "name": "Sentry-Hook-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The hex HMAC-SHA256 of the raw body with the source's webhook signing secret. Required when the source keeps a secret."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Sentry's webhook body: `{\"action\", \"installation\", \"data\", \"actor\"}`."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A new alert.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "A repeat, a resolve (the closed alert, or alert null when none is open), or a resource or action that changes nothing (alert null).",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/AlertEnvelope"
                    },
                    {
                      "$ref": "#/components/schemas/ResolvedAlertEnvelope"
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "A body that is not a Sentry webhook, or no `Sentry-Hook-Resource` (`invalid_request`), with a setup hint; or a wrong `priority`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "A missing or wrong signature when the source keeps a secret, no key and no secret, a wrong key, a key of another source, or an unknown source (`unauthorized`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB (`too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests for this source, for both APIs together (`rate_limited`).",
            "headers": {
              "Retry-After": {
                "description": "Seconds until a new try is safe.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "An error in Suitaar (`internal`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {},
          {
            "sourceKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "sourceKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "The key of a source, from its page in Suitaar. The same key works for the Opsgenie API."
      },
      "genieKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "`GenieKey <source key>` (the scheme in any case). The same source key works for Suitaar's API."
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "The id of this request. Give it when you ask for help.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "AlertRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "description": "Required to fire. Trimmed, cut to 130 characters. To resolve, the title finds the alert when there is no key."
          },
          "key": {
            "type": "string",
            "description": "For deduplication: a new alert with the key of an open alert is a repeat. Cut to 512. Without it, the key is the SHA-256 hex of the title."
          },
          "description": {
            "type": "string",
            "description": "Cut to 15,000 characters."
          },
          "priority": {
            "type": "string",
            "description": "critical, high, moderate, low, info, or P1 to P5, in any case. Default: moderate.",
            "examples": [
              "high",
              "P2"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "At most 20 tags of 50 characters; repeats are removed."
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Keys and values together at most 8,000 characters."
          },
          "entity": {
            "type": "string",
            "description": "What the alert is about, for example a host. Cut to 512."
          },
          "source": {
            "type": "string",
            "description": "The name of the tool that sends the alert. Cut to 100."
          },
          "note": {
            "type": "string",
            "description": "A first note. Cut to 25,000."
          },
          "status": {
            "type": "string",
            "enum": [
              "firing",
              "resolved"
            ],
            "description": "firing (the default) makes an alert or a repeat. resolved closes the open alert with the same key (else the same title), so a tool with one webhook URL for down and up can use this route alone. Any case."
          }
        }
      },
      "AlertRequestEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alert"
        ],
        "properties": {
          "alert": {
            "$ref": "#/components/schemas/AlertRequest"
          }
        }
      },
      "ActionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "note": {
            "type": "string",
            "description": "Cut to 25,000 characters."
          },
          "by": {
            "type": "string",
            "description": "Who did it. Cut to 100."
          }
        }
      },
      "AcknowledgeEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "acknowledge": {
            "$ref": "#/components/schemas/ActionRequest"
          }
        }
      },
      "CloseEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "close": {
            "$ref": "#/components/schemas/ActionRequest"
          }
        }
      },
      "NoteRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string",
            "description": "Required. Cut to 25,000 characters."
          },
          "by": {
            "type": "string",
            "description": "Who wrote it. Cut to 100."
          }
        }
      },
      "NoteEnvelope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "note"
        ],
        "properties": {
          "note": {
            "$ref": "#/components/schemas/NoteRequest"
          }
        }
      },
      "Alert": {
        "type": "object",
        "required": [
          "id",
          "key",
          "title",
          "description",
          "priority",
          "status",
          "count",
          "tags",
          "details",
          "entity",
          "source",
          "firstAt",
          "lastAt",
          "acknowledgedAt",
          "closedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "priority": {
            "type": "string",
            "enum": [
              "critical",
              "high",
              "moderate",
              "low",
              "info"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "acknowledged",
              "closed"
            ]
          },
          "count": {
            "type": "integer",
            "description": "1, and one more for each repeat."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "details": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "entity": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "The `source` text of the caller."
          },
          "firstAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastAt": {
            "type": "string",
            "format": "date-time"
          },
          "acknowledgedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "closedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AlertEnvelope": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "alert"
            ],
            "properties": {
              "alert": {
                "$ref": "#/components/schemas/Alert"
              }
            }
          }
        }
      },
      "Heartbeat": {
        "type": "object",
        "required": [
          "name",
          "status",
          "lastPingAt"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired"
            ]
          },
          "lastPingAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "HeartbeatEnvelope": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "heartbeat"
            ],
            "properties": {
              "heartbeat": {
                "$ref": "#/components/schemas/Heartbeat"
              }
            }
          }
        }
      },
      "ErrorEnvelope": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthorized",
                  "not_found",
                  "conflict",
                  "too_large",
                  "invalid_request",
                  "rate_limited",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "OpsgenieCreateAlertPayload": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieAlertActionPayload"
          },
          {
            "required": [
              "message"
            ],
            "properties": {
              "message": {
                "type": "string",
                "description": "Message of the alert"
              },
              "alias": {
                "type": "string",
                "description": "Client-defined identifier of the alert, that is also the key element of alert deduplication."
              },
              "description": {
                "type": "string",
                "description": "Description field of the alert that is generally used to provide a detailed information about the alert."
              },
              "responders": {
                "type": "array",
                "description": "Responders that the alert will be routed to send notifications",
                "items": {
                  "$ref": "#/components/schemas/OpsgenieRecipient"
                }
              },
              "visibleTo": {
                "type": "array",
                "description": "Teams and users that the alert will become visible to without sending any notification",
                "items": {
                  "$ref": "#/components/schemas/OpsgenieRecipient"
                }
              },
              "actions": {
                "type": "array",
                "description": "Custom actions that will be available for the alert",
                "items": {
                  "type": "string"
                }
              },
              "tags": {
                "type": "array",
                "description": "Tags of the alert",
                "items": {
                  "type": "string"
                }
              },
              "details": {
                "type": "object",
                "description": "Map of key-value pairs to use as custom properties of the alert",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "entity": {
                "type": "string",
                "description": "Entity field of the alert that is generally used to specify which domain alert is related to"
              },
              "priority": {
                "type": "string",
                "description": "Priority level of the alert",
                "enum": [
                  "P1",
                  "P2",
                  "P3",
                  "P4",
                  "P5"
                ]
              }
            }
          }
        ]
      },
      "OpsgenieSuccessResponse": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieBaseResponse"
          },
          {
            "properties": {
              "result": {
                "type": "string"
              },
              "data": {
                "$ref": "#/components/schemas/OpsgenieSuccessData"
              }
            }
          }
        ]
      },
      "OpsgenieErrorResponse": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieBaseResponse"
          },
          {
            "properties": {
              "message": {
                "type": "string"
              },
              "code": {
                "type": "integer",
                "format": "int32"
              },
              "responseHeaders": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        ]
      },
      "OpsgenieGetAlertResponse": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieBaseResponse"
          },
          {
            "properties": {
              "data": {
                "$ref": "#/components/schemas/OpsgenieAlert"
              }
            }
          }
        ]
      },
      "OpsgenieCloseAlertPayload": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieAlertActionPayload"
          }
        ]
      },
      "OpsgenieAcknowledgeAlertPayload": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieAlertActionPayload"
          }
        ]
      },
      "OpsgenieAddNoteToAlertPayload": {
        "type": "object",
        "required": [
          "note"
        ],
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieAlertActionPayload"
          }
        ]
      },
      "OpsgenieGetRequestStatusResponse": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieBaseResponse"
          },
          {
            "properties": {
              "data": {
                "$ref": "#/components/schemas/OpsgenieAlertRequestStatus"
              }
            }
          }
        ]
      },
      "OpsgenieAlertActionPayload": {
        "type": "object",
        "properties": {
          "user": {
            "type": "string",
            "description": "Display name of the request owner"
          },
          "note": {
            "type": "string",
            "description": "Additional note that will be added while creating the alert"
          },
          "source": {
            "type": "string",
            "description": "Source field of the alert. Default value is IP address of the incoming request"
          }
        }
      },
      "OpsgenieRecipient": {
        "type": "object",
        "discriminator": {
          "propertyName": "type"
        },
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "all",
              "none",
              "user",
              "escalation",
              "schedule",
              "team",
              "group"
            ]
          },
          "id": {
            "type": "string"
          }
        }
      },
      "OpsgenieBaseResponse": {
        "type": "object",
        "required": [
          "requestId",
          "took"
        ],
        "properties": {
          "requestId": {
            "type": "string"
          },
          "took": {
            "type": "number",
            "format": "float",
            "default": 0
          }
        }
      },
      "OpsgenieSuccessData": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "OpsgenieAlert": {
        "type": "object",
        "allOf": [
          {
            "$ref": "#/components/schemas/OpsgenieBaseAlert"
          },
          {
            "properties": {
              "actions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "entity": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              }
            }
          }
        ]
      },
      "OpsgenieAlertRequestStatus": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "processedAt": {
            "type": "string",
            "format": "date-time"
          },
          "integrationId": {
            "type": "string"
          },
          "isSuccess": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "alertId": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "success": {
            "type": "boolean",
            "description": "In Opsgenie's answers (and its documentation), but not in its specification."
          }
        }
      },
      "OpsgenieBaseAlert": {
        "type": "object",
        "required": [
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "tinyId": {
            "type": "string"
          },
          "alias": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "acknowledged": {
            "type": "boolean"
          },
          "isSeen": {
            "type": "boolean"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "snoozed": {
            "type": "boolean"
          },
          "snoozedUntil": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "lastOccurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "responders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpsgenieResponder"
            }
          },
          "integration": {
            "$ref": "#/components/schemas/OpsgenieAlertIntegration"
          },
          "report": {
            "$ref": "#/components/schemas/OpsgenieAlertReport"
          }
        }
      },
      "OpsgenieResponder": {
        "type": "object",
        "discriminator": {
          "propertyName": "type"
        },
        "required": [
          "type",
          "id"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "user",
              "team",
              "escalation",
              "schedule"
            ]
          },
          "id": {
            "type": "string"
          }
        }
      },
      "OpsgenieAlertIntegration": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      },
      "OpsgenieAlertReport": {
        "type": "object",
        "properties": {
          "ackTime": {
            "type": "integer",
            "format": "int64"
          },
          "closeTime": {
            "type": "integer",
            "format": "int64"
          },
          "acknowledgedBy": {
            "type": "string"
          },
          "closedBy": {
            "type": "string"
          }
        }
      },
      "OpsgenieUpdateAlertMessagePayload": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Message of the alert"
          }
        }
      },
      "OpsgenieUpdateAlertDescriptionPayload": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string",
            "description": "Description field of the alert that is generally used to provide a detailed information about the alert."
          }
        }
      },
      "ResolvedAlertEnvelope": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "alert"
            ],
            "properties": {
              "alert": {
                "description": "The closed alert, or null when no alert with this key was open.",
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/Alert"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Suitaar API",
      "description": "Suitaar's own API, under `/api/v1`, with `Authorization: Bearer <source key>`. Creating alerts and the webhooks of Uptime Kuma, Healthchecks.io and UptimeRobot are open to everyone. The other routes are available by request for now (mail@suitaar.com): until they are on for your team, they answer 404."
    },
    {
      "name": "Opsgenie-compatible API",
      "description": "For tools that speak Opsgenie. Paths, fields and answers as in Opsgenie's own specification (github.com/opsgenie/opsgenie-oas, Alert API and Heartbeat API), at `/api/og/v2/…` or `ogapi.suitaar.com/v2/…`.\n\n**What is different from Opsgenie:**\n- Only these operations: create, get, close, acknowledge and add a note to an alert, the request status, and the heartbeat ping. Other Opsgenie routes answer 404.\n- `responders`, `visibleTo` and `actions` are accepted and ignored: Suitaar routes alerts with its channels.\n- No tiny ids: `tinyId` is empty, and `identifierType=tiny` answers 422.\n- An alert has fixed values for what Suitaar does not have: `owner` empty, `isSeen` and `snoozed` false, `responders` and `actions` empty.\n- `details` values that are numbers, booleans or null become text.\n- Limits: a body of 64 KB (413); 600 requests a minute for each source, shared with Suitaar's API (429).\n- Heartbeats are made in Suitaar (on the source page), not with the Opsgenie Heartbeat API; only the ping is here.",
      "externalDocs": {
        "url": "https://github.com/opsgenie/opsgenie-oas"
      }
    }
  ]
}
