Incident 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.

πŸ“˜

Incident API is only available to Standard and Enterprise plans.

Get Request Status

Incident creation, deletion, and action requests are processed asynchronously to provide higher availability and scalability, therefore valid requests for those endpoints are responded with HTTP status 202 - Accepted. Get Request Status endpoint is used to track the status and incident 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/v1/incidents/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 incident",
        "incidentId": "8743a1b2-11da-480e-8493-744660987bef"
    },
    "took": 0.022,
    "requestId": "ec7e1d8e-1c75-442e-a271-731070a7fa4d"
}
{
    "data": {
        "success": false,
        "action": "Resolve",
        "processedAt": "2017-05-24T14:41:18.185Z",
        "integrationId": "c9cec2cb-e782-4ebb-bc1d-1b2fa703cf03",
        "isSuccess": false,
        "status": "Incident does not exist",
        "incidentId": ""
    },
    "took": 0.019,
    "requestId": "dc194ce3-9daf-4a19-bca3-40be91218089"
}

Create Incident

JSON Body Fields

FieldMandatoryDescriptionLimit
messagetrueMessage of the incident130 characters
descriptionfalseDescription field of the incident that is generally used to provide a detailed information about the incident.15000 characters
respondersfalseTeams/users that the incident is routed to via notifications. type field is mandatory for each item, where possible values are team, user.100 teams/
100 users
tagsfalseTags of the incident.20 x 50 characters
detailsfalseMap of key-value pairs to use as custom properties of the incident.8000 characters in total
priorityfalsePriority level of the incident. Possible values are P1, P2, P3, P4 and P5. Default value is P3.
notefalseAdditional note that is added while creating the incident.25000 characters.
impactedServicesfalseServices on which incident will be created.20
statusPageEntryfalseStatus page entry fields: title is mandatory and detail is optional.
If this field is leaved blank, message and description of incident will be used for title and detail respectively.
notifyStakeholdersfalseIndicate whether stakeholders are notified or not. Default value is false.false/true

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"
        }
    ]
}

statusPageEntry field example:

{
  "title": "Houston, we have a problem!",
  "detail": "We've had a main B bus undervolt."
}

Sample Request

curl -X POST https://api.opsgenie.com/v1/incidents/create
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "message": "An example incident message",
    "description":"Every incident needs a description",
    "responders":[
        {"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c", "type":"team"},
        {"name":"NOC", "type":"team"},
        {"id":"bb4d9938-c3c2-455d-aaab-727aa701c0d8", "type":"user"}
    ],
    "tags": ["Outage","Critical"],
    "details":{
    	"key1": "value1",
      "key2": "value2"
    },
    "priority": "P1",
    "impactedServices": [
      "2e7d4c68-2ddd-11e8-b467-0ed5f89f718b", 
      "df635094-efd3-48e4-b73a-b8bdfbf1178f"
    ],
    "statusPageEntry": {
    	"title": "Houston, we have a problem!",
    	"detail": "We've had a main B bus undervolt."
    },
    "notifyStakeholders": false
}'

Sample Response

πŸ“˜

Create incident 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 Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

Sample Requests

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

Sample Response

πŸ“˜

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

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

Get Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

Sample Requests

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

Sample Response

{
    "data": {
        "id": "70413a06-38d6-4c85-92b8-5ebc900d42e2",
        "tinyId": "1791",
        "message": "Incident with API create",
        "status": "closed",
        "tags": [
            "OverwriteQuietHours",
            "Critical"
        ],
        "createdAt": "2017-03-21T20:32:52.353Z",
        "updatedAt": "2017-04-03T20:32:57.301Z",
        "priority": "P5",
        "responders": [
            {
                "type": "team",
                "id": "fc1448b7-46b2-401d-9df8-c02675958e3b"
            },
            {
                "type": "user",
                "id": "fe954a67-813e-4356-87dc-afed1eec6b66"
            }
        ],
        "impactedServices": ["a9407318-5f34-4d1e-b8fa-0268ba2f43d0"],
        "extraProperties": {
            "serverName": "Zion",
            "region": "Oregon"
        }
      	"impactStartDate": "2017-03-21T20:32:52.353Z",
        "impactDetectDate": "2017-04-03T20:32:57.301Z",
        "impactEndDate": "2017-04-10T20:32:57.301Z"
    },
    "requestId": "9ae63dd7-ed00-4c81-86f0-c4ffd33142c9"
}

Get Associated Alerts

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

