POST
/
monitors
curl --request POST \
  --url https://api.axiom.co/v2/monitors \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "alertOnNoData": true,
  "aplQuery": "| where severity = '\''error'\'' | count() > 100",
  "columnName": "cpu_usage",
  "compareDays": 7,
  "createdAt": "2024-03-20T10:00:00Z",
  "createdBy": "usr_789xyz",
  "description": "Monitors CPU usage and alerts when it exceeds 90%",
  "disabled": false,
  "disabledUntil": "2024-04-01T00:00:00Z",
  "intervalMinutes": 5,
  "name": "Production CPU Monitor",
  "notifierIds": [
    "notify_slack_prod",
    "notify_email_oncall"
  ],
  "notifyByGroup": false,
  "notifyEveryRun": false,
  "operator": "Above",
  "rangeMinutes": 5,
  "resolvable": true,
  "secondDelay": 300,
  "skipResolved": false,
  "threshold": 90,
  "tolerance": 10,
  "triggerAfterNPositiveResults": 2,
  "triggerFromNRuns": 3,
  "type": "Threshold"
}'
{
  "alertOnNoData": true,
  "aplQuery": "| where severity = 'error' | count() > 100",
  "columnName": "cpu_usage",
  "compareDays": 7,
  "createdAt": "2024-03-20T10:00:00Z",
  "createdBy": "usr_789xyz",
  "description": "Monitors CPU usage and alerts when it exceeds 90%",
  "disabled": false,
  "disabledUntil": "2024-04-01T00:00:00Z",
  "intervalMinutes": 5,
  "name": "Production CPU Monitor",
  "notifierIds": [
    "notify_slack_prod",
    "notify_email_oncall"
  ],
  "notifyByGroup": false,
  "notifyEveryRun": false,
  "operator": "Above",
  "rangeMinutes": 5,
  "resolvable": true,
  "secondDelay": 300,
  "skipResolved": false,
  "threshold": 90,
  "tolerance": 10,
  "triggerAfterNPositiveResults": 2,
  "triggerFromNRuns": 3,
  "type": "Threshold",
  "id": "mon_xyz789"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Configuration for a monitoring rule. Monitors can be configured to:

  • Check threshold values (e.g., CPU usage > 90%)
  • Match specific events in logs
  • Detect anomalies based on historical patterns Each monitor runs on a specified interval and can trigger notifications through configured notifiers.

Response

200 - application/json
Monitor

Monitor configuration with its unique identifier