DocsAPI referenceAll pages

POST /sites/s_ab12cd34ef56/incidents

Request examples and the documented response.

Back to this endpoint in the API reference

curl

Request

curl -X POST "https://api.pagehum.com/v1/sites/s_ab12cd34ef56/incidents" \
  -H "Authorization: Bearer $PAGEHUM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Checkout errors for some visitors","impact":"partial","status":"investigating","message":"Some visitors see an error at checkout. We're looking into it."}'

JavaScript

Request

const response = await fetch("https://api.pagehum.com/v1/sites/s_ab12cd34ef56/incidents", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PAGEHUM_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({"title":"Checkout errors for some visitors","impact":"partial","status":"investigating","message":"Some visitors see an error at checkout. We're looking into it."}),
});
const { ok, data, error } = await response.json();
if (!ok) throw new Error(error);

Response

Response

{
  "ok": true,
  "data": {
    "id": "0b7d5e21-93c4-4f6a-8e12-5a9c7d3b1f68",
    "title": "Checkout errors for some visitors",
    "impact": "partial",
    "createdAt": 1791710700000,
    "resolvedAt": null,
    "updates": [
      {
        "id": "c41a8f02-6d3e-4b95-a7c1-9e2f5b8d4a37",
        "status": "investigating",
        "message": "Some visitors see an error at checkout. We're looking into it.",
        "at": 1791710700000
      }
    ]
  }
}