Skip to content
Start here

Get delivery mechanism eligibility

client.Alerting.Destinations.Eligible.Get(ctx, query) (*DestinationEligibleGetResponse, error)
GET/accounts/{account_id}/alerting/v3/destinations/eligible

Get a list of all delivery mechanism types for which an account is eligible.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
ParametersExpand Collapse
query DestinationEligibleGetParams
AccountID param.Field[string]

The account id

maxLength32
ReturnsExpand Collapse
type DestinationEligibleGetResponse map[string, []DestinationEligibleGetResponseItem]
Eligible boolOptional

Determines whether or not the account is eligible for the delivery mechanism.

Ready boolOptional

Beta flag. Users can create a policy with a mechanism that is not ready, but we cannot guarantee successful delivery of notifications.

Type DestinationEligibleGetResponseItemTypeOptional

Determines type of delivery mechanism.

One of the following:
const DestinationEligibleGetResponseItemTypeEmail DestinationEligibleGetResponseItemType = "email"
const DestinationEligibleGetResponseItemTypePagerduty DestinationEligibleGetResponseItemType = "pagerduty"
const DestinationEligibleGetResponseItemTypeWebhook DestinationEligibleGetResponseItemType = "webhook"

Get delivery mechanism eligibility

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/cloudflare-go"
  "github.com/stainless-sdks/cloudflare-go/alerting"
  "github.com/stainless-sdks/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  eligible, err := client.Alerting.Destinations.Eligible.Get(context.TODO(), alerting.DestinationEligibleGetParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", eligible)
}
{
  "errors": [
    {
      "message": "message",
      "code": 1000
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 1000
    }
  ],
  "success": true,
  "result": {
    "foo": [
      {
        "eligible": true,
        "ready": true,
        "type": "email"
      }
    ]
  }
}
Returns Examples
{
  "errors": [
    {
      "message": "message",
      "code": 1000
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 1000
    }
  ],
  "success": true,
  "result": {
    "foo": [
      {
        "eligible": true,
        "ready": true,
        "type": "email"
      }
    ]
  }
}