Get Event Status

GET /event/{event_id}

Overview

The GET /events/{event_id} API can be used to determine the status of the given Event.

The Open API Spec and and example requests are available here: Get the status of an Event.

Request Parameter: event_id

This request requires one path parameter, event_id. This event_id can be obtained from the response of a Request or De-escalate API call.

Response Body

The response body contains the following keys:

  • run_id: The ID of the Run this Event belongs to
  • name: The name of the Event, such as "request" or "deescalate"
  • timestamp: The time this Event was last updated
  • status: The status of the event
  • error: This key is only included if status is error

The error key can be helpful to debug why an Event failed.

For example, given the following hook:

@hook
def on_deescalate(evt):
  return ApprovalTemplate.ignore(message="All de-escalate events will be rejected!")

A requests to POST /events/deescalate will return a 200 OK and an event_id, but the de-escalate will be ignored by the hook! If you call GET /event/{event_id}, then you will see the following response:

{
    "run_id": "2d6d3a42-a195-4522-a5ff-a0bc583e5094",
    "name": "deescalate",
    "timestamp": "2022-06-23 19:04:58.730497+00:00",
    
    // Notice that the status is error
    "status": "error",
    // The error message is set to the message returned by the hook.
    "error": "All de-escalate events will be rejected!"
}

In this case, the Event has resulted in an error because it was ignored by a hook. The Run however, will retain a status of escalated, because the Run itself is not in an errored state.


What’s Next