custom_sql

Create Custom SQL Monitor

Create a new custom SQL monitor for an asset.

post/api/v1/assets/{asset_id}/custom-sql-monitors

Request

  • Base URL: http://localhost:8000
  • URL: http://localhost:8000/api/v1/assets/{asset_id}/custom-sql-monitors
  • Auth: none declared

Path parameters

asset_idstring uuid required

Headers

Authorizationstring

Request body

namestring required

Human-readable name for this monitor

descriptionstring nullable

Optional description of what this monitor checks

sql_querystring required

SELECT query that returns a single numeric value

table_pathstring required

Primary table being monitored (for asset association)

upper_boundnumber nullable

Alert if value exceeds this threshold

lower_boundnumber nullable

Alert if value drops below this threshold

check_intervalstring required

How often to run (hourly, daily, weekly, or cron expression)

timeout_secondsinteger

Query execution timeout in seconds

enabledboolean

Whether the monitor should be active immediately

Example request

{
  "name": "Zero-Dollar Orders",
  "sql_query": "SELECT COUNT(*) FROM orders WHERE total_amount = 0",
  "table_path": "public.orders",
  "upper_bound": 10,
  "check_interval": "daily"
}

Response

Successful Response

successboolean required
dataunknown
messagestring nullable
errorstring nullable
metaobject nullable

Changes

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