Noma

Webhooks

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.

FieldTypeRequiredDescription
namestringYesHuman-readable name.
descriptionstringNoOptional notes.
urlstringYesHTTPS URL that receives deliveries (validated for safety).
secretstringNoOptional signing secret (min length applies when set).
eventsstring[]YesOne or more allowed event names (see below).
sourcesstring[]YesOne or more of cms, api (where the change originated).
payloadbooleanNoInclude full payload in deliveries.
statusbooleanNoEnable or disable the webhook.
collection_idsnumber[]NoLimit 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,
})
ParamDescription
paginatePage size.
pagePage number.

Search documentation

Find guides and reference pages