Webhooks
Webhook methods map to /api/webhooks. They require a CMS API key with the admin ability.
const noma = createClient({ projectId, apiKey })Payload shape
Create and PUT update both use the same validation (WebhookRequest in the API). Required fields must be sent on every update.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable name. |
description | string | No | Optional notes. |
url | string | Yes | HTTPS URL that receives deliveries (validated for safety). |
secret | string | No | Optional signing secret (min length applies when set). |
events | string[] | Yes | One or more allowed event names (see below). |
sources | string[] | Yes | One or more of cms, api (where the change originated). |
payload | boolean | No | Include full payload in deliveries. |
status | boolean | No | Enable or disable the webhook. |
collection_ids | number[] | No | Limit to collection database ids (integers), not slugs or UUIDs. |
Allowed events values (from the API): content.created, content.updated, content.published, content.unpublished, content.deleted, content.trashed, content.restored, and auth-related events such as auth.signup.success, auth.login.success, auth.logout.success, auth.logout_all.success, auth.email_verification.verified.
sources: only cms (dashboard) and api (Content API) are valid. Use both if you want deliveries for changes from either place.
webhooks.list
const webhooks = await noma.webhooks.list()webhooks.get
const webhook = await noma.webhooks.get(webhookUuid)webhooks.create
await noma.webhooks.create({
name: "Rebuild site",
url: "https://example.com/api/revalidate",
events: ["content.published", "content.updated"],
sources: ["cms", "api"],
})webhooks.update
PUT requires the same full body shape as create (all required keys), not a partial patch.
await noma.webhooks.update(webhookUuid, {
name: "Rebuild site (prod)",
description: "Production revalidation",
url: "https://example.com/api/revalidate",
events: ["content.published", "content.unpublished", "content.updated"],
sources: ["cms", "api"],
})webhooks.delete
await noma.webhooks.delete(webhookUuid)webhooks.logs
Fetch delivery logs for debugging.
const logs = await noma.webhooks.logs(webhookUuid, {
paginate: 20,
page: 1,
})| Param | Description |
|---|---|
paginate | Page size. |
page | Page number. |
Related
- Content API — List Webhooks — HTTP reference and delivery overview
- Error Handling — Permission and validation errors