Escalation API (Deprecated)

πŸ“˜

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.

Create Escalation Request

Create escalation request is used to create escalations in OpsGenie. It takes the following parameters:

Mandatory Parameters

ParameterLimit
apiKeyAPI key is used for authenticating API requests
nameName of escalation100 chars
rulesEscalation rule list512 chars

Optional Parameters

Parameter
teamName of the team that the escalation will be assigned to. If left empty, the escalation will be global and not belong to any team.
descriptionThe description of escalation.

Mandatory Parameters Of Escalation Rule

ParameterLimit
delayTime delay of escalation rule in minutes1440
notifyUsername of user or name of group which will be notified

Optional Parameters Of Escalation Rule

Parameter
notifyTypeRecipient calculation logic for schedules. Possible values are 'default' (on call users), 'next' (next users in rotation) and 'previous' (previous users on rotation). If not given default is used.
notifyConditionThe condition for notifying the recipient of escalation rule that is based on the alert state. Possible values are if-not-acked and if-not-closed. If not given, if-not-acked is used.

Sample Request

curl -XPOST 'https://api.opsgenie.com/v1/json/escalation' -d '
{
     "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
     "name" : "network_escalation",
     "rules" : [
         {"delay":1, "notify":"[email protected]"},
         {"delay":2, "notify":"operations_schedule", "notifyType":"default", "notifyCondition":"if-not-closed"},
         {"delay":5, "notify":"DevOps_Schedule", "notifyType":"next", "notifyCondition":"if-not-acked"}
     ]
}'

Response:

{
     "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
     "status" : "successful",
     "code" : 200
}

Update Escalation Request

Update escalation request is used to update escalations in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
idId of escalation to be updated

Optional Parameters

ParameterLimit
nameName of escalation512 chars
rulesEscalation rule list512 chars
teamName of the team that the escalation will be assigned to.
descriptionThe description of escalation.

Escalation rule limits are the same as create request.

Sample Request

curl -XPOST 'https://api.opsgenie.com/v1/json/escalation' -d '
{
     "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
     "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
     "name" : "network_escalation_updated"
}'
curl -XPOST 'https://api.opsgenie.com/v1/json/escalation' -d '
{
     "apiKey": "eb243592-faa2-4ba2-a551q-1afdf565c889",
     "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
     "rules" : [
            {"delay":1, "notify":"[email protected]"},
            {"delay":2, "notify":"operations_schedule", "notifyType":"default", "notifyCondition":"if-not-closed"},
            {"delay":5, "notify":"DevOps_Schedule", "notifyType":"next", "notifyCondition":"if-not-acked"}
     ]
}'

Response:

{
     "status" : "successful",
     "code" : 200
}

Delete Escalation Request

Delete escalation request is used to delete escalations in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
idId of escalation to be deleted
nameName of escalation to be deleted

🚧

One of id or name parameters should be specified with delete escalation request

Sample Request

curl -XDELETE 'https://api.opsgenie.com/v1/json/escalation?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&name=network_escalation'
curl -XDELETE 'https://api.opsgenie.com/v1/json/escalation?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&id=ac463592-dbd2-4ca3-a651d-48fhf5j5c871'

Response:

{
     "status" : "successful",
     "code" : 200
}

Get Escalation Request

πŸ“˜

This is a read request. Therefore, even if the integration of the API key is configured as read-only, the request will be accepted.

Get escalation request is used to search and retrieve escalations in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests
idId of escalation to be retrieved
nameName of escalation to be retrieved

🚧

One of id or name parameters should be specified with get escalation request.

Sample Request For Escalation Retrieve

curl -XGET 'https://api.opsgenie.com/v1/json/escalation?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&name=network_escalation'
curl -XGET 'https://api.opsgenie.com/v1/json/escalation?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889&id=ac463592-dbd2-4ca3-a651d-48fhf5j5c871'

Response:

{
    "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
    "name" : "network_escalation",
    "team" : "operations",
    "rules" : [
        {
            "delay":1,
            "notify":"[email protected]",
            "type":"user",
            "notifyCondition":"if-not-acked"
        },
        {
            "delay":2,
            "notify":"database",
            "type":"group",
            "notifyCondition":"if-not-acked"
        },
        {
            "delay":3,
            "notify":"operations_schedule",
            "type":"team",
            "notifyType":"next",
            "notifyCondition":"if-not-closed"
        }
    ]
}

List Escalations Request

πŸ“˜

This is a read request. Therefore, even if the integration of the API key is configured as read-only, the request will be accepted.

List escalations request is used to list escalations in OpsGenie. It takes the following parameters:

Mandatory Parameters

Parameter
apiKeyAPI key is used for authenticating API requests

Sample Request

curl -XGET 'https://api.opsgenie.com/v1/json/escalation?apiKey=eb243592-faa2-4ba2-a551q-1afdf565c889'

Response:

{
    "escalations":[
        {
            "id" : "ac463592-dbd2-4ca3-a651d-48fhf5j5c871",
            "name" : "escalation1",
            "team" : "operations",
            "rules" : [
                {
                    "delay":1,
                    "notify":"[email protected]",
                    "type":"user",
                    "notifyCondition":"if-not-acked"
                },
                {
                    "delay":2,
                    "notify":"database",
                    "type":"group",
                    "notifyCondition":"if-not-acked"
                },
                {
                    "delay":3,
                    "notify":"operations_schedule",
                    "type":"schedule",
                    "notifyType":"next",
                    "notifyCondition":"if-not-closed"}
            ]
        },
        {
            "id" : "fg463552-dvf2-4ca3-a4315-48fhf5j67875",
            "name" : "escalation2",
            "team" : "",
            "rules" : [
                {
                    "delay":1,
                    "notify":"[email protected]",
                    "type":"user",
                    "notifyCondition":"if-not-closed"}
            ]
        }
    ]
}