preview
We're still working on this feature, but we'd love for you to try it out!
This feature is currently provided as part of a preview program pursuant to our pre-release policies.
Use the NerdGraph API to create, test, list, update, and delete cross account destinations. Cross account destinations allow you to centralize notification management at the organization level.
Create a destination
In order to create a destination, different inputs must be provided for each destination type.
重要
You must provide a scope object identifying where the destination will be created. The scope object requires:
- id: The ID of the Account or Organization.
- type: The type of scope (Account or Organization).
An optional two_way_integration property is available for integrations that allow two-way integration.
Use aiNotificationsCreateDestination mutation to create a Jira destination that integrates with your Atlassian Jira instance for creating and managing issues from New Relic alerts.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination will be created. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Enum | (Required) Must be |
| String | (Required) A descriptive name for the Jira destination. |
| Object | (Required) Authentication configuration for connecting to your Jira instance. |
| Enum | (Required) Must be |
| Object | (Required) Contains the Jira authentication credentials (email and password/API token). |
| String | (Required) Your Jira account email address. |
| String | (Required) Your Jira account password or API token. For security, use an API token instead of your account password. |
| Array of Objects | (Required) Configuration properties including the Jira instance URL and integration options. |
| String | (Required) Must include a property with key "url" and value set to your Jira instance URL (e.g., "https://yourcompany.atlassian.net"). |
| String | (Optional) Set to "true" to enable bidirectional integration between New Relic and Jira. |
Sample query for an account and organization:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: JIRA name: "Destination Name" auth: { type: BASIC basic: { user: YOUR_EMAIL, password: YOUR_PASSWORD } } properties: [ { key: "url", value: "https://YOUR_INSTANCE.atlassian.net" } { key: "two_way_integration", value: "true" } ] } ) { destination { id name scope { id type } } }}Sample query for an organization:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ORGANIZATION_ID, type: ORGANIZATION } destination: { type: JIRA name: "Destination Name" auth: { type: BASIC basic: { user: YOUR_EMAIL, password: YOUR_PASSWORD } } properties: [ { key: "url", value: "https://YOUR_INSTANCE.atlassian.net" } { key: "two_way_integration", value: "true" } ] } ) { destination { id name scope { id type } } }}Use aiNotificationsCreateDestination mutation to create an email destination for sending notification alerts to email addresses.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination will be created. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Enum | (Required) Must be |
| String | (Required) A descriptive name for the email destination. |
| Array of Objects | (Required) Key-value pairs containing the email configuration. Must include an |
Sample query:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: EMAIL name: "Destination Name" properties: [{ key: "email", value: YOUR_EMAIL }] } ) { destination { id name scope { id type } } }}Use aiNotificationsCreateDestination mutation to create a webhook destination for sending HTTP POST requests to external endpoints when alerts are triggered.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination will be created. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Enum | (Required) Must be |
| String | (Required) A descriptive name for the webhook destination. |
| Object | (Optional) Authentication configuration. Required only when the webhook endpoint requires authentication. |
| Enum | (Required when auth is provided) Authentication method. Options: |
| Object | (Required for BASIC and TOKEN auth) Contains authentication credentials such as username/password or token information. |
| Array of Objects | (Required) Key-value pairs containing webhook configuration. Must include |
Sample query:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: WEBHOOK name: "Destination Name" auth: { type: BASIC basic: { user: YOUR_EMAIL, password: YOUR_PASSWORD } } properties: [ { key: "url", value: YOUR_WEBHOOK } { key: "two_way_integration", value: "true" } ] } ) { destination { id name scope { id type } } }}Use aiNotificationsCreateDestination mutation to create a PagerDuty service-level destination that integrates with a specific PagerDuty service using an integration key.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination will be created. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Enum | (Required) Must be |
| String | (Required) A descriptive name for the PagerDuty service destination. |
| Object | (Required) Authentication configuration containing the PagerDuty integration key. |
| Enum | (Required) Must be |
| Object | (Required) Contains the integration token and prefix for PagerDuty authentication. |
| String | (Required) The PagerDuty integration key obtained from your PagerDuty service configuration. |
| String | (Required) Must be |
| Array of Objects | (Optional) Additional configuration properties. Can be empty array for basic service integration. |
Sample query:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: PAGERDUTY_SERVICE_INTEGRATION name: "Destination Name" auth: { type: TOKEN basic: { token: YOUR_INTEGRATION_TOKEN, prefix: "Token token=" } } properties: [] } ) { destination { id name scope { id type } } }}Use aiNotificationsCreateDestination mutation to create a PagerDuty account-level destination that integrates with your entire PagerDuty account using an API key, allowing for broader incident management capabilities.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination will be created. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Enum | (Required) Must be |
| String | (Required) A descriptive name for the PagerDuty account destination. |
| Object | (Required) Authentication configuration containing the PagerDuty account API key. |
| Enum | (Required) Must be |
| Object | (Required) Contains the API token and prefix for PagerDuty account authentication. |
| String | (Required) The PagerDuty account API key obtained from your PagerDuty account settings. |
| String | (Required) Must be |
| Array of Objects | (Optional) Configuration properties for the account integration. Common property: |
Sample query:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: PAGERDUTY_ACCOUNT_INTEGRATION name: "Global PagerDuty Account" auth: { type: TOKEN basic: { token: YOUR_API_KEY, prefix: "Token token=" } } properties: [{ key: "two_way_integration", value: "true" }] } ) { destination { id name scope { id type } } }}Creating a cross-account Slack destination in New Relic requires OAuth authentication between the NerdGraph API and Slack. The following steps show you how to generate the authentication URL and complete the setup.
Generate the OAuth URL
Open the NerdGraph Explorer and paste the following query into the query editor. This query generates a unique Slack OAuth URL for your organization.
{actor {organization {aiNotifications {oAuthUrl(type: SLACK) {urltransactionIderror {descriptiondetailstype}}}}}}Click Play (Execute Query) at the top of the explorer.
Access the authentication link
- Once the query runs, you will see a JSON response on the right side of the screen containing a URL.
- Locate the
urlfield in the response. - Copy the entire URL string (everything inside the quotation marks).
- Open a new tab in your browser and paste the URL.
Complete Slack authorization
- The link takes you to a Slack authorization page.
- If prompted, sign in to the Slack workspace you want to connect.
- Review the permissions requested by New Relic.
- To authorize the connection, click Allow.
- You should be redirected back to a New Relic "Success" page.
Verify the destination
After successful OAuth authentication, the destination is automatically created at the organization level, making it available across all accounts in your organization.
- Navigate to one.newrelic.com > Alerts > Destinations.
- In the Destinations list, you should now see a new entry for the Slack workspace you just authenticated.
Use aiNotificationsCreateDestination mutation to create a ServiceNow destination that integrates with your ServiceNow instance for creating and managing incidents from New Relic alerts.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination will be created. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Enum | (Required) Must be |
| String | (Required) A descriptive name for the ServiceNow destination. |
| Object | (Required) Authentication configuration for connecting to your ServiceNow instance. |
| Enum | (Required) Must be |
| Object | (Required) Contains the ServiceNow authentication credentials (username and password). |
| String | (Required) Your ServiceNow account username or email address. |
| String | (Required) Your ServiceNow account password. Consider using a service account for better security. |
| Array of Objects | (Required) Configuration properties including the ServiceNow instance URL and integration options. |
| String | (Required) Must include a property with key "url" and value set to your ServiceNow instance URL (e.g., "https://yourcompany.service-now.com"). |
| String | (Optional) Set to "true" to enable bidirectional integration between New Relic and ServiceNow. |
Sample query:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: SERVICE_NOW name: "Destination Name" auth: { type: BASIC basic: { user: YOUR_EMAIL, password: YOUR_PASSWORD } } properties: [ { key: "url", value: "https://YOUR_INSTANCE.service-now.com" } { key: "two_way_integration", value: "true" } ] } ) { destination { id name scope { id type } } }}Use aiNotificationsCreateDestination mutation to create an AWS EventBridge destination that sends New Relic alert events to your AWS EventBridge for further processing and routing within your AWS ecosystem.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination will be created. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Enum | (Required) Must be |
| String | (Required) A descriptive name for the AWS EventBridge destination. |
| Object | (Required) Authentication configuration for connecting to AWS EventBridge using IAM credentials. |
| Enum | (Required) Must be |
| Object | (Required) Contains the AWS IAM authentication credentials (access key ID and secret access key). |
| String | (Required) Your AWS IAM access key ID. Ensure the IAM user has EventBridge permissions. |
| String | (Required) Your AWS IAM secret access key. Store this securely and consider using IAM roles when possible. |
| Array of Objects | (Required) Configuration properties including the AWS account ID and region for EventBridge. |
| String | (Required) Must include a property with key "AWSAccountId" and value set to your AWS account ID (12-digit number). |
| String | (Required) Must include a property with key "AWSRegion" and value set to your AWS region (e.g., "us-east-1", "eu-west-1"). |
Sample query:
mutation { aiNotificationsCreateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: EVENT_BRIDGE name: "Destination Name" auth: { type: BASIC basic: { user: YOUR_IAM_USER, password: YOUR_PASSWORD } } properties: [ { key: "AWSAccountId", value: YOUR_AWS_ACCOUNT_ID } { key: "AWSRegion", value: YOUR_AWS_REGION } ] } ) { destination { id name scope { id type } } }}Test a cross account destination
You can test cross account destinations before or after creation. You must provide the scope object.
Use aiNotificationsTestDestination mutation to test a destination configuration before creating it. This allows you to validate the settings and credentials without actually creating the destination.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope for the test. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| Object | (Required) The destination configuration object to test, including type, name, authentication, and properties. |
| Enum | (Required) The destination type to test. Options: |
| String | (Required) A name for the destination configuration being tested. |
| Object | (Optional) Authentication configuration for destinations that require credentials. Required for WEBHOOK, PAGERDUTY, JIRA, SERVICE_NOW, and EVENT_BRIDGE destinations. |
| Array of Objects | (Required) Key-value pairs that configure destination-specific settings such as URLs, email addresses, or integration options. |
Sample query:
mutation { aiNotificationsTestDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destination: { type: EMAIL name: "Destination Name" properties: [{ key: "email", value: YOUR_EMAIL }] } ) { error { details } details result }}Use aiNotificationsTestDestinationById mutation to test an existing destination by its ID. This verifies that the destination is properly configured and can successfully deliver notifications.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination exists. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| String | (Required) The unique identifier of the existing destination you want to test. This ID is returned when creating a destination or can be found by listing destinations. |
Sample query:
mutation { aiNotificationsTestDestinationById( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destinationId: YOUR_DESTINATION_ID ) { error { details } details result }}List and filter destinations
The destinations query allows you to paginate through all of your destinations at both account and organization levels. It also allows filtering functionality for cross account destinations.
Use the actor.organization.aiNotifications.destinations query to retrieve all destinations at the organization level, including cross account destinations that can be used across all accounts in the organization.
Input parameters
This query uses the GraphQL actor.organization context and does not require explicit input parameters. The query automatically returns all destinations accessible at the organization level.
Query field | Data type | Description |
|---|---|---|
| Object | Root query object representing the authenticated user's context. |
| Object | Organization context that provides access to organization-level resources and cross account destinations. |
| Object | AI Notifications service context for accessing notification-related resources. |
| Object | Query field that returns all destinations accessible at the organization level, including cross account destinations. |
Sample query:
{ actor { organization { aiNotifications { destinations { entities { id name scope { id type } } error { details } } } } }}Use the actor.account.aiNotifications.destinations query to retrieve all destinations accessible to a specific account, including both account-scoped destinations and cross account destinations available to that account.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| String/ID | (Required) The specific account ID for which to retrieve destinations. This account must be accessible to the authenticated user. |
Query fields
Query field | Data type | Description |
|---|---|---|
| Object | Root query object representing the authenticated user's context. |
| Object | Account context that provides access to account-specific resources and cross account destinations available to this account. |
| Object | AI Notifications service context for accessing notification-related resources. |
| Object | Query field that returns all destinations accessible to the specified account (both account-scoped and organization-scoped). |
Sample query:
{ actor { account(id: YOUR_ACCOUNT_ID) { aiNotifications { destinations { entities { id name scope { id type } } error { details } } } } }}Use cursor pagination to efficiently navigate through large sets of destinations. You must request the nextCursor field in your query to enable pagination.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| String/ID | (Required) The specific account ID for which to retrieve destinations. This account must be accessible to the authenticated user. |
| String | (Optional) Cursor for pagination. Use empty string |
Pagination workflow
With cursor pagination, you continue to make requests through the result set until the nextCursor that is returned from the response comes back empty. This signifies that you reached the end of your results.
Here's an example for an account (the same logic applies to organization):
{ actor { account(id: YOUR_ACCOUNT_ID) { aiNotifications { destinations(cursor: "") { nextCursor entities { id name scope { id type } } totalCount } } } }}The code above returns a set of results like this:
{ "data": { "actor": { "account": { "aiNotifications": { "destinations": { "nextCursor": "/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=", "entities": [ { "id": "01c0cbe7-3d70-47c1-99e0-adf906eed6c2", "name": "Destination Name", "scope": { "type": "ACCOUNT", "id": "312312" } }, { "id": "05db0207-c137-4985-8cb5-f21e7e57b8cc", "name": "Another Destination Name", "scope": { "type": "ACCOUNT", "id": "312312" } } ], "totalCount": 807 } } } } }}So, in your subsequent request, provide the cursor like so, until the cursor is empty:
{ actor { account(id: YOUR_ACCOUNT_ID) { aiNotifications { destinations( cursor: "/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=" ) { nextCursor entities { id name scope { id type } } totalCount } } } }}Here's another example for an organization
{ actor { organization { aiNotifications { destinations(cursor: "") { nextCursor entities { id name scope { id type } } totalCount } } } }}The code above returns a set of results like this:
{ "data": { "actor": { "organization": { "aiNotifications": { "destinations": { "nextCursor": "/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=", "entities": [ { "id": "01c0cbe7-3d70-47c1-99e0-adf906eed6c2", "name": "Destination Name", "scope": { "type": "ORGANIZATION", "id": "01ddcbe7-3d70-47c1-99e0-adf906eed6c2" } }, { "id": "05db0207-c137-4985-8cb5-f21e7e57b8cc", "name": "Another Destination Name", "scope": { "type": "ORGANIZATION", "id": "01ddcbe7-3d70-47c1-99e0-adf906eed6c2" } } ], "totalCount": 807 } } } } }}So, in your subsequent request, provide the cursor like so, until the cursor is empty:
{ actor { organization { aiNotifications { destinations( cursor: "/8o0y2qiR54m6thkdgHgwg==:jZTXDFKbTkhKwvMx+CtsPVM=" ) { nextCursor entities { id name scope { id type } } totalCount } } } }}Use name filtering to search for destinations by their names. The name filter supports both exact matches and partial matches, and is case insensitive.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| String/ID | (Required) The specific account ID for which to retrieve destinations. This account must be accessible to the authenticated user. |
| Object | (Required) Filter criteria object to narrow down results. |
| String | (Required) Filter by destination name. Supports partial matches and is case insensitive. Returns destinations whose names contain the specified string. |
Sample query:
This example finds destinations with "DevOps" in the name:
{ actor { account(id: YOUR_ACCOUNT_ID) { aiNotifications { destinations(filters: { name: "DevOps" }) { entities { id name scope { id type } } } } } }}Use ID filtering to retrieve a specific destination by its unique identifier. This filter returns exact matches only.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| String/ID | (Required) The specific account ID for which to retrieve destinations. This account must be accessible to the authenticated user. |
| Object | (Required) Filter criteria object to specify the exact destination to retrieve. |
| String | (Required) Filter by destination ID. Returns the destination with the exact matching ID, if it exists and is accessible to the specified account. |
Sample query:
{ actor { account(id: YOUR_ACCOUNT_ID) { aiNotifications { destinations(filters: { id: YOUR_DESTINATION_ID }) { entities { id name scope { id type } } } } } }}Use type filtering to retrieve destinations of a specific type. This filter returns all destinations that match the specified destination type.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| String/ID | (Required) The specific account ID for which to retrieve destinations. This account must be accessible to the authenticated user. |
| Object | (Required) Filter criteria object to narrow down results by destination type. |
| Enum | (Required) Filter by destination type. Valid values: |
Sample query:
The following query will return all email destinations on the chosen account:
{ actor { account(id: YOUR_ACCOUNT_ID) { aiNotifications { destinations(filters: { type: EMAIL }) { entities { id name scope { id type } } } } } }}Update a cross account destination
To update an existing cross-account destination, you must provide the organization scope and the destination ID.
Use aiNotificationsUpdateDestination mutation to update an existing cross-account destination.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination exists. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| String | (Required) The unique identifier of the destination you want to update. This ID is returned when creating a destination or can be found by listing destinations. |
| Object | (Required) The destination update object containing the fields you want to modify. Only include the fields you want to change. |
| String | (Optional) Updated name for the destination. |
| Object | (Optional) Updated authentication configuration for destinations that require credentials. |
| Array of Objects | (Optional) Updated key-value pairs for destination-specific settings such as URLs, email addresses, or integration options. |
Sample query:
mutation { aiNotificationsUpdateDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destinationId: YOUR_DESTINATION_ID destination: { name: "Updated destination Name" } ) { destination { id name scope { id type } } }}Delete a cross account destination
Delete cross account destinations by providing the scope and destination ID.
重要
Before deleting: If you receive an error stating "Entity type channel is in use", you must first delete all channels associated with the destination. Find associated channels and delete them individually before proceeding with destination deletion.
Use aiNotificationsDeleteDestination mutation to permanently delete a cross account destination.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| Object | (Required) Defines the scope where the destination exists. Use |
| String | (Required) The organization ID for cross account destinations or account ID for account-level destinations. |
| Enum | (Required) Must be |
| String | (Required) The unique identifier of the destination you want to delete. This ID is returned when creating a destination or can be found by listing destinations. |
Sample query:
mutation { aiNotificationsDeleteDestination( scope: { id: YOUR_ACCOUNT_ID, type: ACCOUNT } destinationId: YOUR_DESTINATION_ID ) { ids error { details } }}Use this query to find all channels that are currently using a specific destination. This is useful before deleting a destination to ensure no active channels will be affected.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| String/ID | (Required) The specific account ID to search for channels. This account must be accessible to the authenticated user. |
| Object | (Required) Filter criteria object to find channels using a specific destination. |
| String | (Required) The unique identifier of the destination to search for. Returns all channels that are configured to use this destination. |
Sample query:
{ actor { account(id: YOUR_ACCOUNT_ID) { aiNotifications { channels(filters: { destinationId: YOUR_DESTINATION_ID }) { entities { id name } } } } }}Use aiNotificationsDeleteChannel mutation to delete channels that are using a destination. You must delete all associated channels before you can delete the destination itself.
Input parameters
Parameter name | Data type | Description |
|---|---|---|
| String/ID | (Required) The account ID where the channel exists. This account must be accessible to the authenticated user. |
| String | (Required) The unique identifier of the channel you want to delete. This ID can be found by querying channels using the destination ID. |
Sample query:
mutation { aiNotificationsDeleteChannel( accountId: YOUR_ACCOUNT_ID channelId: "YOUR_CHANNEL_ID" ) { ids error { details } }}