APIv2

Send events to Squadcast using version 2 of the alerts API (APIv2)

You can use the version 2 of our API integration (APIv2) to trigger and resolve incidents in Squadcast through HTTP POST.

Using APIv2 as an Alert Source

On the Sidebar, click on Services.

You can either choose to use existing service or create a new service

Now, click on the corresponding Alert Sources button.

Select APIv2 from Alert Source drop down and copy the Webhook URL shown.

  • Use the integration Webhook URL shown to send a HTTP POST request

For example:
https://api.squadcast.com/v2/incidents/api/d3c3208e86b787faf2ec01c154ed024081dc0fda

Please make sure to add a header Content-Type with the value application/json

The body of the POST request should contains the details of your incidents in the following format:

{
  "message": "This will be the incident message",
  "description": "This will be the incident description",
  "tags" : {
    "tagname1":"Tag value#1",
     "tagname2":"Tag value#2",
     "tagname3": {
       "color": "Valid HTML HEX Colour Notation goes here",
       "value":"Tag value#3"
     }
  },
  "status": "trigger",
  "event_id": "6"
}

Mandatory Fields:

The message and description fields are mandatory to create an incident. You can choose to add the other details to add more context to the incident.

Event Identification & Resolution

This section will give you an understanding of how one can associate alerts with Squadcast incidents and resolve them with an API call.

Typical Incident JSON:

{
  "message": "This will be the incident message",
  "description": "This will be the incident description",
  "status": "trigger",
  "event_id": "6"
}

This creates an incident and associates that incident with the event_id value . This event_id can be used to resolve the above created incident with an API call.

To resolve an incident, the following JSON payload should be sent.

{
  "status": "resolve",
  "event_id": "6"
}
  • The status field should be "resolve"
  • The associated event_id should also be sent along with this

Resolving an Incident with an API call

To resolve an incident, message and description fields are not required to be sent.

Add a Tag From Incident JSON

This section will give you an understanding of how you can add tags to an incidents straight from the Incident JSON using our APIv2.

Typical Incident JSON:

{
   "message":"This will be the incident message",
   "description": "This will be the incident description",
   "tags": {
     "tagname1":"Tag value#1",
     "tagname2":"Tag value#2",
     "tagname3": {
       "color": "Valid HTML HEX Colour Notation goes here",
       "value":"Tag value#3"
     }
   }
}

Example Tagging Rules

Using Tags to Set Severity:

{
  	"message": "Error rates higher than usual",
    "description": "HTTP Error rates for srv_90 is above 90 counts/hour",
    "tags": {
    	"severity": "high"
    }
}

Default colour for Tags:

If a colour code isn't explicitly mentioned, then the system takes the default colour "#808080" for the tag

Assigning Colours to Tags:

{
	"message": "Error rates higher than usual",
  "description": "HTTP Error rates for srv_90 is above 90 counts/hour",
	"severity": {
  	"colour": "#FF0000",
  	"value":"backend"
  }
}

Different ways of tagging incident:

{
	"message": "Error rates higher than usual",
  "description": "HTTP Error rates for srv_90 is above 90 counts/hour",
	"tags" : {
   	"severity": "high",
	  "impact_level": 5,
   	"classification": {
    	"color":"#FF0000",
     	"value":"backend"
     }
 	}
 }

Updated 5 days ago

APIv2


Send events to Squadcast using version 2 of the alerts API (APIv2)

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.