Field NameMandatoryValue Definition
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.
offsetfalseStarting value of the offset property. Minimum value is 1.
directionfalseDefault Value is next.
limitfalseMaximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 25.
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 -X GET 'https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/associated-alert-ids?identifierType=id'
    -H 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889'
curl -X GET 'https://api.opsgenie.com/v1/incidents/1905/associated-alert-ids?identifierType=tiny'
    -H 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889'

Sample Response

{
   "data": [
        "40ab23d0-c960-4a26-b658-99f5584cb212-1566891206483",
        "9cb4bd9c-fa56-411f-b5bc-ab990de1a7e6-1566891197323"
    ],
    "took": 0.019,
    "requestId": "86f1d342-79d8-4072-a04c-c1d2caf89d14"
}

Get Responder Alerts

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

Field NameMandatoryValue Definition
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.
offsetfalseStarting value of the offset property. Minimum value is 1 .
directionfalseDefault value is next .
limitfalseMaximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 25.
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 -X GET 'https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/responder-alert-ids?identifierType=id'
    -H 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889'
curl -X GET 'https://api.opsgenie.com/v1/incidents//responder-alert-ids?identifierType=tiny'
    -H 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889'

Sample Response

{
    "data": [
        "b71cc3b4-093a-430d-8784-f996fe9dd713-1566891244999",
        "fc5d39e0-df7c-4031-aae1-5722e9b8173b-1566891244987"
    ],
    "took": 0.03,
    "requestId": "182733d4-4337-4479-8a4c-15fd32436b92"
}

List Incidents

Field NameMandatoryValue Definition
queryfalseSearch query to apply while filtering the incidents. You can refer Incidents Search Query Help for further information about search queries.
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 insertedAt. Possible values are specified below:
createdAt
insertedAt
updatedAt
status
priority
postmortemStatus
* postmortemPublishDueDate
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 Request

curl -XGET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v1/incidents?query=status%3Aopen&offset=7&limit=10&sort=createdAt&order=desc'

Sample Response

{
    "data": [
        {
            "id": "70413a06-38d6-4c85-92b8-5ebc900d42e2",
            "tinyId": "1791",
            "message": "Our servers are in danger",
            "status": "closed",
            "tags": [
                "OverwriteQuietHours",
                "Critical"
            ],
            "createdAt": "2017-03-21T20:32:52.353Z",
            "updatedAt": "2017-04-03T20:32:57.301Z",
            "priority": "P4",
            "responders": [
              {
                "type": "team",
                "id": "fc1448b7-46b2-401d-9df8-c02675958e3b"
              },
              {
                "type": "team",
                "id": "fe954a67-813e-4356-87dc-afed1eec6b66"
              }
            ],
            "impactedServices": [
              "df635094-efd3-48e4-b73a-b8bdfbf1178f",
              "b6868288-02c7-440b-a693-0a5cf20576f5"
            ]
        },
        {
            "id": "70413a06-38d6-4c85-92b8-5ebc900d42e2",
            "tinyId": "1791",
            "message": "Sample Message",
            "status": "open",
            "tags": [
                "RandomTag"
            ],
            "createdAt": "2017-03-21T20:32:52.353Z",
            "updatedAt": "2017-04-03T20:32:57.301Z",
            "priority": "P5",
            "responders": [
              {
                "type": "team",
                "id": "fc1448b7-46b2-401d-9df8-c02675958e3b"
              }
            ],
            "impactedServices": []
        }
    ],
    "paging":{
        "next":"https://api.opsgenie.com/v1/incidents?query=status%3Aopen&offset=20&limit=10&sort=createdAt&order=desc",
        "first":"https://api.opsgenie.com/v1/incidents?query=status%3Aopen&offset=0&limit=10&sort=createdAt&order=desc",
        "last":"https://api.opsgenie.com/v1/incidents?query=status%3Aopen&offset=100&limit=10&sort=createdAt&order=desc"
    },
    "took": 0.605,
    "requestId": "9ae63dd7-ed00-4c81-86f0-c4ffd33142c9"
}

Close Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

JSON Body Fields

FieldMandatoryDescriptionlimit
notefalseAdditional incident note to add.25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/close?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'
curl -X POST https://api.opsgenie.com/v1/incidents/1905/close?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'

Sample Response

πŸ“˜

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

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

Resolve Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

JSON Body Fields

FieldMandatoryDescriptionlimit
notefalseIncident note to add25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/resolve?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'
curl -X POST https://api.opsgenie.com/v1/incidents/1905/resolve?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'

