DocsAPI referenceAll pages

POST /channels

Request examples and the documented response.

Back to this endpoint in the API reference

curl

Request

curl -X POST "https://api.pagehum.com/v1/channels" \
  -H "Authorization: Bearer $PAGEHUM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Ops dashboard","url":"https://ops.harbor.example/hooks/pagehum"}'

JavaScript

Request

const response = await fetch("https://api.pagehum.com/v1/channels", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PAGEHUM_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({"name":"Ops dashboard","url":"https://ops.harbor.example/hooks/pagehum"}),
});
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",
      "problem",
      "state"
    ],
    "siteIds": null,
    "enabled": true,
    "createdAt": 1790000000000,
    "lastSentAt": null,
    "lastError": null,
    "grantId": null,
    "recent": [],
    "secret": "phws_…"
  }
}