Skip to main content
POST
/
monitors
curl --request POST \
  --url https://api.coval.dev/v1/monitors \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Low Resolution Rate Alert",
  "evaluation_type": "ON_RUN_COMPLETE",
  "scope": "MONITORING",
  "conditions": [
    {
      "metric_id": "01HZMETRIC0000000000000000",
      "aggregation": "SINGLE",
      "operator": "LT",
      "threshold_float": 0.7
    }
  ],
  "channels": [
    {
      "channel_type": "SLACK",
      "config": {
        "channel_id": "C12345",
        "channel_name": "#alerts"
      }
    }
  ]
}
'
{
  "ulid": "01HZ0EXAMPLE00000000000000",
  "name": "Latency SLA Monitor",
  "status": "ACTIVE",
  "evaluation_type": "ON_RUN_COMPLETE",
  "scope": "ALL",
  "match_mode": "ALL",
  "cooldown_seconds": 43200,
  "trigger_count": 123,
  "conditions": [
    {
      "ulid": "<string>",
      "metric_id": "<string>",
      "aggregation": "SINGLE",
      "operator": "GT",
      "threshold_float": 123,
      "threshold_string": "<string>",
      "window_size_days": 183,
      "window_size_runs": 5000,
      "match_value": "<string>",
      "match_mode": "exact"
    }
  ],
  "channels": [
    {
      "ulid": "<string>",
      "channel_type": "SLACK",
      "config": {}
    }
  ],
  "create_time": "2023-11-07T05:31:56Z",
  "update_time": "2023-11-07T05:31:56Z",
  "description": "",
  "custom_message_template": "<string>",
  "agent_ids": [
    "<string>"
  ],
  "required_tags": [
    "<string>"
  ],
  "last_triggered_at": "2023-11-07T05:31:56Z"
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Body

application/json
name
string
required

Human-readable monitor name

Maximum string length: 200
evaluation_type
enum<string>
required

When the monitor evaluates

Available options:
ON_RUN_COMPLETE,
ROLLING_WINDOW
conditions
object[]
required
Minimum array length: 1
description
string
default:""
Maximum string length: 2000
scope
enum<string>

Which runs the monitor applies to

Available options:
ALL,
MONITORING,
SIMULATION
match_mode
enum<string>

How multiple conditions are combined (AND vs OR)

Available options:
ALL,
ANY
cooldown_seconds
integer
default:0
Required range: 0 <= x <= 86400
custom_message_template
string | null
Maximum string length: 5000
agent_ids
string[] | null
required_tags
string[] | null
channels
object[]

Response

Monitor created

ulid
string
required

Monitor ULID

Pattern: ^[0-9A-Z]{26}$
Example:

"01HZ0EXAMPLE00000000000000"

name
string
required

Human-readable monitor name

Maximum string length: 200
Example:

"Latency SLA Monitor"

status
enum<string>
required

Monitor status

Available options:
ACTIVE,
DELETED
evaluation_type
enum<string>
required

When the monitor evaluates

Available options:
ON_RUN_COMPLETE,
ROLLING_WINDOW
scope
enum<string>
required

Which runs the monitor applies to

Available options:
ALL,
MONITORING,
SIMULATION
match_mode
enum<string>
required

How multiple conditions are combined (AND vs OR)

Available options:
ALL,
ANY
cooldown_seconds
integer
required

Minimum seconds between triggers

Required range: 0 <= x <= 86400
trigger_count
integer
required

Number of times this monitor has triggered

conditions
object[]
required

Evaluation conditions

channels
object[]
required

Notification channels

create_time
string<date-time>
required

Creation timestamp

update_time
string<date-time>
required

Last update timestamp

description
string
default:""

Optional description

custom_message_template
string | null

Custom notification message template

Maximum string length: 5000
agent_ids
string[] | null

Restrict to specific agent IDs

required_tags
string[] | null

Restrict to runs with these tags

last_triggered_at
string<date-time> | null

Last trigger timestamp