DocsAPI referenceAll pages

PATCH /channels/5a2c9e14-7f3b-4d86-a1e5-3b8d6c0f2a79

Request examples and the documented response.

Back to this endpoint in the API reference

curl

Request

curl -X PATCH "https://api.pagehum.com/v1/channels/5a2c9e14-7f3b-4d86-a1e5-3b8d6c0f2a79" \
  -H "Authorization: Bearer $PAGEHUM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"events":["down","recovered","state"],"siteIds":null}'

JavaScript

Request

const response = await fetch("https://api.pagehum.com/v1/channels/5a2c9e14-7f3b-4d86-a1e5-3b8d6c0f2a79", {
  method: "PATCH",
  headers: { Authorization: `Bearer ${process.env.PAGEHUM_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({"events":["down","recovered","state"],"siteIds":null}),
});
const { ok, data, error } = await response.json();
if (!ok) throw new Error(error);

Response

Response

{
  "ok": true,
  "data": {
    "id": "5a2c9e14-7f3b-4d86-a1e5-3b8d6c0f2a79",
    "kind": "webhook",
    "name": "Ops dashboard",
    "urlHint": "https://ops.harbor.example/…/pagehum",
    "events": [
      "down",
      "recovered",
      "state"
    ],
    "siteIds": null,
    "enabled": true,
    "createdAt": 1790000000000,
    "lastSentAt": null,
    "lastError": null,
    "grantId": null,
    "recent": []
  }
}