Skip to main content
PUT
/
monitor
/
{monitor_id}
Update a Monitor
from deeprails import DeepRails

DEEPRAILS_API_KEY = "YOUR_API_KEY"

client = DeepRails(
    api_key=DEEPRAILS_API_KEY,
)

monitor_response = client.monitor.update(
    monitor_id="mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    name="Chatbot Monitor - DEPRECATED",
    status="inactive",
    guardrail_metrics=[
        "correctness",
        "completeness",
        "instruction_adherence"
    ],
    web_search=False,
    file_search=[],
    context_awareness=False,
)
print(monitor_response)
{
  "monitor_id": "mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "status": "active",
  "modified_at": "2025-01-15T10:30:00Z"
}
This endpoint can update the monitor’s name, description, status (active or inactive), guardrail_metrics, web_search, file_search when needed. Only fields provided in the request body will be updated.

Setting status to inactive will stop the monitor from recording and evaluating new events.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

monitor_id
string
required

The ID of the monitor to edit.

Body

application/json
name
string

New name of the monitor.

description
string

New description of the monitor.

status
enum<string>

Status of the monitor. Can be active or inactive. Inactive monitors no longer record and evaluate events.

Available options:
active,
inactive
Example:

"inactive"

guardrail_metrics
enum<string>[]

An array of the new guardrail metrics that model input and output pairs will be evaluated on.

Available options:
correctness,
completeness,
instruction_adherence,
context_adherence,
ground_truth_adherence,
comprehensive_safety

Whether to enable web search for this monitor's evaluations.

An array of file IDs to search in the monitor's evaluations. Files must be uploaded via the DeepRails API first.

A file ID corresponding to a file to search in the monitor's evaluations.

Response

Monitor updated successfully

monitor_id
string
required

A unique monitor ID.

Example:

"mon_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

status
enum<string>
required

Status of the monitor. Can be active or inactive. Inactive monitors no longer record and evaluate events.

Available options:
active,
inactive
Example:

"active"

modified_at
string<date-time>
required

The time the monitor was last modified in UTC.

Example:

"2025-01-15T10:30:00Z"