Monitors
Set up model monitoring and alerts.
All methods are accessed via client.monitors.
create_monitor()
PUT/v1/monitors/create
Create a new monitor for a model.
Parameters
model_idstrRequired
ID of the model
namestrRequired
Name of the monitor
descriptionstrdefault:
''Description of the monitor
thresholdfloatdefault:
0.5Decision threshold
data_source_typestrdefault:
'csv'Data source type
schedule_typestrdefault:
'manual'Schedule type
Returns
str — The monitor ID
Example
1result = client.monitors.create_monitor(
2 model_id="model_abc123",
3 name="My Resource",
4 description="A description",
5 threshold=0.5,
6 data_source_type="csv",
7 schedule_type="manual"
8)
get_monitor()
GET/v1/monitors/{monitor_id}
Get a monitor by ID.
Parameters
monitor_idstrRequired
ID of the monitor
Returns
dict — Monitor data
Example
1result = client.monitors.get_monitor(
2 monitor_id="mon_abc123"
3)
get_model_monitors()
GET/v1/monitors/model/{model_id}
Get all monitors for a specific model.
Parameters
model_idstrRequired
ID of the model
Returns
list — List of monitor information
Example
1result = client.monitors.get_model_monitors(
2 model_id="model_abc123"
3)
get_team_monitors()
GET/v1/monitors/teams/{team_id}
Get all monitors for a team.
Parameters
team_idstrdefault:
NoneOptional team ID (uses session team_id if not provided)
Returns
list — List of monitor information
Example
1result = client.monitors.get_team_monitors(
2 team_id="team_abc123"
3)
update_monitor_name()
Update the name of a monitor.
Parameters
monitor_idstrRequired
ID of the monitor
namestrRequired
New name
Returns
dict — Updated monitor data
Example
1result = client.monitors.update_monitor_name(
2 monitor_id="mon_abc123",
3 name="My Resource"
4)
update_monitor_description()
Update the description of a monitor.
Parameters
monitor_idstrRequired
ID of the monitor
descriptionstrRequired
New description
Returns
dict — Updated monitor data
Example
1result = client.monitors.update_monitor_description(
2 monitor_id="mon_abc123",
3 description="A description"
4)
delete_monitor()
DELETE/v1/monitors/delete/{monitor_id}
Delete a monitor.
Parameters
monitor_idstrRequired
ID of the monitor to delete
Returns
dict — Success message
Example
1result = client.monitors.delete_monitor(
2 monitor_id="mon_abc123"
3)
add_monitor_items()
PUT/v1/monitors/monitor-items/add
Add items to a monitor.
Parameters
monitor_idstrRequired
ID of the monitor
monitor_itemslistRequired
List of monitor item data
Returns
dict — Created item IDs
Example
1result = client.monitors.add_monitor_items(
2 monitor_id="mon_abc123",
3 monitor_items=[{"data": {}}]
4)
get_monitor_item()
GET/v1/monitors/{monitor_id}
Get a specific monitor item.
Parameters
monitor_item_idstrRequired
ID of the monitor item
Returns
dict — Monitor item data
Example
1result = client.monitors.get_monitor_item(
2 monitor_item_id="item_abc123"
3)
delete_monitor_item()
DELETE/v1/monitors/delete/{monitor_id}
Delete a monitor item.
Parameters
monitor_item_idstrRequired
ID of the monitor item
Returns
dict — Success message
Example
1result = client.monitors.delete_monitor_item(
2 monitor_item_id="item_abc123"
3)
get_alert_rules()
GET/v1/monitors/{monitor_id}/alert-rules
Get alert rules for a monitor.
Parameters
monitor_idstrRequired
ID of the monitor
Returns
dict — Alert rules data
Example
1result = client.monitors.get_alert_rules(
2 monitor_id="mon_abc123"
3)
create_alert_rule()
PUT/v1/monitors/{monitor_id}/alert-rules
Create an alert rule for a monitor.
Parameters
monitor_idstrRequired
ID of the monitor
rule_typestrRequired
Type of rule (threshold, trend, volume)
valuefloatRequired
Rule threshold value
notify_in_appbooldefault:
TrueSend in-app notification
notify_emailbooldefault:
FalseSend email notification
Returns
dict — Created alert rule data
Example
1result = client.monitors.create_alert_rule(
2 monitor_id="mon_abc123",
3 rule_type="threshold",
4 value=0.8,
5 notify_in_app=True,
6 notify_email=False
7)