Pluma
Docs index
docs/api/webhooks.md View markdown →

Webhooks

Two directions:

  • Deploy hooks (outbound): Pluma calls your host's build hook when something changes in Pluma. Sections List to Delete.
  • Inbound deploy hooks: a secret Pluma URL that another system (Ali, a cron job, a CI) calls to rebuild the site when something changes there.

Deploy hooks through the API. Needs the manage_webhooks permission (agents and management keys have it). What Pluma sends and how to verify it: Generic webhook deploy.

List

GET /api/v1/spaces/:space_id/webhooks

Create

POST /api/v1/spaces/:space_id/webhooks

curl -X POST https://pluma.so/api/v1/spaces/acton-estero/webhooks \
  -H "Authorization: Bearer $PLUMA_KEY" -H "Content-Type: application/json" \
  -d '{ "name": "Netlify", "kind": "netlify", "url": "https://api.netlify.com/build_hooks/abc123" }'
{ "webhook": { "id": "1", "name": "Netlify", "kind": "netlify", "url": "https://api.netlify.com/build_hooks/abc123",
               "target": "production", "events": ["entry.published", "entry.unpublished", "content_type.changed"], "last_delivery": null },
  "secret": "whsec_…" }
  • kind: netlify, vercel or generic. events is optional.
  • target: production (default) rebuilds the live site when something is published. preview is for a staging site: it also rebuilds on every save (entry.saved), so drafts show up there.
  • Events: entry.published, entry.unpublished, content_type.changed, asset.replaced (a file that something published uses got a new version), snippets.changed (the tracking integrations changed or site-wide code was published) and entry.saved. A production hook listens to all but entry.saved unless you say otherwise; a preview hook always includes entry.saved.
  • deploy.requested: someone asked for a rebuild without changing content (Trigger a deploy, MCP trigger_deploy). It goes to every hook of the target asked for (production, or preview for staging), whatever its events, as { "type": "deploy.requested", "at": "…", "target": "production", "deploy_id": "8830" }.
  • The secret to verify the signature is shown only once.
  • The URL must be https:// and public.

Test

POST /api/v1/spaces/:space_id/webhooks/:id/test

Sends a test hook right away and returns what the destination answered:

{ "delivery": { "id": "7", "status_code": 200, "ok": true, "response_ms": 184, "error": null, "test": true } }

A hook with a 2xx response checks off step 5 of the checklist.

Delete

DELETE /api/v1/spaces/:space_id/webhooks/:id

Inbound deploy hooks

A secret URL that rebuilds the site when something calls it, like a Netlify build hook but for Pluma. Give it to a system that sends webhooks and the site rebuilds by itself when that system's data changes: the catalog in Ali (products, prices, photos, stock), a CRM, a nightly cron job. Step by step: Rebuild your site when your Ali catalog changes.

Managing them needs the publish permission (owners, admins, editors and their agents, and management keys). In the dashboard they're under Settings → Deploy → Inbound deploy hooks (owners and admins).

Call it

POST /hooks/deploy/:token

