CumulusDocs
Open Studio
On this page

Set alert destinations

Set or clear the Slack webhook or PagerDuty routing key using the current revision.

Operation ID: alert_destinations.update.

Request

PATCH /api/v1/alert-destinations

  • TypeScript SDK: client.alert_destinations.update (path arguments use path).
  • MCP tool: sdk_client_call with operationId: "alert_destinations.update" (path arguments use input.path). Legacy alias: alert_destinations_update. Connect to your authenticated /mcp endpoint with an API key for the same environment.
  • Minimum API key role: admin.
  • Idempotency: No header required; the resource or revision identifies the change.

Read resource IDs from earlier responses and use a key for the same environment.

Request example

Read alert_destinations.get and copy the Slack destination’s revision before clearing it. This intentionally removes that workspace delivery destination; review affected rules first. Use change.kind replace with a private destination value to configure a new one.

Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Example values are synthetic.

cURL

curl
curl --fail-with-body -sS -X PATCH "${CUMULUS_BASE_URL%/}/api/v1/alert-destinations" \
  -H "Authorization: Bearer $CUMULUS_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "changes": [
    {
      "destination": "slack",
      "expected_revision": "66666666-6666-4666-8666-666666666666",
      "change": {
        "kind": "clear"
      }
    }
  ]
}'

TypeScript

typescript
import { Cumulus } from "@cumulus/sdk";

const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });

const response = await client.alert_destinations.update({
  "body": {
    "changes": [
      {
        "destination": "slack",
        "expected_revision": "66666666-6666-4666-8666-666666666666",
        "change": {
          "kind": "clear"
        }
      }
    ]
  }
});

Input schema

Path, query and header parameters

No path or query parameters.

JSON request body

FieldType or valuesRequiredDescription and limits
changesarray of objectRequiredminItems: 1. maxItems: 2.
changes[].destination"slack" · "pagerduty"Required—
changes[].expected_revisionstring (uuid) or nullRequiredRevision you last read. A stale revision is refused so another edit is not overwritten. pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
changes[].changeobjectRequired—
changes[].change · variant 1object—Fields for this schema branch.
changes[].change.kind"replace"Required—
changes[].change.valuestringRequiredminLength: 1. maxLength: 4096.
changes[].change · variant 2object—Fields for this schema branch.
changes[].change.kind"clear"Required—
Complete OpenAPI schema
OpenAPI JSON
{
  "parameters": [],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/AlertDestinationsUpdateRequest"
        }
      }
    }
  }
}

Responses

HTTP 200

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

application/json

FieldType or valuesRequiredDescription and limits
scopeobjectRequired—
scope.owner_idstringRequiredminLength: 1.
scope.environmentstringRequiredminLength: 1.
scope.tenant_idstring (uuid)Requiredpattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
destinationsobjectRequired—
destinations.slackobjectRequired—
destinations.slack.revisionstring (uuid) or nullRequiredpattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
destinations.slack.configuredbooleanRequired—
destinations.pagerdutyobjectRequired—
destinations.pagerduty.revisionstring (uuid) or nullRequiredpattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$.
destinations.pagerduty.configuredbooleanRequired—

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI 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

Expand the complete OpenAPI definitions for integrations that generate their own clients.

Complete OpenAPI schema
OpenAPI JSON
{
  "components": {
    "schemas": {
      "AlertDestinationsUpdateRequest": {
        "type": "object",
        "properties": {
          "changes": {
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "destination": {
                  "type": "string",
                  "enum": [
                    "slack",
                    "pagerduty"
                  ]
                },
                "expected_revision": {
                  "nullable": true,
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                },
                "change": {
                  "oneOf": [
                    {
                      "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
            }
          }
        },
        "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",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
              }
            },
            "required": [
              "owner_id",
              "environment",
              "tenant_id"
            ],
            "additionalProperties": false
          },
          "destinations": {
            "type": "object",
            "properties": {
              "slack": {
                "type": "object",
                "properties": {
                  "revision": {
                    "nullable": true,
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "configured": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "revision",
                  "configured"
                ],
                "additionalProperties": false
              },
              "pagerduty": {
                "type": "object",
                "properties": {
                  "revision": {
                    "nullable": true,
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
                  },
                  "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

See API error handling and Troubleshooting.

Content version 323fba60Customer SDKMarkdown source
Set alert destinations · Cumulus developer docs