2022-06-09 10:08:07 +01:00
|
|
|
---
|
2022-10-26 12:32:47 -04:00
|
|
|
canonical: https://grafana.com/docs/oncall/latest/oncall-api-reference/postmortem_messages/
|
2022-06-09 10:08:07 +01:00
|
|
|
draft: true
|
|
|
|
|
title: Postmortem Messages HTTP API
|
|
|
|
|
weight: 900
|
|
|
|
|
---
|
2022-06-03 08:09:47 -06:00
|
|
|
|
|
|
|
|
# Create a postmortem message
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
curl "{{API_URL}}/api/v1/postmortem_messages/" \
|
|
|
|
|
--request POST \
|
|
|
|
|
--header "Authorization: meowmeowmeow" \
|
|
|
|
|
--header "Content-Type: application/json" \
|
|
|
|
|
--data '{
|
|
|
|
|
"alert_group_id": "I68T24C13IFW1",
|
|
|
|
|
"text": "Demo postmortem message"
|
|
|
|
|
}'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The above command returns JSON structured in the following way:
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2022-06-09 10:08:07 +01:00
|
|
|
"id": "M4BTQUS3PRHYQ",
|
|
|
|
|
"alert_group_id": "I68T24C13IFW1",
|
|
|
|
|
"author": "U4DNY931HHJS5",
|
|
|
|
|
"source": "web",
|
|
|
|
|
"created_at": "2020-06-19T12:40:01.429805Z",
|
|
|
|
|
"text": "Demo postmortem message"
|
2022-06-03 08:09:47 -06:00
|
|
|
}
|
2022-06-09 10:08:07 +01:00
|
|
|
```
|
2022-06-03 08:09:47 -06:00
|
|
|
|
|
|
|
|
**HTTP request**
|
|
|
|
|
|
|
|
|
|
`POST {{API_URL}}/api/v1/postmortem_messages/`
|
|
|
|
|
|
|
|
|
|
# Get a postmortem message
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
curl "{{API_URL}}/api/v1/postmortem_messages/M4BTQUS3PRHYQ/" \
|
|
|
|
|
--request GET \
|
|
|
|
|
--header "Authorization: meowmeowmeow" \
|
|
|
|
|
--header "Content-Type: application/json"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The above command returns JSON structured in the following way:
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2022-06-09 10:08:07 +01:00
|
|
|
"id": "M4BTQUS3PRHYQ",
|
|
|
|
|
"alert_group_id": "I68T24C13IFW1",
|
|
|
|
|
"author": "U4DNY931HHJS5",
|
|
|
|
|
"source": "web",
|
|
|
|
|
"created_at": "2020-06-19T12:40:01.429805Z",
|
|
|
|
|
"text": "Demo postmortem message"
|
2022-06-03 08:09:47 -06:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**HTTP request**
|
|
|
|
|
|
|
|
|
|
`GET {{API_URL}}/api/v1/postmortem_messages/<POSTMORTEM_MESSAGE_ID>/`
|
|
|
|
|
|
|
|
|
|
# List postmortem messages
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
curl "{{API_URL}}/api/v1/postmortem_messages/" \
|
|
|
|
|
--request GET \
|
|
|
|
|
--header "Authorization: meowmeowmeow" \
|
|
|
|
|
--header "Content-Type: application/json"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The above command returns JSON structured in the following way:
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2022-06-09 10:08:07 +01:00
|
|
|
"count": 1,
|
|
|
|
|
"next": null,
|
|
|
|
|
"previous": null,
|
|
|
|
|
"results": [
|
|
|
|
|
{
|
|
|
|
|
"id": "M4BTQUS3PRHYQ",
|
|
|
|
|
"alert_group_id": "I68T24C13IFW1",
|
|
|
|
|
"author": "U4DNY931HHJS5",
|
|
|
|
|
"source": "web",
|
|
|
|
|
"created_at": "2020-06-19T12:40:01.429805Z",
|
|
|
|
|
"text": "Demo postmortem message"
|
|
|
|
|
}
|
|
|
|
|
]
|
2022-06-03 08:09:47 -06:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The following available filter parameter should be provided as a `GET` argument:
|
|
|
|
|
|
2022-06-09 10:08:07 +01:00
|
|
|
- `alert_group_id`
|
2022-06-03 08:09:47 -06:00
|
|
|
|
|
|
|
|
**HTTP request**
|
|
|
|
|
|
|
|
|
|
`GET {{API_URL}}/api/v1/postmortem_messages/`
|
|
|
|
|
|
|
|
|
|
# Update a postmortem message
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
curl "{{API_URL}}/api/v1/postmortem_messages/M4BTQUS3PRHYQ/" \
|
|
|
|
|
--request PUT \
|
|
|
|
|
--header "Authorization: meowmeowmeow" \
|
|
|
|
|
--header "Content-Type: application/json" \
|
|
|
|
|
--data '{
|
|
|
|
|
"text": "Demo postmortem message"
|
|
|
|
|
}'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The above command returns JSON structured in the following way:
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
2022-06-09 10:08:07 +01:00
|
|
|
"id": "M4BTQUS3PRHYQ",
|
|
|
|
|
"alert_group_id": "I68T24C13IFW1",
|
|
|
|
|
"author": "U4DNY931HHJS5",
|
|
|
|
|
"source": "web",
|
|
|
|
|
"created_at": "2020-06-19T12:40:01.429805Z",
|
|
|
|
|
"text": "Demo postmortem message"
|
2022-06-03 08:09:47 -06:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**HTTP request**
|
|
|
|
|
|
|
|
|
|
`PUT {{API_URL}}/api/v1/postmortem_messages/<POSTMORTEM_MESSAGE_ID>/`
|
|
|
|
|
|
|
|
|
|
# Delete a postmortem message
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
|
curl "{{API_URL}}/api/v1/postmortem_messages/M4BTQUS3PRHYQ/" \
|
|
|
|
|
--request DELETE \
|
|
|
|
|
--header "Authorization: meowmeowmeow"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**HTTP request**
|
|
|
|
|
|
2022-06-09 10:08:07 +01:00
|
|
|
`DELETE {{API_URL}}/api/v1/postmortem_messages/<POSTMORTEM_MESSAGE_ID>/`
|