Can I copy my notification rules to other users?

You can copy a user's current notification rules to multiple other users; by making a single POST request to OpsGenie Web API. This is particulary useful if, for example, you've configured a good set of notification rules on your profile; and now want to apply these same rules to your 50 other users.

Upon a successful POST request, OpsGenie responds with the text "process started" and starts updating the notification rules of the targeted users; asynchronously. The whole process may be completed in ranging from 5 seconds to 10 minutes, depending on the size of the operation.

After all the updates are made, OpsGenie adds to your log stream a report of the operation, with the message "Copying of notification rules completed". In this report you can see how many users are updated and details of partial updates, in case your users haven't configured all their contact methods for the notification rules.

Either use the API key of your "Default API" integration in Integrations page or create an API Integration and obtain its API key to make the request below. Please make sure that the integration is not restricted to access configurations.
Please note that all the existing notification rules of the target users for the specified types will be deleted before copy.

The POST request takes the following parameters:

Parameter
apiKey API key is used for authenticating API requests
fromUser Username of the template user. This user's notification rules will be used for copying.
toUsers Specify a list of the users which you want to copy the rules to. You can use the username of a user, the name of a group, or to copy to all users, "all".
ruleTypes Specify a list of the action types you want to copy the rules of. It can contain "New Alert", "Acknowledged Alert" or for all types of notification rules, "all". The total list of valid types are:
  • all
  • New Alert
  • Acknowledged Alert
  • Closed Alert
  • Schedule Start
  • Renotified Alert
  • Assigned Alert
  • Add Note
Sample Request
curl -XPOST 'https://api.opsgenie.com/v1/json/copyNotificationRules' -d '
{
    "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
    "fromUser" : "john.smith@opsgenie.com",
    "toUsers" : [
        "group1",
        "andy.doe@opsgenie.com",
        "dave.white@opsgenie.com"
    ],
    "ruleTypes" : [
        "New Alert",
        "Alert Closed"
    ]
} '
                
Response:
{
     "status" : "process started",
     "code" : 200
}