Sample Response

πŸ“˜

Resolve incident requests are processed asynchronously, therefore valid requests are responded with HTTP status 202 - Accepted.

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

Reopen Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

JSON Body Fields

FieldMandatoryDescriptionlimit
notefalseIncident note to add25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/reopen?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'
curl -X POST https://api.opsgenie.com/v1/incidents/1905/reopen?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'

Sample Response

πŸ“˜

Reopen incident requests are processed asynchronously, therefore valid requests are responded with HTTP status 202 - Accepted.

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

Add Note to Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

JSON Body Fields

FieldMandatoryDescriptionlimit
notetrueIncident note to add25000 characters

Sample Requests

curl -X POST https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/notes?identifierType=id
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'
curl -X POST https://api.opsgenie.com/v1/incidents/1905/notes?identifierType=tiny
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -H "Content-Type: application/json"
    -d
'{
    "note":"Action executed via Incident API"
}'

Sample Response

πŸ“˜

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

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

Add Responder to Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

JSON Body Fields

FieldMandatoryDescriptionlimit
respondertrueTeams and users that the incident will be routed.type field is mandatory for each item, where possible values are team and user.
notefalseAdditional incident note to add.25000 characters

responder field examples:

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

Sample Request

curl -X POST https://api.opsgenie.com/v1/incidents/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"},
    "note":"Action executed via Incident API"
}'

Sample Response

πŸ“˜

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

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

Add Tags to Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

JSON Body Fields

tagstrueList of tags to add into incident. You can refer below for example values.20 x 50 characters
notefalseAdditional incident note to add.25000 characters

tags field examples:

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

Sample Requests

curl -X POST https://api.opsgenie.com/v1/incidents/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"],
    "note":"Action executed via Incident API"
}'
curl -X POST https://api.opsgenie.com/v1/incidents/1905/tags?identifierType=tiny
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "tags": ["OverwriteQuietHours","Critical"],
    "note":"Action executed via Incident API"
}'

Sample Response

πŸ“˜

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

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

Remove Tags from Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

ParameterMandatoryDescriptionLimit
tagstrueComma separated list of tags to remove from incident.20 x 50 characters
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.
notefalseAdditional incident note to add.25000 characters

Sample Requests

curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v1/incidents/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/v1/incidents/1905/tags?identifierType=tiny&tags=OverwriteQuietHours,Critical'

Sample Response

πŸ“˜

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

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

Add Details(Custom Properties) to Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

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

JSON Body Fields

FieldMandatoryDescriptionlimit
detailstrueKey-value pairs to add as custom property into incident. You can refer below for example values.8000 characters in
total
notefalseAdditional incident note to add.25000 characters

details field examples:

{
    "details": {
        "serverName": "Zion",
        "region": "Oregon"
    }
}

Sample Requests

curl -X POST https://api.opsgenie.com/v1/incident/8418d193-2dab-4490-b331-8c02cdd196b7/details?identifierType=id
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "details": {
        "serverName": "Zion",
        "region": "Oregon"
    },
    "note":"Action executed via Incident API"
}'
curl -X POST  https://api.opsgenie.com/v1/incident/1905/details?identifierType=tiny
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "details": {
        "serverName": "Zion",
        "region": "Oregon"
    },
    "note":"Action executed via Incident API"
}'

Sample Response

πŸ“˜

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

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

Remove Details(Custom Properties) from Incident

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

ParameterMandatoryDescriptionLimit
keystrueComma separated list of keys to remove from the custom properties of the incident.10 keys
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.
notefalseAdditional incident note to add.25000 characters

Sample Requests

curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v1/incident/8418d193-2dab-4490-b331-8c02cdd196b7/details?identifierType=id&keys=serverName,region'
curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v1/incident/1905/details?identifierType=tiny&keys=serverName,region'

Sample Response

πŸ“˜

Remove details from incident requests are processed asynchronously, therefore valid requests are responded with HTTP status 202 - Accepted.

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

Update Incident Priority

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

Field NameMandatoryValue Definition
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.

JSON Body Fields

FieldMandotaryDescription
prioritytruePriority of the incident. Possible values are P1, P2, P3, P4 and P5

Sample Requests

curl -X PUT  https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/priority
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "priority":"P4"
}'
curl -X PUT  https://api.opsgenie.com/v1/incidents/1207/priority?identifierType=tiny
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "priority":"P2"
}'

Sample Response

πŸ“˜

Update incident priority requests are processed asynchronously, therefore valid requests are responded with HTTP status 202 - Accepted.

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