curl -X POST "https://pluma.so/hooks/deploy/pluma_dh_7Qm3…"
{ "deploy": { "id": "8841", "state": "pending", "done": false, "live": false, "event": "deploy.requested", "target": "production",
              "hooks": [ { "id": "3", "name": "Netlify", "kind": "netlify", "target": "production", "state": "pending", "fires_at": "2026-11-10T15:04:31Z" } ], "…": "…" },
  "coalesced": false,
  "next": "Rebuild of the live site requested (nothing was published). Pluma calls Netlify within 30 s, …" }
  • No API key. The token in the URL is the credential. Anyone with the URL can start a build of that site (and nothing else): keep it like a password, and rotate it if it leaks.
  • The same deploy as Trigger a deploy (MCP trigger_deploy): the site's deploy hooks for that target get deploy.requested. Nothing is published.
  • Coalescing. Pluma waits 30 s before calling the host. Every call in those 30 s joins the same deploy (coalesced: true, same deploy.id), so 20 product edits in a row are one build. Changes published in Pluma meanwhile go out in the same build.
  • Target per URL. Each inbound hook is for one target, chosen when it's created: production (the live site, default) or staging (the site's preview deploy hooks). For both, create two hooks. The URL takes no parameters.
  • Answer: 202 with deploy (poll it with deploy status: GET /api/v1/spaces/:space_id/deploys/:id or get_deploy_status), also when the call joined a waiting deploy (coalesced: true). The body Pluma receives is ignored, whatever it is.
  • Unknown, revoked or rotated URL: 404 not_found, the same for all three, so the answer doesn't say whether a URL ever existed.
  • No deploy hook for that target: 422 deploy_unavailable. Add the host's build hook first (List and Create above).
  • Limit: 60 calls per minute per URL; more gives 429 rate_limited with Retry-After.
  • Ali's test event (X-Ali-Topic: webhook.ping) answers 200 { "ok": true, "ping": true } and builds nothing.
  • Only catalog.changed builds. Any other Ali topic (order.created, contact.created…) answers 200 { "ok": true, "ignored": true, "topic": "…" } and builds nothing, so a sale never triggers a build. Calls without X-Ali-Topic (a cron job, a CI) build as always.
  • The token never shows up in Pluma's logs.

Signed calls (optional). If the hook has a signing_secret, every call must carry Ali's signature, or it gets 401 invalid_signature and nothing is built:

X-Ali-Signature: t=1762787071,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd

v1 is HMAC-SHA256 of "<t>.<raw body>", hex, with the secret exactly as the sender shows it (Ali's whole whsec_… value). t must be within 5 minutes of Pluma's clock. Without a signing_secret, the header is ignored and the URL alone is enough.

List

GET /api/v1/spaces/:space_id/inbound_deploy_hooks

The active hooks. Never the full URL: only its start, in url_prefix.

{ "sys": { "type": "Array" }, "total": 1,
  "items": [ { "id": "4", "name": "Ali catalog", "target": "production", "url_prefix": "https://pluma.so/hooks/deploy/pluma_dh_7Qm3…",
               "signed": true, "created_at": "2026-11-10T14:58:02Z", "last_used_at": "2026-11-10T15:04:01Z" } ] }

Create

POST /api/v1/spaces/:space_id/inbound_deploy_hooks

curl -X POST https://pluma.so/api/v1/spaces/acton-estero/inbound_deploy_hooks \
  -H "Authorization: Bearer $PLUMA_KEY" -H "Content-Type: application/json" \
  -d '{ "name": "Ali catalog", "target": "production" }'
{ "inbound_deploy_hook": { "id": "4", "name": "Ali catalog", "target": "production", "url_prefix": "https://pluma.so/hooks/deploy/pluma_dh_7Qm3…",
                           "signed": false, "created_at": "2026-11-10T14:58:02Z", "last_used_at": null },
  "url": "https://pluma.so/hooks/deploy/pluma_dh_7Qm3vX…",
  "calls": ["Netlify"],
  "next": "Copy url now: Pluma shows it only once. … Each POST to it rebuilds the live site through Netlify; …" }
  • name (required): what calls it. target: production (default) or staging. signing_secret (optional): the secret the sender signs with.
  • url is shown only once. Lost it? Rotate.
  • calls: the site's deploy hooks a call fires (the target's). Empty means calls would get deploy_unavailable until you add one; next says so.
  • Answers 201. MCP: create_inbound_deploy_hook.

Update

PATCH /api/v1/spaces/:space_id/inbound_deploy_hooks/:id

Changes name or signing_secret. The usual order with Ali: create the hook, paste its URL in Ali, then set the whsec_… secret Ali shows here. An empty signing_secret removes it. The URL doesn't change. MCP: update_inbound_deploy_hook.

Rotate

POST /api/v1/spaces/:space_id/inbound_deploy_hooks/:id/rotate

A new URL, shown once, in the same shape as Create. The old URL answers 404 right away, so paste the new one in the other system. MCP: rotate_inbound_deploy_hook.

Revoke

DELETE /api/v1/spaces/:space_id/inbound_deploy_hooks/:id

Turns the hook off for good: its URL answers 404. Answers 204. MCP: revoke_inbound_deploy_hook.