Alert API

📘

Create an API Integration and obtain your apiKey to make requests listed below.

🚧

If using the EU instance of Opsgenie, the URL needs to be https://api.eu.opsgenie.com for requests to be successful.

Get Request Status

Alert creation, deletion, and action requests are processed asynchronously to provide higher availability and scalability, therefore valid requests for those endpoints are responded to with HTTP status 202 - Accepted. The Get Request Status endpoint is used to track the status and alert details (if any) of the request whose identifier is given.

In-Line Parameters

Referred NameDescription
requestIdUniversally unique identifier of the questioned request. Please note: that ID of the request was provided within response.

Sample Requests

curl -X GET 'https://api.opsgenie.com/v2/alerts/requests/513085b8-caf3-4f91-aa23-be5fdefc3570'
    -H 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889'

Sample Responses

{
    "data": {
        "success": true,
        "action": "Create",
        "processedAt": "2017-05-24T14:24:20.844Z",
        "integrationId": "c9cec2cb-e782-4ebb-bc1d-1b2fa703cf03",
        "isSuccess": true,
        "status": "Created alert",
        "alertId": "8743a1b2-11da-480e-8493-744660987bef",
        "alias": "8743a1b2-11da-480e-8493-744660987bef"
    },
    "took": 0.022,
    "requestId": "ec7e1d8e-1c75-442e-a271-731070a7fa4d"
}
{
    "data": {
        "success": false,
        "action": "Acknowledge",
        "processedAt": "2017-05-24T14:41:18.185Z",
        "integrationId": "c9cec2cb-e782-4ebb-bc1d-1b2fa703cf03",
        "isSuccess": false,
        "status": "Alert does not exist",
        "alertId": "",
        "alias": ""
    },
    "took": 0.019,
    "requestId": "dc194ce3-9daf-4a19-bca3-40be91218089"
}

Create Alert

JSON Body Fields

FieldMandatoryDescriptionLimit
messagetrueMessage of the alert130 characters
aliasfalseClient-defined identifier of the alert, that is also the key element of Alert De-Duplication.512 characters
descriptionfalseDescription field of the alert that is generally used to provide a detailed information about the alert.15000 characters
respondersfalseTeams, users, escalations and schedules that the alert will be routed to send notifications. type field is mandatory for each item, where possible values are team, user, escalation and schedule. If the API Key belongs to a team integration, this field will be overwritten with the owner team. Either id or name of each responder should be provided.You can refer below for example values.50 teams, users, escalations or schedules
visibleTofalseTeams and users that the alert will become visible to without sending any notification.type field is mandatory for each item, where possible values are team and user. In addition to the type field, either id or name should be given for teams and either id or username should be given for users. Please note: that alert will be visible to the teams that are specified withinresponders field by default, so there is no need to re-specify them within visibleTo field. You can refer below for example values.50 teams or users in total
actionsfalseCustom actions that will be available for the alert.10 x 50 characters
tagsfalseTags of the alert.20 x 50 characters
detailsfalseMap of key-value pairs to use as custom properties of the alert.8000 characters in total
entityfalseEntity field of the alert that is generally used to specify which domain alert is related to.512 characters
sourcefalseSource field of the alert. Default value is IP address of the incoming request.100 characters.
priorityfalsePriority level of the alert. Possible values are P1, P2, P3, P4 and P5. Default value is P3.
userfalseDisplay name of the request owner.100 characters.
notefalseAdditional note that will be added while creating the alert.25000 characters.

responders field example:

{
    "responders":[
        {
            "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c",
            "type":"team"
        },
        {
            "name":"NOC",
            "type":"team"
        },
        {
            "id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8",
            "type":"user"
        },
        {
            "username":"[email protected]",
            "type":"user"
        },
        {
            "id":"aee8a0de-c80f-4515-a232-501c0bc9d715",
            "type":"escalation"
        },
        {
            "name":"Nightwatch Escalation",
            "type":"escalation"
        },
        {
            "id":"80564037-1984-4f38-b98e-8a1f662df552",
            "type":"schedule"
        },
        {
            "name":"First Responders Schedule",
            "type":"schedule"
        }
    ]
}

visibleTo field example:

{
    "visibleTo":[
        {
            "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c",
            "type":"team"
        },
        {
            "name":"rocket_team",
            "type":"team"
        },
        {
            "id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8",
            "type":"user"
        },
        {
            "username":"[email protected]",
            "type":"user"
        }
    ]
}

Sample Request

