> ## Documentation Index
> Fetch the complete documentation index at: https://docs.galtea.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Updating Monitor

> Update an existing monitor.

> [!WARNING]
>
> You are reading the docs of Galtea 5.11. [Read this page in the latest version](https://docs.galtea.ai/sdk/api/monitor/update.md).

## Returns

Returns the updated [Monitor](https://docs.galtea.ai/v5.11/concepts/product/monitor.md) object.

## Example

```python theme={"system"}
# Raise the sampling rate. Only the fields you pass change.
galtea.monitors.update(monitor.id, sampling_percentage=25)
```

To change the bound Specifications:

```python theme={"system"}
# Replace the bound Specifications. Pass an empty list to unbind them all.
# The monitor must keep at least one metric family or Specification.
galtea.monitors.update(specification_monitor.id, specification_ids=[specification.id])
```

To pause or resume a monitor, use [`monitors.pause()`](https://docs.galtea.ai/v5.11/sdk/api/monitor/pause) and [`monitors.resume()`](https://docs.galtea.ai/v5.11/sdk/api/monitor/resume). Setting `status` here still works. Users may set only `ACTIVE` (resume) or `PAUSED` (pause); `CAPPED`, `NO_CREDITS`, and `FAILING` are system-set and are rejected.

## Parameters

**monitor\_id** `string` *required*

The ID of the monitor to update.

**name** `string`

New name for the monitor.

**version\_id** `string`

New version to watch. Pass `None` to watch every version of the product.

**metric\_group\_ids** `list[string]`

New metric family IDs (`metric.metric_group_id`) to score with. Adding a self-hosted metric family
raises an error, for the same reason as on create. So does a newly bound
[Classifier (Jev)](https://docs.galtea.ai/v5.11/concepts/metric/classifier.md) family when classifier metrics are off on the
deployment. A family the monitor already binds can still be resent: only a newly bound family is checked.

**sampling\_percentage** `number`

New sampling percentage, from just above `0` up to `100`.

**monthly\_credit\_cap** `int`

New monthly credit cap. Must be positive when set. Pass `None` for no cap.

**status** `string | MonitorStatus`

New status. Prefer [`pause()`](https://docs.galtea.ai/v5.11/sdk/api/monitor/pause) and [`resume()`](https://docs.galtea.ai/v5.11/sdk/api/monitor/resume). Valid user-settable values: `ACTIVE` (resume), `PAUSED` (pause). Other string values are sent to the API unchanged, so values added in newer API versions can be used; the API rejects invalid ones.

**specification\_ids** `list[string]`

New Specification IDs to bind. The list replaces the bound Specifications, and an empty list unbinds them all.
Only Policy and Capability Specifications of the monitor's product are accepted. The update is refused when
the monitor would be left with nothing to score. Removing a Specification deletes the alert rules on that
Specification and on the families that only it brought.

> [!NOTE]
>
> Only the fields you pass are updated. Any field you omit is left unchanged. Pass `None` to clear `version_id` or `monthly_credit_cap`, the only nullable fields. The other fields refuse `None`: leave them out to keep their value, or pass an empty list to clear `metric_group_ids` or `specification_ids`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.