Deploy hooks
POST a URL to trigger a redeploy
A deploy hook is a secret URL that triggers a rebuild of your app when POSTed — no auth header, the URL itself is the credential. Wire it into a headless CMS publish button, a cron job, or a CI step so content changes redeploy the app without touching git.
What a trigger does
POST https://api.percher.run/hooks/deploy/<token> returns 202 { deployId, app } and queues a deploy:
- An app with a connected GitHub/Forgejo repo clones and rebuilds the latest commit of its tracked branch — fresh content from the CMS lands in the new build.
- An app without a connected repore-runs the latest live deploy's build from its stored source.
If a never-connected app's build tarball has been cleaned up, the trigger returns 410 TARBALL_GONE — publish once (or connect a repo) and the hook works again.
Create a hook (the URL is shown once)
bunx percher hook create sanity-publish
The command prints the hook URL exactly once — Percher stores only a hash, so it can never be shown again. Store it in your CMS/CI secret store immediately. Also available in the dashboard (your app → Settings → Deploy hooks) and over MCP (percher_hook with action: "create"). Manage hooks with percher hook list (name, id, created, last used) and percher hook revoke <id>.
CMS recipes
- Sanity — manage.sanity.io → your project → API → Webhooks: paste the hook URL, trigger on create/update/delete of published documents, HTTP method POST. No payload configuration needed — Percher ignores the request body.
- Contentful — Settings → Webhooks: paste the hook URL as a POST webhook and pick the Entry publish (and unpublish) events.
- Strapi — Settings → Webhooks: paste the hook URL with the
entry.publish/entry.unpublishevents, or call it from anafterPublishlifecycle hook. - Cron / CI —
curl -X POST <url>from any scheduler for nightly rebuilds of pages that render data at build time.
Rate limit
6 triggers per minute per hook — beyond that the endpoint returns 429. Rapid-fire CMS saves coalesce into at most a few rebuilds. Triggered deploys still count against your plan's daily deploy quota.
Treat the URL as a secret
The URL is a bearer capability: anyone holding it can trigger builds (nothing else — it can't read code, env vars, or logs). Keep it in the CMS/CI secret store, not in committed config.
- Rotate by revoking the hook and creating a fresh one — the old URL dies immediately.
- Leaks are observable:
lastUsedAtinpercher hook list(and the dashboard) shows the most recent trigger — activity you don't recognize means it's time to rotate. - Unknown tokens get a plain 404 — the endpoint doesn't confirm what exists.