> ## 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.

# Set a team on-call policy

> Set or remove the on-call policy of a team.

```http theme={null}
PUT /api/v1/alerts/routing/teams/{team_id}
```

Sets or removes a team's [on-call policy](https://docs.molesignal.com/en-US/alerting/routing.md#team-on-call-policies). It requires `alerts.routing.manage`. New incidents routed to the team escalate by it; without one they take the default policy.

| Field | Type | Description |
| - | - | - |
| `escalation_policy_id` | string \| null | An escalation policy ID of the organization; `null` or left out removes the team's on-call policy. |

```bash cURL theme={null}
curl -X PUT http://localhost:5080/api/v1/alerts/routing/teams/$TEAM_ID \
  -H "authorization: Bearer $MS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"escalation_policy_id": "<policy-id>"}'
```

```json 200 theme={null}
{ "team_id": "<team-id>", "escalation_policy_id": "<policy-id>" }
```

**Errors**

| Status | Cause |
| - | - |
| `400` | The team does not exist or belongs to another organization, or the escalation policy does not exist. |
| `403` | The token lacks `alerts.routing.manage`. |
| `422` | Another field is given. The response is plain text. |


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