curl -X POST https://api.opsgenie.com/v2/alerts
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "message": "An example alert message",
    "alias": "Life is too short for no alias",
    "description":"Every alert needs a description",
    "responders":[
        {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c", "type":"team"},
        {"name":"NOC", "type":"team"},
        {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8", "type":"user"},
        {"username":"[email protected]", "type":"user"},
        {"id":"aee8a0de-c80f-4515-a232-501c0bc9d715", "type":"escalation"},
        {"name":"Nightwatch Escalation", "type":"escalation"},
        {"id":"80564037-1984-4f38-b98e-8a1f662df552", "type":"schedule"},
        {"name":"First Responders Schedule", "type":"schedule"}
    ],
    "visibleTo":[
        {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
        {"name":"rocket_team","type":"team"},
        {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8","type":"user"},
        {"username":"[email protected]","type":"user"}
    ],
    "actions": ["Restart", "AnExampleAction"],
    "tags": ["OverwriteQuietHours","Critical"],
    "details":{"key1":"value1","key2":"value2"},
    "entity":"An example entity",
    "priority":"P1"
}'

Sample Response

📘

Create alert requests are processed asynchronously, therefore valid requests are responded with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.302,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Delete Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescriptionLimit
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are AlertID and tinyID.
falseDisplay name of the request owner.100 characters.
sourcefalseDisplay name of the request source.100 characters.

Sample Request

curl -X DELETE 'https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7?identifierType=id'
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"

Sample Response

📘

Delete alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.204,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Get Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

Sample Requests

curl -X GET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7?identifierType=id'
curl -X GET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/1905?identifierType=tiny'
curl -X GET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias?identifierType=alias'

Sample Response

{
    "data": {
        "id": "70413a06-38d6-4c85-92b8-5ebc900d42e2",
        "tinyId": "1791",
        "alias": "event_573",
        "message": "Our servers are in danger",
        "status": "closed",
        "acknowledged": false,
        "isSeen": true,
        "tags": [
            "OverwriteQuietHours",
            "Critical"
        ],
        "snoozed": true,
        "snoozedUntil": "2017-04-03T20:32:35.143Z",
        "count": 79,
        "lastOccurredAt": "2017-04-03T20:05:50.894Z",
        "createdAt": "2017-03-21T20:32:52.353Z",
        "updatedAt": "2017-04-03T20:32:57.301Z",
        "source": "Isengard",
        "owner": "[email protected]",
        "priority": "P5",
        "responders":[
          {
              "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c",
              "type":"team"
          },
          {
              "id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8",
              "type":"user"
          },
          {
              "id":"aee8a0de-c80f-4515-a232-501c0bc9d715",
              "type":"escalation"
          },
          {
              "id":"80564037-1984-4f38-b98e-8a1f662df552",
              "type":"schedule"
          }
            ],
        "integration": {
            "id": "4513b7ea-3b91-438f-b7e4-e3e54af9147c",
            "name": "Nebuchadnezzar",
            "type": "API"
        },
        "report": {
            "ackTime": 15702,
            "closeTime": 60503,
            "acknowledgedBy": "[email protected]",
            "closedBy": "[email protected]"
        },
        "actions": ["Restart", "Ping"],
        "entity": "EC2",
        "description": "Example description",
        "details": {
            "serverName": "Zion",
            "region": "Oregon"
        }
    },
    "requestId": "9ae63dd7-ed00-4c81-86f0-c4ffd33142c9"
}

List Alerts

Query Parameters

Provide either a query or searchIdentifier parameter to apply any filter. If both parameters are given, query parameter is used. If none of the parameters are given, no filtering is applied.

Field NameMandatoryValue Definition
queryfalseSearch query to apply while filtering the alerts. You can refer Alerts Search Query Help for further information about search queries.
searchIdentifierfalseIdentifier of the saved search query to apply while filtering the alerts.
searchIdentifierTypefalseIdentifier type of the saved search query. Possible values are id and name. Default value is id. If searchIdentifier is not provided, this value is ignored.
offsetfalseStart index of the result set (to apply pagination). Minimum value (and also default value) is 0.
limitfalseMaximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100.
sortfalseName of the field that result set will be sorted by. Default value is createdAt. Possible values are specified below:
createdAt
updatedAt
tinyId
alias
message
status
acknowledged
isSeen
snoozed
snoozedUntil
count
lastOccurredAt
source
owner
integration.name
integration.type
report.ackTime
report.closeTime
report.acknowledgedBy
report.closedBy
orderfalseSorting order of the result set. Possible values are desc and asc. Default value is desc.
desc: Sort result set in descending order
asc: Sort result set in ascending order

Sample Requests

curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=7&limit=10&sort=createdAt&order=desc'
curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts?searchIdentifier=70413a06-38d6-4c85-92b8-5ebc900d42e2&searchIdentifierType=id&&limit=10&sort=createdAt&order=desc'
curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts?searchIdentifier=openAlerts&searchIdentifierType=name&limit=10&sort=createdAt&order=desc'

Sample Response

📘

If pageField and sort parameters are different, URL of the next page is be provided.

{
    "data": [
        {
            "id": "70413a06-38d6-4c85-92b8-5ebc900d42e2",
            "tinyId": "1791",
            "alias": "event_573",
            "message": "Our servers are in danger",
            "status": "closed",
            "acknowledged": false,
            "isSeen": true,
            "tags": [
                "OverwriteQuietHours",
                "Critical"
            ],
            "snoozed": true,
            "snoozedUntil": "2017-04-03T20:32:35.143Z",
            "count": 79,
            "lastOccurredAt": "2017-04-03T20:05:50.894Z",
            "createdAt": "2017-03-21T20:32:52.353Z",
            "updatedAt": "2017-04-03T20:32:57.301Z",
            "source": "Isengard",
            "owner": "[email protected]",
            "priority": "P4",
            "responders":[
              {
                  "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c",
                  "type":"team"
              },
              {
                  "id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8",
                  "type":"user"
              },
              {
                  "id":"aee8a0de-c80f-4515-a232-501c0bc9d715",
                  "type":"escalation"
              },
              {
                  "id":"80564037-1984-4f38-b98e-8a1f662df552",
                  "type":"schedule"
              }
            ],
            "integration": {
                "id": "4513b7ea-3b91-438f-b7e4-e3e54af9147c",
                "name": "Nebuchadnezzar",
                "type": "API"
            },
            "report": {
                "ackTime": 15702,
                "closeTime": 60503,
                "acknowledgedBy": "[email protected]",
                "closedBy": "[email protected]"
            }
        },
        {
            "id": "70413a06-38d6-4c85-92b8-5ebc900d42e2",
            "tinyId": "1791",
            "alias": "event_573",
            "message": "Sample Message",
            "status": "open",
            "acknowledged": false,
            "isSeen": false,
            "tags": [
                "RandomTag"
            ],
            "snoozed": false,
            "count": 1,
            "lastOccurredAt": "2017-03-21T20:32:52.353Z",
            "createdAt": "2017-03-21T20:32:52.353Z",
            "updatedAt": "2017-04-03T20:32:57.301Z",
            "source": "Zion",
            "owner": "",
            "priority": "P5",
            "responders":[],
            "integration": {
                "id": "4513b7ea-3b91-b7e4-438f-e3e54af9147c",
                "name": "My_Lovely_Amazon",
                "type": "CloudWatch"
            }
        }

    ],
    "paging":{
        "next":"https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=20&limit=10&sort=createdAt&order=desc",
        "first":"https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=0&limit=10&sort=createdAt&order=desc",
        "last":"https://api.opsgenie.com/v2/alerts?query=status%3Aopen&offset=100&limit=10&sort=createdAt&order=desc"
    },
    "took": 0.605,
    "requestId": "9ae63dd7-ed00-4c81-86f0-c4ffd33142c9"
}

Count Alerts

Count alerts request is used to count alerts in Opsgenie. It takes the following parameters

Query Parameters

Provide either a query or searchIdentifier parameter to apply any filter. If both parameters are given, query parameter is used. If none of the parameters are given, no filtering is applied.

Field NameMandatoryValue Definition
queryfalseSearch query to apply while filtering the alerts. You can refer Alerts Search Query Help for further information about search queries.
searchIdentifierfalseIdentifier of the saved search query to apply while filtering the alerts.
searchIdentifierTypefalseIdentifier type of the saved search query. Possible values are id and name. Default value is id. If searchIdentifier is not provided, this value is ignored.

Sample Requests

curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/count?query=status%3Aopen'
curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/count?searchIdentifier=70413a06-38d6-4c85-92b8-5ebc900d42e2&searchIdentifierType=id'
curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/count?searchIdentifier=openAlerts&searchIdentifierType=name'

Sample Response

{
    "data": {
        "count": 7
    },
    "took": 0.051,
    "requestId": "9ae63dd7-ed00-4c81-86f0-c4ffd33142c9"
}

Acknowledge Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny, and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/acknowledge?identifierType=id
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/acknowledge?identifierType=tiny
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/acknowledge?identifierType=alias
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Acknowledge alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.302,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Close Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/close?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/close?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/close?identifierType=alias
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Close alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.107,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Add Note to Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notetrueAlert note to add25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/notes?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/notes?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/notes?identifierType=alias
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Add note requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.213,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Execute Custom Action

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert
actionName of the action to execute

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAlert note to add25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/actions/restart?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/actions/restart?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/actions/restart?identifierType=alias
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Custom action requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.304,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Unacknowledge Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/unacknowledge?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/unacknowledge?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/unacknowledge?identifierType=alias
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Unacknowledge alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.202,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Snooze Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
endTimetrueDate and time that snooze will lose effect. Provided value should be in ISO 8061 format.
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/snooze?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "endTime":"2017-04-03T20:05:50.894Z",
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/snooze?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "endTime":"2017-04-03T20:05:50.894Z",
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/snooze?identifierType=alias
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "endTime":"2017-04-03T20:05:50.894Z",
    "user":"Monitoring Script"
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Snooze alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.109,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Escalate Alert to Next

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
escalationtrueEscalation that the alert will be escalated. Either id or name of the escalation should be provided. You can refer below for example values.
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

escalation field examples:

{
    "escalation": {
        "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"
    }
}
{
    "escalation": {
        "name":"Operations_Escalation"
    }
}

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/escalate?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "escalation":{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"},
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/escalate?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "escalation":{"name":"Operations_Escalation"},
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/escalate?identifierType=alias
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "escalation":{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"},
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Escalate alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.456,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Assign Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, `tiny and alias. Default value is id**.

JSON Body Fields

FieldMandatoryDescriptionlimit
ownertrueUser that the alert will be assigned to. Either id or username of the user should be provided. You can refer below for example values.
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

owner field examples:

{
    "owner": {
        "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"
    }
}
{
    "owner": {
        "username":"[email protected]"
    }
}

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/escalate?identifierType=id
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "owner": { "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c" },
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/escalate?identifierType=tiny
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "owner":{ "username":"[email protected]"},
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/escalate?identifierType=alias
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "owner": { "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c" },
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Assign alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.202,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Add Team to Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
teamtrueTeam to route the alert. Either id or name of the team should be provided. You can refer below for example values.
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

team field examples:

{
    "team": {
        "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"
    }
}
{
    "team": {
        "name":"operations"
    }
}

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/teams?identifierType=id
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "team": { "id": "4513b7ea-3b91-438f-b7e4-e3e54af9147c" },
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/teams?identifierType=tiny
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "team": { "name": "operations" },
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/teams?identifierType=alias
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "team": { "id": "4513b7ea-3b91-438f-b7e4-e3e54af9147c" },
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Add team to alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.333,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Add Responder to Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

FieldMandatoryDescriptionlimit
respondertrueTeam or user that the alert will be routed to. type field is mandatory for item, where possible values are team and user. In addition to the type field id should be given. You can refer below for example values.
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

responder field examples:

{
    "responder": {
                "type":"team",
            "id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"
    }
}
{
    "responder":[
        {
            "username":"[email protected]",
            "type":"user"
        }
    ]
}

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/responders?identifierType=id
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "responder": {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Add responder to alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.333,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Add Tags to Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescription
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.

JSON Body Fields

tagstrueList of tags to add into alert. You can refer below for example values.20 x 50 characters
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

tags field examples:

{
    "tags": ["OverwriteQuietHours","Critical"]
}

Sample Requests

curl -X POST https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/tags?identifierType=id
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "tags": ["OverwriteQuietHours","Critical"],
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/tags?identifierType=tiny
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "tags": ["OverwriteQuietHours","Critical"],
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/tags?identifierType=alias
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "tags": ["OverwriteQuietHours","Critical"],
    "user":"Monitoring Script",
    "source":"AWS Lambda",
    "note":"Action executed via Alert API"
}'

Sample Response

📘

Add tags to alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.206,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Remove Tags from Alert

In-Line Parameters

Referred NameDescription
identifierIdentifier of the alert

Query Parameters

ParameterMandatoryDescriptionLimit
tagstrueComma separated list of tags to remove from alert.20 x 50 characters
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id.
userfalseDisplay name of the request owner.100 characters
sourcefalseDisplay name of the request source.100 characters
notefalseAdditional alert note to add.25000 characters

Sample Requests

curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/tags?identifierType=id&tags=OverwriteQuietHours,Critical'
curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/1905/tags?identifierType=tiny&tags=OverwriteQuietHours,Critical'
curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/tags?identifierType=alias&tags=OverwriteQuietHours,Critical'

Sample Response

📘

Remove tags from alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status 202 - Accepted.

{
    "result": "Request will be processed",
    "took": 0.195,
    "requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}

Updated about a year ago


Alert API


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.