Pluma
Docs index
docs/guides/rebuild-on-catalog-changes.md View markdown →

Rebuild your site when your Ali catalog changes

Your site is built from data that lives in Ali: products, prices, photos, stock. When that data changes, the site should rebuild by itself, with nobody pressing "deploy". An inbound deploy hook does it: a secret Pluma URL that Ali calls on every catalog change. It works the same with any system that sends webhooks (a CRM, a cron job, a CI).

Ali catalog changes ──▶ POST https://pluma.so/hooks/deploy/pluma_dh_… ──▶ Pluma waits 30 s ──▶ your host's build hook (Netlify…) ──▶ site rebuilt

Before you start

The site needs a normal deploy hook first, so Pluma has something to call: Settings → Deploy → New deploy hook with your host's build hook URL (Netlify, Vercel, any other). The inbound hook starts a build through it.

1. Create the URL in Pluma

In the dashboard: Settings → Deploy → Inbound deploy hooks, give it a name (Ali catalog), choose The live site and create it. Copy the URL: Pluma shows it only once.

Or ask your AI assistant: "Make my site rebuild automatically when something changes in my store." It calls create_inbound_deploy_hook and gives you the URL.

Or with the API: POST /api/v1/spaces/:space_id/inbound_deploy_hooks with { "name": "Ali catalog" } (reference).

2. Paste it in Ali

In Ali, open the business's webhook settings, add an endpoint with the Pluma URL, and subscribe it to Catalog changes (catalog.changed: Ali sends one per batch of changes to products, prices, photos or stock, about a minute after the last one). Use Send test event to check it: Pluma answers 200 and builds nothing for Ali's test. If the endpoint also gets other Ali events (orders, contacts), Pluma acknowledges them and builds nothing.

3. Optional: require Ali's signature

Ali shows a signing secret (whsec_…) for each endpoint. Paste it in the Pluma hook (Signing secret, or update_inbound_deploy_hook). From then on Pluma only accepts calls that carry a valid X-Ali-Signature, so a leaked URL alone isn't enough. If the secrets don't match, calls get invalid_signature and nothing builds.

What happens on a change

  • Every call starts the same deploy as Trigger a deploy: the site's deploy hooks get deploy.requested, and nothing in Pluma is published or changed.
  • Pluma waits 30 s before calling your host. Every call in that window joins the same build, so editing 20 products in a row is one build, not twenty.
  • The site's Activity shows each rebuild with the hook's name, and Settings → Deploy shows when it was last called.

Staging

Each URL rebuilds one site. For the staging site, create a second hook with The staging site; it calls your preview deploy hooks (Staging).

If the URL leaks

Rotate it (a new URL; the old one answers 404 at once) and paste the new one in Ali. Revoke turns it off for good. Both are in the dashboard, the MCP (rotate_inbound_deploy_hook, revoke_inbound_deploy_hook) and the API.