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

# Update a routing rule

> Write back an alert routing rule as a whole.

```http theme={null}
PUT /api/v1/alerts/routing/rules/{id}
```

Writes back a [routing rule](https://docs.molesignal.com/en-US/alerting/routing.md#routing-rules) as a whole. It requires `alerts.routing.manage`. The fields are those of [Create a routing rule](https://docs.molesignal.com/en-US/api/alerting/create-routing-rule.md); an optional field left out returns to its default. The rule keeps its place; [Reorder routing rules](https://docs.molesignal.com/en-US/api/alerting/reorder-routing-rules.md) changes it. Incidents already open are not affected.

```bash cURL theme={null}
curl -X PUT http://localhost:5080/api/v1/alerts/routing/rules/$RULE_ID \
  -H "authorization: Bearer $MS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"name": "Payments in production", "enabled": false, "target": {"kind": "team", "team_id": "<team-id>"}}'
```

The response is the updated rule.

**Errors**

| Status | Cause |
| - | - |
| `400` | A field is wrong, or the target team or policy does not exist. |
| `403` | The token lacks `alerts.routing.manage`. |
| `404` | The rule does not exist or belongs to another organization. |
| `422` | `name` or `target` is missing, or a value is not recognized. The response is plain text. |


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