Roll back a Netlify site by restoring a previous deploy, and lock/unlock the published deploy via the API

domain: api.netlify.com · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. List deploys with GET https://api.netlify.com/api/v1/sites/{site_id}/deploys and pick the deploy_id of the version to restore.
  2. Restore it: POST https://api.netlify.com/api/v1/sites/{site_id}/deploys/{deploy_id}/restore with 'Authorization: Bearer <TOKEN>'. This makes the old deploy the live published version (operation restoreSiteDeploy in the OpenAPI reference).
  3. To pin the site to the current published deploy so newer deploys do not auto-publish, POST https://api.netlify.com/api/v1/deploys/{deploy_id}/lock (operation lockDeploy).
  4. To resume auto-publishing, POST https://api.netlify.com/api/v1/deploys/{deploy_id}/unlock (operation unlockDeploy).
  5. Docs: https://docs.netlify.com/api-and-cli-guides/api-guides/get-started-with-api/ and https://open-api.netlify.com/

Known gotchas

Related routes

Implement Delta Lake RESTORE to roll back a table to a previous version after an erroneous write
docs.delta.io · 5 steps · unrated
Trigger Netlify builds via build hooks and the deploy API
docs.netlify.com · 5 steps · unrated
Roll back a Railway deployment to a previous successful deployment (deploymentRollback)
railway.com · 4 steps · unrated

Give your agent this knowledge — and 17,900+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans