• EnglishEspañol日本語한국어Português
  • Log inStart now

NerdGraph tutorial: applied intelligence destinations

In addition to managing your applied intelligence destinations in the UI, you can use our NerdGraph API.

Tip

For help getting started with NerdGraph, see Introduction to NerdGraph.

List and filter destinations

The destinations query allows you to paginate through all of your destinations per account. It also allows some filtering functionality.

Create a destination

In order to create a destination, different inputs must be supplied for each destination type. An optional two_way_integration property is available for integrations that allow two-way integration.

Update a destination

When you update a destination, note that you don't need to supply all of the attributes on the destination. For example, you only need to supply the name if you only intend to update the name:

mutation {
aiNotificationsUpdateDestination(
accountId: YOUR_ACCOUNT_ID
destinationId: YOUR_destination_ID
destination: { name: "Updated destination Name" }
) {
destination {
id
name
}
}
}

Testing a destination

You can test destinations via the NerdGraph API. This can be done before or after creating the destination.

mutation {
aiNotificationsTestDestination(
accountId: YOUR_ACCOUNT_ID
destination: {
type: EMAIL
name: "Destination Name"
properties: [{ key: "email", value: YOUR_EMAIL }]
}
) {
error {
details
}
details
result
}
}
mutation {
aiNotificationsTestDestinationById(
accountId: YOUR_ACCOUNT_ID
destinationId: YOUR_DESTINATION_ID
) {
error {
details
}
details
result
}
}

Delete a destination

You can delete destinations via the NerdGraph API.

mutation {
aiNotificationsDeleteDestination(
accountId: YOUR_ACCOUNT_ID
destinationId: YOUR_DESTINATION_ID
) {
ids
error {
details
}
}
}

Important

If you receive a failure message stating Entity type channel is in use, you will need to identify the channels used by the destination and delete them before proceeding. To accomplish this, first find all the channels associated with the destination, then delete each channel individually.

{
actor {
account(id: YOUR_ACCOUNT_ID) {
aiNotifications {
channels(filters: { destinationId: YOUR_DESTINATION_ID }) {
entities {
id
name
}
}
}
}
}
}
mutation {
aiNotificationsDeleteChannel(
accountId: YOUR_ACCOUNT_ID
channelId: YOUR_CHANNEL_ID
) {
ids
error {
details
}
}
}
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.