Overview

Send POST /v1/process to open or resolve incidents from your own scripts. SQIBS checks the payload against the service's API filters, exactly as for a monitoring tool.

You need
An incident API token and an API filter on the service
Where
Your script or tool
Result
Incidents opened and resolved by code

Request

  • URL: https://sqibs.callgoose.com/sqibs-api/v1/process, plus optional ?from=<label>. See API endpoint.
  • Auth: Authorization: Bearer <your-token>, or ?token=<your-token>.
  • Body: JSON that matches your API filter. If no filter matches, nothing is created.
curl -X POST 'https://sqibs.callgoose.com/sqibs-api/v1/process?from=my-script' \
  -H 'Authorization: Bearer <your-token>' \
  -H 'Content-Type: application/json' \
  -d '{"status": "firing", "title": "Disk full on db-01", "host": "db-01"}'

Response

{
  "id": "<api-id>",
  "resolved":  { "duplicate": false, "resolved": false },
  "triggered": { "duplicate": false, "created": true }
}
Code Meaning
201 Processed; incident(s) created (and resolved, if a resolve filter also matched).
200 Processed; incident(s) resolved.
202 Processed; no filter matched, so nothing was created or resolved.
208 Duplicate of a request received within the token's deduplication time; ignored.
401 Token not valid, or not an incident token.
500 Temporary error; try again.

Examples

Python

import requests

url = "https://sqibs.callgoose.com/sqibs-api/v1/process?from=my-script"
headers = {"Authorization": "Bearer <your-token>"}
payload = {"status": "firing", "title": "Disk full on db-01", "host": "db-01"}

r = requests.post(url, json=payload, headers=headers, timeout=30)
print(r.status_code, r.json())

Node.js

const res = await fetch("https://sqibs.callgoose.com/sqibs-api/v1/process?from=my-script", {
  method: "POST",
  headers: { "Authorization": "Bearer <your-token>", "Content-Type": "application/json" },
  body: JSON.stringify({ status: "firing", title: "Disk full on db-01", host: "db-01" }),
});
console.log(res.status, await res.json());

PowerShell

$headers = @{ Authorization = "Bearer <your-token>" }
$body = @{ status = "firing"; title = "Disk full on db-01"; host = "db-01" } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "https://sqibs.callgoose.com/sqibs-api/v1/process?from=my-script" `
  -Headers $headers -ContentType "application/json" -Body $body

Test it

The API log saves payloads only while API Tracking is on for the token. Turn it on under API Tokens before you test; it switches itself off after 48 hours.

Then send a test and look at the API log. A 202 means the filter did not match: compare the keys in the JSON key creator.