Source: https://docs.cumuluslabs.io/reference/alert_destinations.update
Content version: 805f3085

# alert_destinations.update

Set or clear the Slack webhook or PagerDuty routing key (revision compare-and-set)

## Request {#request}

`PATCH /api/v1/alert-destinations`

- MCP: `alert_destinations_update`
- SDK: `client.alert_destinations.update` (SDK path arguments use `path`; MCP uses `params`).
- Minimum API key role: **admin**.
- Idempotency: **natural**.

Use the request schema below. Read IDs from earlier operation results.

## Input schema {#input-schema}

```json
{
  "parameters": [],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AlertDestinationsUpdateRequest"
        }
      }
    }
  }
}
```

## Responses {#responses}

```json
{
  "200": {
    "description": "Set or clear the Slack webhook or PagerDuty routing key (revision compare-and-set)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AlertDestinationsGetResponse200"
        }
      }
    }
  },
  "4XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  },
  "5XX": {
    "description": "Typed error (ApiError)",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ApiError"
        }
      }
    }
  }
}
```

## Referenced schemas {#schemas}

```json
{
  "components": {
    "schemas": {
      "AlertDestinationsUpdateRequest": {
        "type": "object",
        "properties": {
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "destination": {
                  "type": "string",
                  "enum": [
                    "slack",
                    "pagerduty"
                  ]
                },
                "expected_revision": {
                  "type": "string",
                  "format": "uuid",
                  "nullable": true
                },
                "change": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "replace"
                          ]
                        },
                        "value": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 4096
                        }
                      },
                      "required": [
                        "kind",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "clear"
                          ]
                        }
                      },
                      "required": [
                        "kind"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "required": [
                "destination",
                "expected_revision",
                "change"
              ],
              "additionalProperties": false
            },
            "minItems": 1,
            "maxItems": 2
          }
        },
        "required": [
          "changes"
        ],
        "additionalProperties": false
      },
      "AlertDestinationsGetResponse200": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "object",
            "properties": {
              "owner_id": {
                "type": "string",
                "minLength": 1
              },
              "environment": {
                "type": "string",
                "minLength": 1
              },
              "tenant_id": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "owner_id",
              "environment",
              "tenant_id"
            ],
            "additionalProperties": false
          },
          "destinations": {
            "type": "object",
            "properties": {
              "slack": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "string",
                    "format": "uuid",
                    "nullable": true
                  },
                  "configured": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "revision",
                  "configured"
                ],
                "additionalProperties": false
              },
              "pagerduty": {
                "type": "object",
                "properties": {
                  "revision": {
                    "type": "string",
                    "format": "uuid",
                    "nullable": true
                  },
                  "configured": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "revision",
                  "configured"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "slack",
              "pagerduty"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "scope",
          "destinations"
        ],
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "unauthenticated",
                  "forbidden",
                  "not_found",
                  "conflict",
                  "invalid_request",
                  "idempotency_conflict",
                  "policy_denied",
                  "capability_unavailable",
                  "provider_unavailable",
                  "knowledge_unavailable",
                  "publication_invalid",
                  "run_not_active",
                  "rate_limited",
                  "outcome_unknown",
                  "internal"
                ]
              },
              "message": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "outcome": {
                "type": "string",
                "enum": [
                  "none",
                  "unknown"
                ]
              },
              "details": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "code",
              "message",
              "retryable",
              "outcome"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      }
    }
  }
}
```

## Errors and recovery {#errors}

See [API error handling](https://docs.cumuluslabs.io/api#errors) and [Troubleshooting](https://docs.cumuluslabs.io/troubleshooting).

## Related guides {#related-guides}

- [Using the API](https://docs.cumuluslabs.io/api)
