Skip to main content

updateClosedAlert

A Graze API POST request that updates the description and custom info of a closed alert during the grace period. The grace period is when an alert is closed and in the active database, before it is archived to the historic database. If a custom_info value is provided to the endpoint, it will overwrite any custom_info currently stored against the Alert.

The updateClosedAlert endpoint returns an error if the alert is open, or if it is closed and has been archived to the historic database.

Back to Graze API EndPoint Reference.

Request arguments

Endpoint updateClosedAlert takes the following request arguments:

Name

Type

Required

Description

auth_token

String

Yes

A valid auth_token returned from the authenticate request. Alternatively, basic authenticate headers can be used in place of this parameter. See the authenticate endpoint for more information and usage examples.

alert_id

Number

Yes

ID of the closed alert that you want to update.

description

String

No

New description of the alert.

custom_info

JSON Object

No

A JSON object containing the custom info values that you want to update. If the key already exists, the endpoint replaces the existing value. If the key does not exist, the endpoint adds it.

Response

Endpoint updateClosedAlert returns the following response:

API update behavior

The behavior of this endpoint depends on whether the relevant alert or Situation is open, closed and still in the active database, or closed and archived to the historic database. This endpoint updates the alert or Situation as follows:

See API Update Behavior for more information on Situation statuses.

Examples

The following examples demonstrate typical use of endpoint updateClosedAlert:

Request examples

Request example to replace description

Example cURL request to update the description for alert ID 21. The description value "new_desc" replaces the previous value.

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateClosedAlert" -H "Content-Type: application/json; charset=UTF-8" -d '{ 
"alert_id" : 21, \
"description": "new_desc" \
}'

Request example to replace description and custom info

Example cURL request to update the description and custom info for alert ID 21. The description value "new_desc" replaces the previous value. If the custom info fields field1 and field2 did not exist, the endpoint adds them. If the custom info fields field1 and field2 did previously exist, the endpoint overwrites them with the values "value1" and "value2".

curl -X POST -u graze:graze -k -v "https://localhost/graze/v1/updateClosedAlert" -H "Content-Type: application/json; charset=UTF-8" -d '{ \
"alert_id" : 21, \
"description":"new_desc", \
"custom_info": { \
    "field1": "value1", \
    "field2": "value2" \
    }
}'

Response example