curl --request PATCH \
--url https://my.orq.ai/v2/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"values": [
"<string>"
]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"default_range": "<string>",
"update_mask": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.update({ monitorId: 'monitor_01J81V5RZPVTDHXBV6M2YVJHRA', displayName: 'LLM cost (weekly)', defaultRange: '30d' });
import requests
url = "https://my.orq.ai/v2/monitors/{monitor_id}"
payload = {
"display_name": "<string>",
"description": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": ["<string>"],
"filters": [
{
"field": "<string>",
"values": ["<string>"]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": True,
"target": 123,
"decimals": 123,
"show_others": True,
"show_percentages": True
}
}
],
"default_range": "<string>",
"update_mask": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"monitor_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"type": "timeseries",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"source": "MONITOR_TELEMETRY_SOURCE_UNSPECIFIED",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"op": "eq",
"values": [
"<string>"
]
}
],
"grain": "auto",
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"visualization": "lines",
"unit": "count",
"sort": "desc",
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"preset_key": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_id": "<string>",
"updated_by_id": "<string>",
"default_range": "5m"
}
}Update a monitor
Updates monitor metadata and widgets. With update_mask, listed paths are replaced and widgets may be explicitly cleared. Without update_mask, legacy behavior is preserved: a non-empty widgets array replaces the set and an empty or omitted array keeps it. project_id is immutable.
curl --request PATCH \
--url https://my.orq.ai/v2/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"display_name": "<string>",
"description": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"values": [
"<string>"
]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"default_range": "<string>",
"update_mask": "<string>"
}
'import { Orq } from '@orq-ai/node';
const orq = new Orq({ apiKey: process.env.ORQ_API_KEY });
await orq.monitors.update({ monitorId: 'monitor_01J81V5RZPVTDHXBV6M2YVJHRA', displayName: 'LLM cost (weekly)', defaultRange: '30d' });
import requests
url = "https://my.orq.ai/v2/monitors/{monitor_id}"
payload = {
"display_name": "<string>",
"description": "<string>",
"widgets": [
{
"widget_id": "<string>",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"operation": "<string>",
"group_by": ["<string>"],
"filters": [
{
"field": "<string>",
"values": ["<string>"]
}
],
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"show_overall": True,
"target": 123,
"decimals": 123,
"show_others": True,
"show_percentages": True
}
}
],
"default_range": "<string>",
"update_mask": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"monitor": {
"monitor_id": "<string>",
"display_name": "<string>",
"description": "<string>",
"project_id": "<string>",
"widgets": [
{
"widget_id": "<string>",
"type": "timeseries",
"title": "<string>",
"queries": [
{
"metric": "<string>",
"source": "MONITOR_TELEMETRY_SOURCE_UNSPECIFIED",
"operation": "<string>",
"group_by": [
"<string>"
],
"filters": [
{
"field": "<string>",
"op": "eq",
"values": [
"<string>"
]
}
],
"grain": "auto",
"limit": 123
}
],
"layout": {
"x": 123,
"y": 123,
"w": 123,
"h": 123
},
"display": {
"visualization": "lines",
"unit": "count",
"sort": "desc",
"show_overall": true,
"target": 123,
"decimals": 123,
"show_others": true,
"show_percentages": true
}
}
],
"preset_key": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_id": "<string>",
"updated_by_id": "<string>",
"default_range": "5m"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Monitor ID to update.
Body
New workspace-unique display name. Omit to keep the current name.
New description. Omit to keep the current description.
Replacement widget set. When update_mask contains widgets, this value
replaces the full set and may be empty. Without update_mask, a non-empty
array replaces all widgets while an empty or omitted array keeps them.
Show child attributes
Show child attributes
New default relative time range. Omit to keep the current value unless
update_mask contains default_range, which clears it.
Optional explicit update presence. Listed paths are replaced; omitting the mask preserves the legacy partial-update behavior.
Response
OK
Updated monitor.
Show child attributes
Show child attributes
Was this page helpful?