Policy API

Please check Alert Policies page for more information.

API Requests

Create an API Integration and obtain your apiKey to make requests listed below. Please make sure that the integration is not restricted to access configurations.

Enable Policy Request

Enable policy request is used to enable an alert policy in OpsGenie. Only enabled policies will be used in alert processing.  Request takes the following parameters:

Mandatory Parameters

Parameter
apiKey API key is used for authenticating API requests
name Name of policy
Sample Request
curl -XPOST 'https://api.opsgenie.com/v1/json/alert/policy/enable' -d '
{
     "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
     "name" : "suppress_alert_policy"
}'
Response:
{
     "status" : "success",
     "code" : 200
}

Disable Policy Request

Disable policy request is used to disable an alert policy in OpsGenie. Disabled policies will not be used in alert processing.  Request takes the following parameters:

Mandatory Parameters

Parameter
apiKey API key is used for authenticating API requests
name Name of policy
Sample Request
curl -XPOST 'https://api.opsgenie.com/v1/json/alert/policy/disable' -d '
{
     "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
     "name" : "suppress_alert_policy"
}'
Response:
{
     "status" : "success",
     "code" : 200
}