Alerts

Create an alert

Creates a new alert.

post/analytics/v1/alerts

Request

  • Base URL
    https://api.doit.com
  • URL
    https://api.doit.com/analytics/v1/alerts
  • Auth
    • API key in header Authorization
    • or API key in header X-Tenant-Id and API key in header Authorization

Request body

namestring required

Name of the alert (max 64 characters).

recipientsstring[]

List of emails to notify when the alert is triggered. If omitted on create, defaults to the API user’s email. Must match allowed customer domains.

Example request

{
  "config": {
    "metric": {
      "type": "basic",
      "value": "cost"
    },
    "timeInterval": "year",
    "operator": "gt",
    "scopes": [
      {
        "key": "service_description",
        "type": "fixed",
        "values": [
          "Amazon Simple Storage Service"
        ]
      }
    ],
    "condition": "value",
    "currency": "USD",
    "value": 1000
  },
  "name": "test08"
}

Response

Created - The request succeeded.

idstring

Alert ID.

namestring required

Alert Name.

createTimeinteger

The time when the alert was created (in UNIX timestamp).

updateTimeinteger

Last time the alert was modified (in UNIX timestamp).

lastAlertedinteger

Last time the alert was triggered (in UNIX timestamp).

recipientsstring[]

List of emails that will be notified when the alert is triggered.

Example response

{
  "id": "7jyrczd6CSh3M8TuQ6Qq",
  "name": "fgfgh",
  "createTime": 1678628817062,
  "updateTime": 1678628938891,
  "lastAlerted": null,
  "recipients": [
    "user1@example.com",
    "user2@example.com"
  ],
  "config": {
    "condition": "value",
    "currency": "USD",
    "metric": {
      "type": "basic",
      "value": "cost"
    },
    "operator": "gt",
    "evaluateForEach": "",
    "attributions": [
      "PvqyGcdFcTHh7aLUdGdf"
    ],
    "scopes": [],
    "timeInterval": "month",
    "dataSource": "billing",
    "value": 500
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.