Create monitor
curl --request POST \
--url https://api.trymaitai.ai/api/v1/monitors \
--header 'Content-Type: application/json' \
--header 'X-Maitai-Api-Key: <api-key>' \
--data '
{
"name": "Order intake completeness",
"description": "Catches order intents that miss customer_id or order_total.",
"config": {
"runner": {
"resource_type": "direct",
"input": {
"response_path": "response"
}
},
"result": {
"error": {
"id": "g_err",
"kind": "group",
"op": "OR",
"children": [
{
"id": "c1",
"kind": "condition",
"source": "json",
"path": "customer_id",
"operator": "does_not_exist",
"value": ""
},
{
"id": "c2",
"kind": "condition",
"source": "json",
"path": "order_total",
"operator": "does_not_exist",
"value": ""
}
]
},
"warning": {
"id": "g_warn",
"kind": "group",
"op": "OR",
"children": []
},
"default_outcome": "pass"
}
}
}
'{
"data": {
"id": 502,
"name": "Order intake completeness",
"status": "DRAFT",
"target_count": 0,
"has_unpublished_changes": true
}
}Monitors
Create monitor
Create a reusable production monitor. New monitors land in DRAFT.
POST
/
monitors
Create monitor
curl --request POST \
--url https://api.trymaitai.ai/api/v1/monitors \
--header 'Content-Type: application/json' \
--header 'X-Maitai-Api-Key: <api-key>' \
--data '
{
"name": "Order intake completeness",
"description": "Catches order intents that miss customer_id or order_total.",
"config": {
"runner": {
"resource_type": "direct",
"input": {
"response_path": "response"
}
},
"result": {
"error": {
"id": "g_err",
"kind": "group",
"op": "OR",
"children": [
{
"id": "c1",
"kind": "condition",
"source": "json",
"path": "customer_id",
"operator": "does_not_exist",
"value": ""
},
{
"id": "c2",
"kind": "condition",
"source": "json",
"path": "order_total",
"operator": "does_not_exist",
"value": ""
}
]
},
"warning": {
"id": "g_warn",
"kind": "group",
"op": "OR",
"children": []
},
"default_outcome": "pass"
}
}
}
'{
"data": {
"id": 502,
"name": "Order intake completeness",
"status": "DRAFT",
"target_count": 0,
"has_unpublished_changes": true
}
}Was this page helpful?
⌘I