---
title: NerdGraph tutorial: Elections for cross-account alerting
source: https://docs.newrelic.com/docs/apis/nerdgraph/examples/nerdgraph-api-cross-account-alerting-elections
---

To allow data sharing between accounts within an organization, an account must opt in to the 'cross-account alerting' feature. Follow these instructions on how to use the NerdGraph API Explorer to update account settings by enabling cross-account alerting.

> #### ⚠️ IMPORTANT
>
> Only users with the "Data-sharing access control" permission can update cross-account elections for data sharing. By default, this permission is granted only to users with the "Organization Manager" role.

## Steps to update a cross-account alerting election

1.  Collect the list of account IDs to update. The API accepts up to **20 account IDs**.
2.  Indicate whether you want to enable `true` or disable `false` the election.
3.  Use the NerdGraph API explorer to update the account elections.

Here's an example of the mutation:

```graphql
mutation {
  alertsUpdateCrossAccountElections(
    accountIds: [YOUR_1ST_ACCOUNT_ID, YOUR_2ND_ACCOUNT_ID, YOUR_3RD_ACCOUNT_ID],
    electionStatus: true
  ) {
    electionStatus
  }
}
```
