Mezmo Alerts API

Manage preset alerts via /v1/config/presetalert. Preset alerts encapsulate presence/absence triggers, frequency, and notification channels (PagerDuty, Slack, webhook, email) that views can attach to.

OpenAPI Specification

mezmo-alerts-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Mezmo Alerts API
  description: |
    Manage Mezmo preset alerts. Preset alerts encapsulate presence or absence
    triggers, frequency, count thresholds, and notification channels (PagerDuty,
    Slack, webhook, email) that views attach to.
  version: '1.0'
servers:
- url: https://api.mezmo.com
tags:
- name: PresetAlerts
  description: Preset alert configuration
security:
- AccessToken: []
paths:
  /v1/config/presetalert:
    get:
      tags:
      - PresetAlerts
      summary: List Preset Alerts
      operationId: listPresetAlerts
      responses:
        '200':
          description: List of preset alerts.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PresetAlert'
    post:
      tags:
      - PresetAlerts
      summary: Create Preset Alert
      operationId: createPresetAlert
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresetAlertInput'
      responses:
        '201':
          description: Alert created.
  /v1/config/presetalert/{presetid}:
    parameters:
    - name: presetid
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - PresetAlerts
      summary: Get Preset Alert
      operationId: getPresetAlert
      responses:
        '200':
          description: Alert details.
    put:
      tags:
      - PresetAlerts
      summary: Update Preset Alert
      operationId: updatePresetAlert
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresetAlertInput'
      responses:
        '200':
          description: Alert updated.
    delete:
      tags:
      - PresetAlerts
      summary: Delete Preset Alert
      operationId: deletePresetAlert
      responses:
        '204':
          description: Alert deleted.
components:
  securitySchemes:
    AccessToken:
      type: http
      scheme: bearer
  schemas:
    PresetAlertInput:
      type: object
      required:
      - name
      - channels
      properties:
        name:
          type: string
        triggerinterval:
          type: string
          description: Window over which to evaluate the trigger.
        triggerlimit:
          type: integer
        triggermatchingall:
          type: boolean
        operator:
          type: string
          enum:
          - presence
          - absence
        channels:
          type: array
          items:
            $ref: '#/components/schemas/AlertChannel'
    AlertChannel:
      type: object
      required:
      - integration
      properties:
        integration:
          type: string
          enum:
          - email
          - slack
          - pagerduty
          - webhook
          - opsgenie
          - victorops
        emails:
          type: array
          items:
            type: string
        url:
          type: string
        key:
          type: string
        immediate:
          type: boolean
        operator:
          type: string
        terminal:
          type: boolean
    PresetAlert:
      allOf:
      - $ref: '#/components/schemas/PresetAlertInput'
      - type: object
        properties:
          presetid:
            type: string