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

# Try routing

> Work out which team and escalation policy an incident with a set of labels would get.

```http theme={null}
POST /api/v1/alerts/routing/test
```

Works out how an incident with these labels would be [routed](https://docs.molesignal.com/en-US/alerting/routing.md#routing-order) by the current routing rules, team on-call policies and service catalog. It requires `alerts.routing.read`. The source is taken to use the default policy; no incident opens and nothing is notified.

| Field | Type | Description |
| - | - | - |
| `labels` | object | The incident's labels. The origin is told by the label `alert.source`: `external` for an alert source, `synthetic` for a synthetic check, anything else for an alert rule. |
| `services` | array | Affected services; the first is used when the labels have no `service.name` or `service`. |
| `severity` | string | `info`, `warning` (default), `error` or `critical`. |

```bash cURL theme={null}
curl -X POST http://localhost:5080/api/v1/alerts/routing/test \
  -H "authorization: Bearer $MS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"labels": {"service.name": "checkout", "env": "prod"}, "severity": "critical"}'
```

```json 200 theme={null}
{
  "decision": {
    "escalation_policy_id": "<policy-id>",
    "team_id": "<team-id>",
    "routing": { "reason": "rule", "rule_id": "<rule-id>", "rule_name": "Payments in production" }
  },
  "matched_rule_id": "<rule-id>",
  "service": "default/checkout",
  "service_team_id": "<team-id>",
  "label_team_id": null
}
```

| Field | Description |
| - | - |
| `decision.escalation_policy_id` | The escalation policy the incident would take; `default` for the default policy. |
| `decision.team_id` | The team the incident would go to, or `null`. |
| `decision.routing` | Why, the same as `routing` on an incident; see [Incident fields](https://docs.molesignal.com/en-US/api/alerting/list-incidents.md#incident-fields). |
| `matched_rule_id` | The routing rule that matched, or `null`. |
| `service` | The service looked up for an owner, as `namespace/name`. |
| `service_team_id` | That service's owning team in the service catalog. |
| `label_team_id` | The team the label `team_id` or `team` points to. |


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