Incident Timeline API
If you are using the EU instance of Opsgenie, the URL needs to be https://api.eu.opsgenie.com for requests to be successful.
General Information
Create an API Integration and obtain your apiKey to make requests listed below. Please make sure that the integration is not restricted to access configurations.
Add Incident Timeline Entry
Add incident timeline entry request is used to add new notes i.e. incident timeline entries in Opsgenie and it is a write request. Added item will have "group": "custom", "type": "CustomUserEntry" fields (see sample response). **The integration of the API key should have "Create and Update" rights otherwise request will not be accepted. For more information, you can refer to API Access Management
HTTP Method | URL |
---|---|
POST | https://api.opsgenie.com/v2/incident-timelines/:incidentId/entries |
In-Line Parameters:
Referred Name | Description |
---|---|
incidentId | Identifier of the related incident |
JSON Body Fields:
Fields | Mandatory | Description | Details |
---|---|---|---|
description | true | The description of incident timeline | type (String): for future use, not mandatory (can only get "plain_text" value) content (String): timeline entry description |
time | false | time of the incident timeline entry | will be set to "current time", if blank |
Description Fields
JSON Body Fields
Fields | Mandatory | Description |
---|---|---|
type | false | Only "plain_text" value is valid for now. |
content | true | Timeline entry description. |
Sample Request:
curl -X POST 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries'
--header 'Authorization: GenieKey eb24alp-faa2-4ba2-a551q-1alpf565c889'
--header 'Content-Type: application/json'
--data
'{
"time": "2019-01-30T16:55:00Z",
"description": {
"content":"sample incident timeline entry"
}
}'
or
curl -X POST 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries'
--header 'Authorization: GenieKey eb24alp-faa2-4ba2-a551q-1alpf565c889'
--header 'Content-Type: application/json'
--data
'{
"time": "2019-01-30T16:55:00Z",
"description": {
"type":"plain_text",
"content":"sample incident timeline entry"
}
}'
Response:
{
"data": {
"id": "4a9alp7-b5d2-4ecb-b82c-e3b5286829cf",
"group": "custom",
"type": "CustomUserEntry",
"eventTime": "2019-01-30T16:55:00Z",
"hidden": false,
"actor": {
"name": "API",
"type": "api"
}
"description": {
"name": "sample incident timeline entry",
"type": "plain_text"
}
},
"took": 0.853,
"requestId": "f9d1f3f3-4da5-4cba-b1e1-ece0alp0ebdf"
}
Get Incident Timeline Entry
Get incident timeline entry request is used to retrieve incident timeline entries in Opsgenie. It takes the following parameters:
In-Line Parameters:
Referred Name | Description |
---|---|
incidentId | Identifier of the related incident |
timelineEntryId | Identifier of the incident timeline entry |
Query Parameters:
Parameter | Mandatory | Description |
---|---|---|
contentType | false | Type of the content. Possible value and the default value is plain_text only. Will be extended later. |
Sample Request:
curl -X GET 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries/4a9alp7-b5d2-4ecb-b82c-e3b5286829cf
--header 'Authorization: GenieKey eb24alp-faa2-4ba2-a551q-1alpf565c889'
Response:
For "type": "CustomUserEntry"
{
"data": {
"id": "4a9alp7-b5d2-4ecb-b82c-e3b5286829cf",
"group": "custom",
"type": "CustomUserEntry",
"eventTime": "2019-01-30T16:55:00Z",
"hidden": false,
"actor": {
"name": "API",
"type": "api"
}
"description": {
"name": "sample incident timeline entry",
"type": "plain_text"
},
"lastEdit": {
"editTime": "2019-01-30T16:55:00Z",
"actor": {
"name": "API",
"type": "api",
}
}
},
"took": 0.853,
"requestId": "f9d1f3f3-4da5-4cba-b1e1-ece0alp0ebdf"
}
For "type": "IncidentImpactedServiceAdded"/ "IncidentStakeholderAdded"/ "IncidentImpactedServiceAdded"
{
"data": {
"id": "IncidentImpactedServiceAdded_e477790c-e156-5d08-a36d-22e0ee2d5b02",
"group": "incident",
"type": "IncidentImpactedServiceAdded",
"eventTime": "2019-01-30T16:55:00Z",
"hidden": false,
"actor": {
"name": "API",
"type": "api"
},
"title": {
"type": "plain_text",
"content": "Impacted service added"
}
},
"took": 0.24,
"requestId": "f9d1f3f3-4da5-4cba-b1e1-ece0alp0ebdf"
}
Update Incident Timeline Entry
Update incident timeline entry request is used to update incident timeline entries and it is a write request. You can only update the entries which has the value "custom" for the field "group". The integration of the API key should have "Create and Update" rights otherwise request will not be accepted. For more information, you can refer to API Access Management
In-Line Parameters:
Referred Name | Description |
---|---|
incidentId | Identifier of the related incident |
timelineEntryId | Identifier of the incident timeline entry |
JSON Body Fields:
Fields | Mandatory | Description | Limit |
---|---|---|---|
description | false One of the "description" and "time" fields are mandatory. | The description of incident timeline | type (String): for future use, not mandatory (can only get "plain_text" value) content (String): timeline entry description |
time | false One of the "description" and "time" fields are mandatory. | time of the incident timeline entry |
Sample Request:
curl -X PATCH 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries/4a9alp7-b5d2-4ecb-b82c-e3b5286829cf
--header 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1alpf565c889'
--header 'Content-Type: application/json'
--data
'{
"description": {
"content":"sample incident timeline entry updated"
}
}'
Response:
{
"data": {
"id": "4a9alp7-b5d2-4ecb-b82c-e3b5286829cf",
"group": "custom",
"type": "CustomUserEntry",
"eventTime": "2019-01-30T16:55:00Z",
"hidden": false,
"actor": {
"name": "API",
"type": "api"
}
"description": {
"name": "sample incident timeline entry updated",
"type": "plain_text"
},
"lastEdit": {
"editTime": "2019-01-30T16:55:00Z",
"actor": {
"name": "API",
"type": "api",
}
}
},
"took": 0.853,
"requestId": "f9d1f3f3-4da5-4cba-b1e1-ece0alp0ebdf"
}
Delete Incident Timeline Entry
Delete incident timeline entry request is used to delete incident timeline entries in Opsgenie and it is a write request. The integration of the API key should have "Create and Update" rights otherwise request will not be accepted. For more information, you can refer to API Access Management
In-Line Parameters:
Referred Name | Description |
---|---|
incidentId | Identifier of the incident |
timelineEntryId | Identifier of the incident timeline entry |
Sample Request:
curl -X DELETE 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries/4a9alp7-b5d2-4ecb-b82c-e3b5286829cf
--header 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1alpf565c889'
Response:
{
"result": "Deleted",
"took": 0.229,
"requestId": "0367a2e8-3b9f-4f00-acf0-alp1df5489f0"
}
List Incident Timeline Entries
List incident timeline entries request is used to list incident timeline entries in Opsgenie. It takes the following parameters:
HTTP Method | URL |
---|---|
GET | https://api.opsgenie.com/v2/incident-timelines/:incidentId/entries |
In-Line Parameters:
Referred Name | Description |
---|---|
incidentId | Identifier of the incident |
Query Parameters:
Parameter | Mandatory | Description |
---|---|---|
group | false | Returns entries with related groups. Can be given as list. Possible values are: "custom", "incident", "responderAlert", "stakeholderUpdate", "statusPage", "iccSessionLifecycle", "iccSessionDetails", "integration" |
discardHidden | false (default=false) | If true, returns only unhidden entries. |
offset | false | Offset of the previous incident timeline entry page. This will be the same with the "nextOffset" value of the previous query. |
order | false (default="desc") | Returns entries with given order according to the eventTime |
limit | false (default=20) | Item count for each page. Can be between 1 and 20. |
contentType | false (default="plain_text") | Type of the content. Possible value and the default value is plain_text only. Will be extended later. |
Sample Request:
curl -X GET 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries?limit=2&group=custom,incident'
--header 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1alpf565c889'
Response:
{
"data":
"entries": [
{
"id": "4a9alp7-b5d2-4ecb-b82c-e3b5286829cf",
"group": "custom",
"type": "CustomUserEntry",
"eventTime": "2019-01-30T16:55:00Z",
"hidden": false,
"actor": {
"name": "API",
"type": "api"
}
"description": {
"name": "sample incident timeline entry 1",
"type": "plain_text"
},
"lastEdit": {
"editTime": "2019-01-30T16:55:00Z",
"actor": {
"name": "API",
"type": "api",
}
},
{
"id": "3a9alp7-b5d2-4ecb-b82c-e3b5286829cf",
"group": "incident",
"type": "CustomUserEntry",
"eventTime": "2019-01-29T16:55:00Z",
"hidden": false,
"actor": {
"name": "API",
"type": "api"
}
"description": {
"name": "sample incident timeline entry 2",
"type": "plain_text"
},
"lastEdit": {
"editTime": "2019-01-29T16:55:00Z",
"actor": {
"name": "API",
"type": "api",
}
}
],
"nextOffset":"3a9alp7-b5d2-4ecb-b82c-e3b5286829cf"
},
"took": 0.853,
"requestId": "f9d1f3f3-4da5-4cba-b1e1-ece0alp0ebdf"
}
Hide Incident Timeline Entry
Hide incident timeline entry request is used to set a "hidden" flag on the incident timeline entry to filter incident timeline entry as hidden on web UI. The integration of the API key should have "Create and Update" rights otherwise request will not be accepted. It takes the following parameters
In-Line Parameters:
Referred Name | Description |
---|---|
incidentId | Identifier of the incident |
timelineEntryId | Identifier of the incident timeline entry |
Sample Request:
curl -X GET 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries/4a9alp7-b5d2-4ecb-b82c-e3b5286829cf/hide'
--header 'Authorization: GenieKey eb243592-falp-4ba2-a551q-1alpf565c889'
Response:
{
"result": "Hided",
"took": 0.229,
"requestId": "0367a2e8-3b9f-4f00-acf0-alp1df5489f0"
}
Unhide Incident Timeline Entry
Unhide incident timeline entry request is used to remove the "hidden" flag from the incident timeline entry which enables filtering incident timeline entry as hidden on web UI. The integration of the API key should have "Create and Update" rights otherwise request will not be accepted. It takes the following parameters
In-Line Parameters:
Referred Name | Description |
---|---|
incidentId | Identifier of the incident |
timelineEntryId | Identifier of the incident timeline entry |
Sample Request:
curl -X GET 'https://api.opsgenie.com/v2/incident-timelines/5a9alp7-b5d2-4ecb-b82c-e3b5286829cf/entries/4a9alp7-b5d2-4ecb-b82c-e3b5286829cf/unhide'
--header 'Authorization: GenieKey eb243592-faa2-4ba2-a551q-1alpf565c889'
Response:
{
"result": "Unhided",
"took": 0.229,
"requestId": "0367a2e8-3b9f-4f00-acf0-alp1df5489f0"
}
Updated about 2 years ago