DocsAPI referenceAll pages

POST /groups

Request examples and the documented response.

Back to this endpoint in the API reference

curl

Request

curl -X POST "https://api.pagehum.com/v1/groups" \
  -H "Authorization: Bearer $PAGEHUM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Harbor Supply","contact":"client@harbor.example","color":"#c98222"}'

JavaScript

Request

const response = await fetch("https://api.pagehum.com/v1/groups", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PAGEHUM_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({"name":"Harbor Supply","contact":"client@harbor.example","color":"#c98222"}),
});
const { ok, data, error } = await response.json();
if (!ok) throw new Error(error);

Response

Response

{
  "ok": true,
  "data": {
    "id": "104375b3-5756-4288-9d2d-d9ede77f9a35"
  }
}