How deploy hooks work
A deploy hook is just a special URL that your hosting platform gives you. When something POSTs to that URL, your platform starts a new build. theStacc stores that URL on your project and POSTs to it for you at the right moments. Here’s the full flow:- A blog is published (or updated, or unpublished) in theStacc.
- theStacc sends a POST request to your deploy hook URL.
- Your hosting platform receives the request and starts a new build.
- During the build, your site fetches the latest content from the Public Blog API.
- New static HTML pages are generated and deployed.
A build trigger, not a publishing destination
It’s worth being clear about what a deploy hook is and isn’t, because it’s easy to confuse with your publishing integration.- A publishing integration (WordPress, a custom webhook, and so on) is a destination — it’s where theStacc sends the actual blog content.
- A deploy hook is a build trigger — it carries no content. It only tells your hosting platform “something changed, please rebuild,” and your site then pulls the content itself from the Public Blog API.
Events that trigger a rebuild
theStacc fires your deploy hook when:- A blog is published.
- A published blog is updated and re-synced.
- A published blog is unpublished (removed from your site).
Setting up a deploy hook
There are two parts: get a hook URL from your hosting platform, then paste it into theStacc.Step 1: Get your deploy hook URL
#### Cloudflare Pages- Open your project in the Cloudflare dashboard.
- Go to Settings > Builds & deployments > Deploy hooks.
- Click Add deploy hook.
- Name it “theStacc” and select your production branch.
- Copy the generated URL (it looks like
https://api.cloudflare.com/client/v4/pages/webhooks/deploy_hooks/...).
- Open your project in the Vercel dashboard.
- Go to Settings > Git > Deploy Hooks.
- Create a hook named “theStacc” for your production branch.
- Copy the generated URL (it looks like
https://api.vercel.com/v1/integrations/deploy/...).
- Open your site in the Netlify dashboard.
- Go to Site configuration > Build & deploy > Build hooks.
- Click Add build hook.
- Name it “theStacc” and select your production branch.
- Copy the generated URL (it looks like
https://api.netlify.com/build_hooks/...).
Step 2: Add the URL to theStacc
- Go to Settings > Publishing > API Access in your theStacc dashboard.
- Find the Deploy Hook field.
- Paste the full URL you copied. It must start with
https://. - Click Save.
- Click Test Hook to confirm the connection. This sends a real POST to your URL and starts a test build on your hosting platform.
The Deploy Hook field is visible to project admins only, because the URL is effectively a secret that can trigger your build pipeline.
Build optimization
Each deploy hook triggers a full site rebuild, so it pays to keep builds fast:- Cache API responses. If your framework supports build caching, the Public Blog API returns standard caching headers you can take advantage of.
- Use incremental builds. Frameworks like Next.js and Astro can regenerate only new or changed pages instead of the whole site.
- Avoid unnecessary rebuilds. theStacc only fires the hook for published-content changes, never for drafts or internal edits, so your build queue stays clean by default.
Monitoring builds
After you’ve set up a hook, do one end-to-end check:- Publish a test blog in theStacc.
- Open your hosting platform’s build logs — you should see a new build start within seconds.
- Wait for the build to finish, then open your site and confirm the new blog appears.
- Load the published URL in your browser and check that the content renders correctly.
Troubleshooting
If a publish doesn’t seem to trigger a build, work through these:- Re-run Test Hook. In Settings > Publishing > API Access, click Test Hook. It reports back whether the request succeeded and the HTTP status your platform returned. A failure message tells you whether theStacc couldn’t connect, timed out, or got a non-success status.
- Check the URL. It must be a complete, public
https://URL copied directly from your hosting platform. theStacc rejects URLs that are too short, contain spaces, or point at private or internal addresses, so a partial paste won’t save. - Confirm the hook still exists on your platform. If you deleted or regenerated the hook in Cloudflare, Vercel, or Netlify, the old URL stops working — generate a new one and update it in theStacc.
- Check that automatic builds aren’t disabled on your hosting platform, and that any environment variables your build needs (such as your Public Blog API key) are set there.
Security
Your deploy hook URL is stored securely and is only ever shown to project admins — it’s never exposed in the public part of the app. The URL itself is the credential: anyone who has it can start a build, so treat it like a password. theStacc also validates the URL before saving it and again before firing it, and refuses to send requests to private or internal network addresses. If you think your URL has leaked:- Delete the hook on your hosting platform.
- Create a new one.
- Paste the new URL into Settings > Publishing > API Access and save.
Managing deploy hooks programmatically
If you’d rather configure the hook through the API instead of the dashboard, theStacc exposes these endpoints on the project. All of them require an authenticated project admin.Get the current hook
deploy_hook_url is null and has_hook is false.
Save or update the hook
https:// address. theStacc rejects it if it points at a private or internal address, is shorter than 20 characters, or contains spaces. On success it returns the saved URL with has_hook set to true.
Test the hook
success is false and message explains what went wrong.
Remove the hook
204 No Content. After this, publishing no longer triggers a rebuild until you add a hook again.
Next steps
- Review the Public Blog API reference for the endpoints your build uses to fetch content.
- Follow the Static Site Integration guide if you haven’t connected your site yet.
