swagger: '2.0' info: version: 0.0.1 title: Alertmanager admin alert API description: API of the Prometheus Alertmanager (https://github.com/prometheus/alertmanager) license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html basePath: /api/v2/ consumes: - application/json produces: - application/json tags: - name: alert description: Everything related to Alertmanager alerts paths: /alerts: get: tags: - alert operationId: getAlerts description: Get a list of alerts parameters: - in: query name: active type: boolean description: Include active alerts in results. If false, excludes active alerts and returns only suppressed (silenced or inhibited) alerts. default: true - in: query name: silenced type: boolean description: Include silenced alerts in results. If false, excludes silenced alerts. Note that true (default) shows both silenced and non-silenced alerts. default: true - in: query name: inhibited type: boolean description: Include inhibited alerts in results. If false, excludes inhibited alerts. Note that true (default) shows both inhibited and non-inhibited alerts. default: true - in: query name: unprocessed type: boolean description: Include unprocessed alerts in results. If false, excludes unprocessed alerts. Note that true (default) shows both processed and unprocessed alerts. default: true - name: filter in: query description: A matcher expression to filter alerts. For example `alertname="MyAlert"`. It can be repeated to apply multiple matchers. required: false type: array collectionFormat: multi items: type: string - name: receiver in: query description: A regex matching receivers to filter alerts by required: false type: string - $ref: '#/parameters/receiverMatchers' responses: '200': description: Get alerts response schema: $ref: '#/definitions/gettableAlerts' '400': $ref: '#/responses/BadRequest' '500': $ref: '#/responses/InternalServerError' post: tags: - alert operationId: postAlerts description: Create new Alerts parameters: - in: body name: alerts description: The alerts to create required: true schema: $ref: '#/definitions/postableAlerts' responses: '200': description: Create alerts response '500': $ref: '#/responses/InternalServerError' '400': $ref: '#/responses/BadRequest' definitions: postableAlerts: type: array items: $ref: '#/definitions/postableAlert' alert: type: object properties: labels: $ref: '#/definitions/labelSet' generatorURL: type: string format: uri required: - labels labelSet: type: object additionalProperties: type: string gettableAlert: allOf: - type: object properties: annotations: $ref: '#/definitions/labelSet' receivers: type: array items: $ref: '#/definitions/receiverReference' fingerprint: type: string startsAt: type: string format: date-time updatedAt: type: string format: date-time endsAt: type: string format: date-time status: $ref: '#/definitions/alertStatus' required: - receivers - fingerprint - startsAt - updatedAt - endsAt - annotations - status - $ref: '#/definitions/alert' receiverReference: type: object properties: name: type: string required: - name gettableAlerts: type: array items: $ref: '#/definitions/gettableAlert' postableAlert: allOf: - type: object properties: startsAt: type: string format: date-time endsAt: type: string format: date-time annotations: $ref: '#/definitions/labelSet' - $ref: '#/definitions/alert' alertStatus: type: object properties: state: type: string enum: - unprocessed - active - suppressed silencedBy: type: array items: type: string inhibitedBy: type: array items: type: string mutedBy: type: array items: type: string required: - state - silencedBy - inhibitedBy - mutedBy parameters: receiverMatchers: name: receiver_matchers in: query description: A matcher expression to filter by receiver labels. For example `owner="my-team"`. Can be repeated to apply multiple matchers. required: false type: array collectionFormat: multi items: type: string responses: InternalServerError: description: Internal server error schema: type: string BadRequest: description: Bad request schema: type: string