Skip to main content
POST
/
api
/
v1
/
monitors
/
create
/
metric
Create a Metric Monitor
curl --request POST \
  --url https://app.datafold.com/api/v1/monitors/create/metric \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "alert": {
    "sensitivity": 50,
    "type": "<string>"
  },
  "connection_id": 123,
  "description": "<string>",
  "enabled": true,
  "metric": {
    "filter": "<string>",
    "metric": "row_count",
    "table": "<string>",
    "type": "table"
  },
  "name": "<string>",
  "notifications": [
    {
      "features": [
        "attach_csv"
      ],
      "recipients": [
        "<string>"
      ],
      "type": "email"
    }
  ],
  "schedule": {
    "interval": {
      "every": "<string>",
      "type": "hourly"
    }
  },
  "tags": [
    "<string>"
  ]
}'
{
  "id": 123
}

Authorizations

Authorization
string
header
required

Use the 'Authorization' header with the format 'Key <api-key>'

Body

application/json
connection_id
integer
required

The identifier for the data source configuration.

metric
object
required

Configuration for the metric being monitored.

  • Table
  • Column
  • Custom
name
string
required

The name of the monitor.

schedule
object
required

The schedule at which the monitor runs.

  • Interval
  • Cron
  • None
alert
object | null

Condition for triggering alerts.

  • Anomaly Detection
  • Absolute
  • Percentage
description
string | null

The description of the monitor.

enabled
boolean
default:true

Indicates whether the monitor is enabled.

notifications
Notifications · array

Notification configuration for the monitor.

  • Email
  • PagerDuty
  • Webhook
  • Slack
  • Teams
tags
string[]

Tags associated with the monitor.

Response

Successful Response

id
integer
required

Unique identifier for the monitor.

I