Policy API (Deprecated)

Please check Alert Policies page for more information.

📘

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
apiKeyAPI key is used for authenticating API requests
nameName 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
apiKeyAPI key is used for authenticating API requests
nameName 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
}