Webhook Notification

Notification sent via a webhook URL

Webhook Notifications

A webhook notification is a way for StatusCast to trigger a script with data to help with advanced alert handling, sent via a URL when an incident is created or updated.

{
  "CurrentComponentStatus": [
    {
      "ComponentId": 456570,
      "Status": "Unavailable",
      "DateChanged": "2023-03-21T20:33:47"
    },
    {
      "ComponentId": 501142,
      "Status": "Unavailable",
      "DateChanged": "2023-03-21T20:33:47"
    }
  ],
  "PreviousComponentStatus": [
    {
      "ComponentId": 456570,
      "Status": "Unavailable",
      "DateChanged": "2023-03-21T20:33:47"
    },
    {
      "ComponentId": 501142,
      "Status": "Unavailable",
      "DateChanged": "2023-03-21T20:33:47"
    }
  ],
  "Id": 417149,
  "DateCreated": "2023-03-21T20:34:11.18",
  "IncidentType": "ServiceUnavailable",
  "Status": "InProgress",
  "Title": "The Ring is Missing",
  "StartDate": "2023-03-21T20:33:47",
  "EndDate": null,
  "ShortUrl": null,
  "ExternalId": "",
  "EstimatedDurationMinutes": null,
  "Posts": [
    {
      "Id": 896335,
      "Text": "<p>We need help finding it<br></p>",
      "Date": "2023-03-21T20:33:47",
      "IsPublished": true,
      "PostType": "Informational",
      "NewComponentStatus": "Unavailable",
      "CustomFieldList": []
    }
  ],
  "AffectedComponents": [
    {
      "ComponentId": 501142,
      "ComponentName": "The One Ring",
      "IconImageSrc": null,
      "DirectlyEffected": true
    },
    {
      "ComponentId": 456570,
      "ComponentName": "Three Rings for Elven Lords",
      "IconImageSrc": null,
      "DirectlyEffected": false
    }
  ],
  "CustomFieldList": [],
  "Groups": [
    131636,
    132052,
    132063
  ]
}

Webhook Elements List

Here is a list of the elements and arrays that are included in the webhook:

Elements

ElementDefinitionFormatExample
IdIncident identifierNumeric417149
DateCreatedDate the event was created in StatusCast(not the start date of the event)yy-mm-ddThh:mm:ss2023-03-21T20:34:11.18
IncidentTypeThe type of event that was created; Incident, Informational, or MaintenanceString"ScheduledMaintenance"
"ServiceUnavailable"
"Informational"
StatusStatus of the incident.String"InProgress"
"Closed"
"Future"
TitleThe title or subject of the incident.String"Performance Degradation Notification"
AutoGeneratedIdThe custom ID if using custom incident IDs. Null if feature is disabledNumeric
StartDateThe date the incident started.yy-mm-ddThh:mm:ss"2022-02-16T16:27:28"
EndDateThe date the incident ended. Value may be NULL if incident is ongoing.yy-mm-ddThh:mm:ss"2022-02-17T16:27:28"
ShortUrlA shortened URL pointing to the incident details page of the event in question.String
ExternalIdThe external identifier of the incident. Used by default when beacons generate incidents from outside resources.Numeric756326
EstimatedDurationMinutesThe entered value for estimated time if the event is a maintenance. Will be NULL for non-maintenance events.Numeric30
CustomFieldListList of the custom fields included in the incident. Value may be NULL if incident is ongoing or if custom field values have not been entered.Array
GroupsA list of impacted group names if subscriber has access. May be NULL if no groups are used within an event or account.Array[
131948,
132052]

Note: all these elements are included in every webhook, but not all my have data depending on the status of the incident.

CurrentComponentStatus/ PreviousComponentStatus - Array

ElementDescriptionFormatExample
ComponentIdID of the service componentNumeric456570
StatusStatus of the componentString"Unavailable"
"DegradedPerformance"
"Maintenance"
"Informational"
"Investigating"
"Monitoring"
"Identified"
DateChangedDate the component status has changedyy-mm-ddThh:mm:ss"2023-03-21T20:54:45"

Posts - Array

ElementDescriptionFormatExample
IDUpdate Post IDnumber896335
TextText of the postString"The API is degraded"
DateDate of Postyy-mm-ddThh:mm:ss"2023-03-21T20:54:45"
IsPublishedState of Postbooleantrue;false
PostTypeIncident State during PostString"Informational"
"Investigating"
"Monitoring"
"Identified"
"RootCause"
"Closed"
NewComponentStatusState of the Service ComponentString"Unavailable"
"DegradedPerformance"
"Maintenance"
"Informational"
"Investigating"
"Monitoring"
"Identified"
"Available"
CustomFieldListCustom TagsString

Affected Components - Array

ElementDescriptionFormatExample
ComponentIdID of the service componentNumeric456570
ComponentNameName of ComponentString"Test Server"
IconImageSrcURL of imageString"https://statuscastsaprdeast.blob.core.windows.net/pages/21300"
DirectlyEffectedHow the component has been affectedbooleantrue;false

Webhook Signatures

As an added method of security StatusCast can add a signatures to the header of webhook notifications. This is only available in the Settings > Integrations > Webhook feature and is not accessible to subscribers who subscribed via webhook. To enable this integration click Install on the Webhook card.

909

Enter your Webhook URL endpoint and select the Use Signature Header box. Your integration will include a Public Key and Private Key. StatusCast follows the HMAC authentication workflow by adding the following header pattern:

"X-StatusCast-Signature" Header in format "{PublicKey}:{Signature}:{Nonce}:{timestamp}"

Using SHA256 your server will need to extract the values (Public Key, Signature, Nonce and Request Time stamp) from the Authorization header to validate its authenticity.


What’s Next