Skip to main content
POST
POST /v1/events/subscriptions

Create an Alert

Create an alert with POST, or use PUT to create it if it doesn’t exist and update it if it does. With PUT, Collate matches on name. The request body is described in the Alerts overview.

Examples

The example creates an Observability alert on the Test Case source. It fires when a test result with status Failed is posted for any test case under svc.db.schema.orders, and it sends the event to a webhook signed with a hash-based message authentication code (HMAC) secret.
POST /v1/events/subscriptions

Sources, Filters, and Triggers

The valid sources, filters, triggers, and arguments depend on the alert type and source. To list them, see Available Sources, Filters, and Triggers. The table shows the names for each Observability source. For what each one does, see the Alert Behavior Reference. Argument names and values:
  • filterByFqn takes fqnList, filterByDomain takes domainList, filterByOwner takes ownerNameList, and filterByTableNameTestCaseBelongsTo takes tableNameList. filterByUpdaterIsBot takes no arguments.
  • GetTestCaseStatusUpdates and GetTestSuiteStatusUpdates take testResultList with values Success, Failed, Aborted, or Queued.
  • GetTestCaseStatusUpdatesUnderSuite takes testStatusList and testSuiteList.
  • GetPipelineStatusUpdates takes pipelineStateList with values Successful, Failed, Pending, or Skipped.
  • GetIngestionPipelineStatusUpdates takes ingestionPipelineStateList with values queued, running, success, partialSuccess, failed, or stopped.
Call the resources endpoint to confirm the exact argument names for your version before you automate alert creation.

Alert for Incident Events

To receive a webhook when an incident changes status, create a Notification alert on the task source, because incidents are tasks. The task source accepts only the filterByMentionedName filter, so omit input and filter the events in your receiver. Log a few real events from your environment to confirm the payload before you build on it.

Response

Returns the created alert. The response includes these fields:
  • id, fullyQualifiedName, and version
  • filteringRules: the filters and triggers as expanded conditions
  • statusDetails: an object on each destination

Test a Destination Before You Create the Alert

POST /v1/events/subscriptions/testDestination sends a test message to one or more destinations and returns the result for each. At least one destination is required.

Errors

The endpoint can return these errors: