> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Update the Router for an Event Orchestration

`PUT https://api.pagerduty.com/event_orchestrations/{id}/router`

Update a Global Orchestration's Routing Rules.

An Orchestration Router allows you to create a set of Event Rules. The Router evaluates Events you send to this Global Orchestration against each of its rules, one at a time, and routes the event to a specific Service based on the first rule that matches. If an event doesn't match any rules, it'll be sent to service specified in as the `catch_all` or the "Unrouted" Orchestration if no service is specified.

For more information see the [API Concepts Document](https://docs.pagerduty.com/developer/api-concepts#event-orchestrations)

Scoped OAuth requires: `event_orchestrations.write`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | The ID of an Event Orchestration. |

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Request body (`application/json`)

Updates to Orchestration Router details. Omitted rules and rule details are deleted.

| Field | Type | Required | Description |
|---|---|---|---|
| `orchestration_path` | object | yes |  |
| `orchestration_path.type` |  |  | Indicates that these are a "router" type set of rules. Default: `router`. |
| `orchestration_path.parent` | object |  |  |
| `orchestration_path.parent.id` |  |  | ID of the Global Event Orchestration this Router belongs to. |
| `orchestration_path.parent.type` |  |  | One of: `event_orchestration_reference`. |
| `orchestration_path.sets` |  |  | The Router contains a single set of rules (the "start" set). The Router evaluates Events against these Rules, one at a time, and routes each Event to a specific Service based on the first rule that matches. Min items: 1. Max items: 1. |
| `orchestration_path.catch_all` | object |  | When none of the rules match an event, the event will be routed according to the catch_all settings. |
| `orchestration_path.catch_all.actions` | object |  |  |
| `orchestration_path.catch_all.actions.route_to` | string |  | With a value of 'unrouted', all events are sent to the Unrouted Orchestration. Default: `unrouted`. |

Example: Example Request

```json
{
  "orchestration_path": {
    "sets": [
      {
        "id": "start",
        "rules": [
          {
            "label": "Dynamically route events",
            "id": "763110d0",
            "actions": {
              "dynamic_route_to": {
                "source": "event.custom_details.pd_service",
                "regex": ".*",
                "lookup_by": "service_name"
              }
            }
          },
          {
            "label": "Events relating to our relational database",
            "id": "1c26698b",
            "conditions": [
              {
                "expression": "event.summary matches part 'database'"
              },
              {
                "expression": "event.source matches regex 'db[0-9]+-server'"
              }
            ],
            "actions": {
              "route_to": "PB31XBA"
            }
          },
          {
            "label": "Events relating to our www app server",
            "id": "d9801904",
            "conditions": [
              {
                "expression": "event.summary matches part 'www'"
              }
            ],
            "actions": {
              "route_to": "PC2D9ML"
            }
          },
          {
            "label": "Events relating to our delivery pipeline",
            "id": "ed624931",
            "conditions": [
              {
                "expression": "trigger_count over 1 minute > 3"
              }
            ],
            "actions": {
              "route_to": "PQSJBMA"
            }
          }
        ]
      }
    ]
  }
}
```

## Response 200

The Orchestration Router object.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `orchestration_path` | object | yes |  |
| `orchestration_path.type` |  |  | Indicates that these are a "router" type set of rules. Default: `router`. |
| `orchestration_path.parent` | object |  |  |
| `orchestration_path.parent.id` |  |  | ID of the Global Event Orchestration this Router belongs to. |
| `orchestration_path.parent.type` |  |  | One of: `event_orchestration_reference`. |
| `orchestration_path.sets` |  |  | The Router contains a single set of rules (the "start" set). The Router evaluates Events against these Rules, one at a time, and routes each Event to a specific Service based on the first rule that matches. Min items: 1. Max items: 1. |
| `orchestration_path.catch_all` | object |  | When none of the rules match an event, the event will be routed according to the catch_all settings. |
| `orchestration_path.catch_all.actions` | object |  |  |
| `orchestration_path.catch_all.actions.route_to` | string |  | With a value of 'unrouted', all events are sent to the Unrouted Orchestration. Default: `unrouted`. |
| `warnings` | array of one of: object |  | List of applicable warnings messages for each rule using a feature not available on your account plan. |
| `warnings[].message` | string |  | (option 1) A description of the warning and any potential side effects. |
| `warnings[].rule_id` | string |  | (option 1) The ID of the rule using the feature. |
| `warnings[].feature` | string |  | (option 1) The feature that the current account plan does not have access to. Example values include: * `threshold_condition` * `nested_rules` * `suspend` * `automation_actions` * `cache_variable:automation_actions` * `cache_variable:annotate` * `variables` * `interpolation:annotate` * `interpolation:extractions` * `interpolation:incident_custom_field_updates` * `suppress` * `incident_custom_field_updates` * `dynamic_route_to` * `escalation_policy` * `aiops_routing_mismatch` |
| `warnings[].feature_type` | string |  | (option 1) Specifies whether the feature is a part of the rule's conditions, or its actions. Example values include: * `conditions` * `actions` * `nested_rules` * `global_orchestrations` * `aiops_routing` For PDRP customers, this feature is branded **Signal Intelligence** in the PagerDuty product UI. The API field names and values (e.g. `aiops_routing_mismatch`, `aiops_routing`) are unchanged. |
| `warnings[].warning_type` | string |  | (option 1) The type of warning that is being returned for the rule. One of: `forbidden_feature`, `invalid_routing`. |

Example: Example Response

```json
{
  "orchestration_path": {
    "type": "router",
    "parent": {
      "id": "b02e973d-9620-4e0a-9edc-00fedf7d4694",
      "self": "https://api.pagerduty.com/event_orchestrations/b02e973d-9620-4e0a-9edc-00fedf7d4694",
      "type": "event_orchestration_reference"
    },
    "self": "https://api.pagerduty.com/event_orchestrations/b02e973d-9620-4e0a-9edc-00fedf7d4694/router",
    "sets": [
      {
        "id": "start",
        "rules": [
          {
            "label": "Dynamically route events",
            "id": "763110d0",
            "actions": {
              "dynamic_route_to": {
                "source": "event.custom_details.pd_service",
                "regex": ".*",
                "lookup_by": "service_name"
              }
            }
          },
          {
            "label": "Events relating to our relational database",
            "id": "1c26698b",
            "conditions": [
              {
                "expression": "event.summary matches part 'database'"
              },
              {
                "expression": "event.source matches regex 'db[0-9]+-server'"
              }
            ],
            "actions": {
              "route_to": "PB31XBA"
            }
          },
          {
            "label": "Events relating to our www app server",
            "id": "d9801904",
            "conditions": [
              {
                "expression": "event.summary matches part 'www'"
              }
            ],
            "actions": {
              "route_to": "PC2D9ML"
            }
          },
          {
            "label": "Events relating to our delivery pipeline",
            "id": "ed624931",
            "conditions": [
              {
                "expression": "trigger_count over 1 minute > 3"
              }
            ],
            "actions": {
              "route_to": "PQSJBMA"
            }
          }
        ]
      }
    ],
    "catch_all": {
      "actions": {
        "route_to": "unrouted"
      }
    },
    "created_at": "2021-11-18T16:42:01Z",
    "created_by": {
      "id": "P8B9WR8",
      "self": "https://api.pagerduty.com/users/P8B9WR8",
      "type": "user_reference"
    },
    "updated_at": "2021-11-18T16:42:01Z",
    "updated_by": {
      "id": "P8B9WR8",
      "self": "https://api.pagerduty.com/users/P8B9WR8",
      "type": "user_reference"
    },
    "version": "9co0z4b152oICsoV91_PW2.ww8ip_xap"
  },
  "warnings": [
    {
      "feature": "dynamic_route_to,",
      "feature_type": "actions,",
      "message": "This rule uses Dynamic Routing, which is an action not available on your account plan. The rule will be updated, but it will not be evaluated by events,",
      "rule_id": "763110d0,",
      "warning_type": "forbidden_feature"
    },
    {
      "feature": "threshold_condition",
      "feature_type": "conditions",
      "message": "This rule uses Threshold Condition, which is a condition not available on your account plan. The rule will be updated, but it will not be evaluated by events",
      "rule_id": "ed624931",
      "warning_type": "forbidden_feature"
    }
  ]
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 404

The requested resource was not found.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 405

The request was received and recognized by the server, but its HTTP method was rejected for the requested resource.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 409

The request conflicts with the current state of the server.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
