Alert API (continued)
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.
Add Details (Custom Properties) to Alert
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the alert |
Query Parameters
Parameter | Mandatory | Description |
---|---|---|
identifierType | false | Type 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
Field | Mandatory | Description | Limit |
---|---|---|---|
details | true | Key-value pairs to add as custom property into alert. You can refer below for example values | 20 x 50 characters |
user | false | Display name of the request owner. | 100 characters |
source | false | Display name of the request source. | 100 characters |
note | false | Additional alert note to add. | 25000 characters |
details
field examples:
{
"details": {
"serverName": "Zion",
"region": "Oregon"
}
}
Sample Requests
curl -X POST https://api.opsgenie.com/v2/alerts/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"
},
"user":"Monitoring Script",
"source":"AWS Lambda",
"note":"Action executed via Alert API"
}'
curl -X POST https://api.opsgenie.com/v2/alerts/1905/details?identifierType=tiny
-H "Content-Type: application/json"
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
-d
'{
"details": {
"serverName": "Zion",
"region": "Oregon"
},
"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/details?identifierType=alias
-H "Content-Type: application/json"
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
-d
'{
"details": {
"serverName": "Zion",
"region": "Oregon"
},
"user":"Monitoring Script",
"source":"AWS Lambda",
"note":"Action executed via Alert API"
}'
Sample Response
Add details to alert requests are processed asynchronously, therefore valid requests are responded to with HTTP status
202 - Accepted
.
{
"result": "Request will be processed",
"took": 0.303,
"requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}
Remove Details (Custom Properties) from Alert
HTTP Method | URL |
---|---|
DELETE | https://api.opsgenie.com/v2/alerts/:identifier/details |
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the alert |
Query Parameters
Parameter | Mandatory | Description | Limit |
---|---|---|---|
keys | true | Comma separated list of keys to remove from the custom properties of the alert. | 10 keys |
identifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id. | |
user | false | Display name of the request owner. | 100 characters |
source | false | Display name of the request source. | 100 characters |
note | false | Additional 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/details?identifierType=id&keys=serverName,region'
curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/1905/details?identifierType=tiny&keys=serverName,region'
curl -X DELETE -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/details?identifierType=alias&keys=serverName,region'
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.202,
"requestId": "43a29c5c-3dbf-4fa4-9c26-f4f71023e120"
}
Update Alert Priority
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the alert |
Query Parameters
Field Name | Mandatory | Value Definition |
---|---|---|
identifierType | false | Type 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
Field | ||
---|---|---|
priority | true | Priority of the alert. Possible values are P1, P2, P3, P4 and P5 |
Sample Requests
curl -X PUT https://api.opsgenie.com/v2/alerts/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/v2/alerts/1207/priority?identifierType=tiny
-H "Content-Type: application/json"
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
-d
'{
"priority":"P2"
}'
Sample Response
Update alert priority 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"
}
Update Alert Message
HTTP Method | URL |
---|---|
POST, PUT, PATCH | https://api.opsgenie.com/v2/alerts/:identifier/message |
In-Line Parameters
Referred Name | Description |
---|---|
identifier | identifier of the alert |
Query Parameters
Field Name | Mandatory | Value Definition |
---|---|---|
identifierType | false | Type 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
Field | Mandatory | Description |
---|---|---|
message | true | Message of the alert. |
Sample Requests
curl -X PUT https://api.opsgenie.com/v2/alerts/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 alert message 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"
}
Update Alert Description
HTTP Method | URL |
---|---|
POST, PUT, PATCH | https://api.opsgenie.com/v2/alerts/:identifier/description |
In-Line Parameters
Referred Name | Description |
---|---|
identifier | identifier of the alert |
Query Parameters
Field Name | Mandatory | Value Definition |
---|---|---|
identifierType | false | Type 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
Field | Mandatory | Description |
---|---|---|
description | false | Description of the alert. |
Sample Requests
curl -X PUT https://api.opsgenie.com/v2/alerts/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/v2/alerts/8418d193-2dab-4490-b331-8c02cdd196b7/description
-H "Content-Type: application/json"
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
-d
'{
"description":""
}'
Sample Response
Update alert description 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"
}
List Alert Recipients
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the alert |
Query Parameters
Field Name | Mandatory | Value Definition |
---|---|---|
identifierType | false | Type 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/recipients?identifierType=id'
curl -X GET -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" 'https://api.opsgenie.com/v2/alerts/1905/recipients?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/recipients?identifierType=alias'
Sample Response
{
"data": [
{
"user": {
"id": "2503a523-8ba5-4158-a4bd-7850074b5cca",
"username": "[email protected]"
},
"state": "action",
"method": "Acknowledge",
"createdAt": "2017-04-12T12:27:28.52Z",
"updatedAt": "2017-04-12T12:27:52.86Z"
},
{
"user": {
"id": "0966cfd8-fc9a-4f5c-a013-7d1f9318aef8",
"username": "[email protected]"
},
"state": "notactive",
"method": "",
"createdAt": "2017-04-12T12:27:28.571Z",
"updatedAt": "2017-04-12T12:27:28.589Z"
}
],
"took": 0.306,
"requestId": "d90a7fb5-f5b6-4e1a-a1d1-0a37bded6a32"
}
List Alert Logs
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the alert |
Query Parameters
Field Name | Mandatory | Value Definition |
---|---|---|
identifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id, tiny, and alias. Default value is id. |
offset | false | Starting value of the offset property. |
direction | false | Page direction to apply for the given offset. Possible values are next and prev . Default value is next .next : Offset values of provided logs should be greater than the given offsetprev : Offset values of provided logs should be less than the given offset |
limit | false | Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 . |
order | false | Sorting order of the result set. Possible values are desc and asc . Default value is desc .desc : Sort result set in descending orderasc : Sort result set in ascending order |
Sample Requests
curl -X GET 'https://api.opsgenie.com/v2/alerts/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/v2/alerts/1905/logs?identifierType=tiny&offset=1492000072838_1492000072838234593&direction=prev&limit=2&order=desc'
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
curl -X GET 'https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/logs?identifierType=alias&offset=1492000072838_1492000072838234593&direction=prev&limit=2&order=desc'
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
Sample Response
{
"data": [
{
"log": "Alert acknowledged via web",
"type": "system",
"owner": "[email protected]",
"createdAt": "2017-04-12T12:27:52.838Z",
"offset": "1492000072838_1492000072838234593"
},
{
"log": "Viewed on [web]",
"type": "alertRecipient",
"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/v2/alerts/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/logs?identifierType=id&offset=1492000072838_1492000072838234593&direction=next&limit=2&order=desc",
"first": "https://api.opsgenie.com/v2/alerts/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/logs?identifierType=id&limit=2&order=desc"
}
}
List Alert Notes
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the alert |
Query Parameters
Field Name | Mandatory | Value Definition |
---|---|---|
identifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id. |
offset | false | Starting value of the offset property. |
direction | false | Page direction to apply for the given offset. Possible values are next and prev . Default value is next .next : Offset values of provided notes should be greater than the given offsetprev : Offset values of provided notes should be less than the given offset |
limit | false | Maximum number of items to provide in the result. Must be a positive integer value. Default value is 20 and maximum value is 100 . |
order | false | Sorting order of the result set. Possible values are desc and asc . Default value is desc .desc : Sort result set in descending orderasc : Sort result set in ascending order |
Sample Requests
curl -X GET 'https://api.opsgenie.com/v2/alerts/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/v2/alerts/1905/notes?identifierType=tiny&offset=1492004181874000155&direction=prev&limit=2&order=desc'
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
curl -X GET 'https://api.opsgenie.com/v2/alerts/life%20is%20too%20short%20for%20no%20alias/notes?identifierType=alias&offset=1492000072838234593&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/v2/alerts/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/notes?identifierType=id&offset=1492004181874000155&direction=next&limit=2&order=desc",
"first": "https://api.opsgenie.com/v2/alerts/ee624ed0-3ee0-45be-9c9d-e7667eaf21e5/notes?identifierType=id&limit=2&order=desc"
}
}
Create a Saved Search
Field | Mandatory | Description |
---|---|---|
name | true | Unique name of the saved search. Maximum length is 100 characters. |
query | true | Search query to be used while filtering the alerts. Maximum length is 1000 characters. |
owner | true | User that will be assigned as owner of the saved search. Saved searches are always accessible to their owners. |
description | false | Informational description of the saved search. Maximum length is 15000 characters. |
teams | false | Teams that saved search is assigned to. If a saved-search is assigned to at least one team, saved-search will only be accessible to the owner and members of the assigned teams. A saved-search can be assigned to at most 20 teams. |
Sample Requests
curl -X POST https://api.opsgenie.com/v2/alerts/saved-searches
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
-H "Content-Type: application/json"
-d
'{
"name": "Closed but Unacked Alerts",
"description": "Will be used to display the alerts that are closed before someone acknowledges.",
"query": "status: Open and acknowledged: false",
"teams":[
{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"},
{"name":"rocket_team"}
],
"owner": {"username":"[email protected]"}
}'
Sample Response
{
"data": {
"id": "d8b16789-3b71-48e4-9ff2-48a76a789137",
"name": "Closed but Unacked Alerts"
},
"took": 0.302,
"requestId": "613909cc-f6c5-42f7-8107-5ea17ba79451"
}
Update Saved Search
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the saved search |
Query Parameters
Parameter | Mandatory | Description |
---|---|---|
identifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id and name. Default value is id. |
JSON Body Fields
Field | Mandatory | Description |
---|---|---|
name | true | Unique name of the saved search. Maximum length is 100 characters. |
query | true | Search query to be used while filtering the alerts. Maximum length is 1000 characters. |
owner | true | User that will be assigned as owner of the saved search. Saved searches are always accessible to their owners. |
description | false | Informational description of the saved search. Maximum length is 15000 characters. |
teams | false | Teams that saved search is assigned to. If a saved-search is assigned to at least one team, saved-search will only be accessible to the owner and members of the assigned teams. A saved-search can be assigned to at most 20 teams. |
Sample Requests
curl -X PATCH https://api.opsgenie.com/v2/alerts/saved-searches/d8b16789-3b71-48e4-9ff2-48a76a789137
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
-H "Content-Type: application/json"
-d
'{
"name": "Closed but Unacked Alerts",
"description": "Will be used to display the alerts that are closed before someone acknowledges.",
"query": "status: Open and acknowledged: false",
"teams":[
{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c"},
{"name":"rocket_team"}
],
"owner":{"username":"[email protected]"}}'
Sample Response
{
"data": {
"id": "d8b16789-3b71-48e4-9ff2-48a76a789137",
"name": "Closed but Unacked Alerts"
},
"took": 0.404,
"requestId": "613909cc-f6c5-42f7-8107-5ea17ba79451"
}
Get Saved Search
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the saved search |
Query Parameters
Parameter | Mandatory | Description |
---|---|---|
identifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id and name. Default value is id. |
Sample Requests
curl -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" -X GET 'https://api.opsgenie.com/v2/alerts/saved-searches/8418d193-2dab-4490-b331-8c02cdd196b7?identifierType=id'
curl -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889" -X GET 'https://api.opsgenie.com/v2/alerts/saved-searches/team_apollo_filter?identifierType=name'
Sample Response
{
"data": {
"id": "d8b16789-3b71-48e4-9ff2-48a76a789137",
"name": "unacked alerts query",
"createdAt": "2017-04-12T13:53:02.736Z",
"updatedAt": "2017-04-12T13:53:02.736Z",
"teams": [
{ "id": "b65f29fc-9e47-4532-9659-7dff16d4ec49" }
],
"description": "Used to get alerts that are not acknowledged",
"query": "status: open AND acknowledged: false"
},
"requestId": "613909cc-f6c5-42f7-8107-5ea17ba79451"
}
Delete Saved Search
In-Line Parameters
Referred Name | Description |
---|---|
identifier | Identifier of the saved search |
Query Parameters
Parameter | Mandatory | Description |
---|---|---|
identifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id and name. Default value is id. |
Sample Requests
curl -H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
-X DELETE 'https://api.opsgenie.com/v2/alerts/saved-searches/8418d193-2dab-4490-b331-8c02cdd196b7?identifierType=id'
Sample Response
{
"result": "Deleted",
"took": 0.051,
"requestId": "ad8a6ba8-e210-467a-b6d2-f0e70c2dc293"
}
List Saved Searches
Sample Requests
curl -X GET 'https://api.opsgenie.com/v2/alerts/saved-searches'
-H "Authorization: GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889"
Sample Response
{
"data": [
{
"id": "62dca743-bddc-4d17-99ab-6d8e0c066d1c",
"name": "unacked alerts query"
},
{
"id": "3155ddd1-8d6c-438e-9cdd-28b31edca301",
"name": "team apollo alerts"
},
{
"id": "d8b16789-3b71-48e4-9ff2-48a76a789137",
"name": "Critical_Open_Alerts"
}
],
"requestId": "fbd4a99d-aa05-4549-870d-02fa3d6395e5"
}
Create Alert Attachment
In-Line Parameters
Referred Name | Description |
---|---|
alertIdentifier | Identifier of the alert |
Query Parameters
Parameter | Mandatory | Description |
---|---|---|
alertIdentifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id. |
file | true | The file that will be attached to the alert. |
user | false | Default owner of the execution. If user is not specified, the system becomes owner of the execution. |
indexFile | false | Name of html file which will be shown when attachment clicked on UI. If it is not specified, following rules will be applied by order to determine index file name 1. if it is not a zip file, it will be assigned to attachment file name 2. If it is a zip file, it will be assigned to 1. HTML file whose name equals attachment file name 2. index.htm or index.html file 3. the first HTML file found in the ZIP 4. If no HTML file exists, it will be assigned to attachment zip file name and zip file will be downloaded from Opsgenie web site directly when clicked on attachment. |
Sample Request
curl -X POST ‘https://api.opsgenie.com/v2/alerts/5/attachments?alertIdentifierType=tiny'
-H ‘authorization: GenieKey 123’
-H ‘content-type: multipart/form-data’
-F [email protected]
-F [email protected]
Sample Response
{
“result”:“Attachment [attachment.jpg] successfully added to alert [c8daa4c3951d-40ee-9711-bd332040c207].“,
”data”:{
“id”:“1503330358392000143"
},
“took”:0.5,
“requestId”:“1bccb6d4-723f-4e84-bb3d-677f2d9dbe4f”
}
Get Alert Attachment
In-Line Parameters
Referred Name | Description |
---|---|
alertIdentifier | Identifier of the alert |
attachmentId | Identifier of the attachment |
Query Parameters
Parameter | Mandatory | Description |
---|---|---|
alertIdentifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id. |
Sample Request
curl -X GET 'https://api.opsgenie.com/v2/alerts/5/attachments/1503330178663000098?alertIdentifierType=tiny'
-H 'authorization: GenieKey 123'
Sample Response
{
"data": {
"name": "attachment.jpg",
"url": "download link here"
},
"took": 0.558,
"requestId": "e4274f85-684e-4d94-9fca-e29c72c8050b"
}
List Alert Attachments
In-Line Parameters
Referred Name | Description |
---|---|
alertIdentifier | Identifier of the alert |
Query Parameters
Parameter | Mandatory | Description |
---|---|---|
alertIdentifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id. |
Sample Request
curl -X GET 'https://api.opsgenie.com/v2/alerts/5/attachments?alertIdentifierType=tiny'
-H 'authorization: GenieKey 123'
Sample Response
{
"data": [
{
"name": "attachment1.jpg",
"id": 1503330178663000098
},
{
"name": "attachment2.zip",
"id": 1503330193202000133
}
],
"took": 0.055,
"requestId": "07c4564b-5f02-4bf4-996c-493b751363e4"
}
Delete Alert Attachment
In-Line Parameters
Referred Name | Description |
---|---|
alertIdentifier | Identifier of the alert |
attachmentId | Identifier of the attachment |
Query Parameters
Referred Name | Mandatory | Description |
---|---|---|
alertIdentifierType | false | Type of the identifier that is provided as an in-line parameter. Possible values are id, tiny and alias. Default value is id. |
user | false | Default owner of the execution. If user is not specified, the system becomes owner of the execution. |
Sample Request
curl -X DELETE 'https://api.opsgenie.com/v2/alerts/5/attachments/1503330193202000133?alertIdentifierType=tiny&[email protected]'
-H 'authorization: GenieKey 123'
Sample Response
{
"result": "Deleted",
"took": 0.207,
"requestId": "a5e14c49-9006-4d2b-9062-5560e639b03f"
}
Updated almost 3 years ago