godo.Apps.UpdateAlertDestinations()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.Apps.UpdateAlertDestinations(ctx context.Context, appID string, alertID string, update *godo.AlertDestinationUpdateRequest) (*godo.AppAlert, *godo.Response, error)

Description

UpdateAlertDestinations updates the alert destinations of an app’s alert

This method sends a POST request to /v2/apps/{}/alerts/{}/destinations.

Parameters

appID string required
alertID string required
update *godo.AlertDestinationUpdateRequest required

Fields of godo.AlertDestinationUpdateRequest

AlertDestinationUpdateRequest represents a request to update alert destinations.

Emails []string

JSON key: emails

SlackWebhooks []*godo.AppAlertSlackWebhook

JSON key: slack_webhooks

Returns

*godo.AppAlert
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.AppAlert

AppAlert Represents an alert configured for an app or component.

ID string

The ID of the alert. This will be auto-generated by App Platform once the spec is submitted.

Omitted from JSON when empty. JSON key: id

ComponentName string

Name of the component this alert applies to.

Omitted from JSON when empty. JSON key: component_name

Spec *godo.AppAlertSpec

Omitted from JSON when empty. JSON key: spec

Emails []string

Email destinations for the alert when triggered.

Omitted from JSON when empty. JSON key: emails

SlackWebhooks []*godo.AppAlertSlackWebhook

Slack webhook destinations for the alert when triggered.

Omitted from JSON when empty. JSON key: slack_webhooks

Phase godo.AppAlertPhase

Omitted from JSON when empty. JSON key: phase

Progress *godo.AppAlertProgress

Omitted from JSON when empty. JSON key: progress

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Apps.UpdateAlertDestinations(ctx, "<your-app-id>", "<your-alert-id>", &godo.AlertDestinationUpdateRequest{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

Response Example

Show Response Example
{
  "alert": {
    "id": "e552e1f9-c1b0-4e6d-8777-ad6f27767306",
    "spec": {
      "rule": "DEPLOYMENT_FAILED"
    },
    "emails": [
      "[email protected]"
    ],
    "phase": "ACTIVE",
    "progress": {
      "steps": [
        {
          "name": "alert-configure-insight-alert",
          "status": "SUCCESS",
          "started_at": "2020-07-28T18:00:00Z",
          "ended_at": "2020-07-28T18:00:00Z"
        }
      ]
    }
  }
}

More Information

See POST /v2/apps/{}/alerts/{}/destinations in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.