Update Incident Message

In-Line Parameters

Referred NameDescription
identifieridentifier of the incident

Query Parameters

Field NameMandatoryValue Definition
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.

JSON Body Fields

FieldMandatoryDescription
messagetrueMessage of the incident.

Sample Request

curl -X PUT  https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/message
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "message":"new message"
}'

Sample Response

πŸ“˜

Update incident message requests are processed asynchronously, therefore valid requests are responded with HTTP status 202 - Accepted.

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

Update Incident Description

In-Line Parameters

Referred NameDescription
identifieridentifier of the incident

Query Parameters

Field NameMandatoryValue Definition
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny . Default value is id.

JSON Body Fields

FieldMandatoryDescription
descriptionfalseDescription of the incident.

Sample Requests

curl -X PUT  https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/description
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "description":"new description"
}'
curl -X PUT  https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/description
    -H "Content-Type: application/json"
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
    -d
'{
    "description":""
}'

Sample Response

πŸ“˜

Update incident description requests are processed asynchronously, therefore valid requests are responded with HTTP status 202 - Accepted.

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

List Incident Logs

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

Field NameMandatoryValue Definition
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.
offsetfalseStarting value of the offset property. Minimum value is 1.
directionfalseDefault value is next.
limitfalseMaximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100.
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 -X GET 'https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/logs?identifierType=id&offset=1492000072838_1492000072838234593&direction=prev&limit=2&order=desc'
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
curl -X GET 'https://api.opsgenie.com/v1/incidents/1905/logs?identifierType=tiny&offset=1492000072838_1492000072838234593&direction=prev&limit=2&order=desc'
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"

Sample Response

{
    "data": [
    {
      "log": "Incident resolved via web",
      "type": "system",
      "owner": "[email protected]",
      "createdAt": "2017-04-12T12:27:52.838Z",
      "offset": "1492000072838_1492000072838234593"
    },
    {
      "log": "Viewed on [web]",
      "type": "incidentRecipient",
      "owner": "[email protected]",
      "createdAt": "2017-04-12T12:27:46.379Z",
      "offset": "1492000066378_1492000066379000127"
    }
    ],
    "requestId": "174abe1b-e2a8-48d6-a747-05f012760988",
    "took": 0.456,
    "paging": {
        "next": "https://api.opsgenie.com/v1/incidents/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/logs?identifierType=id&offset=1492000072838_1492000072838234593&direction=next&limit=2&order=desc",
        "first": "https://api.opsgenie.com/v1/incidents/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/logs?identifierType=id&limit=2&order=desc"
    }
}

List Incident Notes

In-Line Parameters

Referred NameDescription
identifierIdentifier of the incident

Query Parameters

Field NameMandatoryValue Definition
identifierTypefalseType of the identifier that is provided as an in-line parameter. Possible values are id and tiny. Default value is id.
offsetfalseStarting value of the offset property. Minimum value is 1.
directionfalseDefault value is next.
limitfalseMaximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100.
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 -X GET 'https://api.opsgenie.com/v1/incidents/8418d193-2dab-4490-b331-8c02cdd196b7/notes?identifierType=id&offset=1492004181874000155&direction=prev&limit=2&order=desc'
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
curl -X GET 'https://api.opsgenie.com/v1/incidents/1905/notes?identifierType=tiny&offset=1492004181874000155&direction=prev&limit=2&order=desc'
    -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"

Sample Response

{
    "data": [
        {
            "note": "This is your last chance. After this, there is no turning back. You take the blue pillβ€”the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pillβ€”you stay in Wonderland and I show you how deep the rabbit-hole goes.",
            "owner": "[email protected]",
            "createdAt": "2017-04-12T13:36:21.874Z",
            "offset": "1492004181874000155"
        },
        {
            "note": "You see there is only one constant. One universal. It is the only real truth: Causality. Action, reaction. Cause and effect.",
            "owner": "[email protected]",
            "createdAt": "2017-04-12T13:36:18.098Z",
            "offset": "1492004178098000065"
        }
    ],
    "requestId": "fbbd807d-6024-4572-8d51-bd4a047617d0",
    "took": 0.278,
    "paging": {
        "next": "https://api.opsgenie.com/v1/incidents/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/notes?identifierType=id&offset=1492004181874000155&direction=next&limit=2&order=desc",
        "first": "https://api.opsgenie.com/v1/incidents/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/notes?identifierType=id&limit=2&order=desc"
    }
}