Skip to main content
POST /functions/v1/purge-cache
Triggers a fresh re-render of a single page and updates the cached HTML. The re-render happens asynchronously — the endpoint returns immediately once the job is queued. This also works for new pages that aren’t cached yet — use it to pre-warm cache so the page is ready before a bot visits.
Always call this endpoint from a server-side environment (backend API, serverless function, build script, etc.). Never include your API key in client-side code — it will be visible to anyone inspecting your frontend.

Request

Headers

HeaderRequiredDescription
AuthorizationYesBearer hado_sk_your_key_here
Content-TypeYesapplication/json

Body Parameters

ParameterTypeRequiredDescription
domainstringYesThe domain to purge (e.g., "example.com"). Must be a domain you own in Hado SEO.
pathstringYesThe URL path to purge (e.g., "/about" or "/blog/my-post").

Example Request

curl -X POST https://api.hadoseo.com/functions/v1/purge-cache \
  -H "Authorization: Bearer hado_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "path": "/about"
  }'

Response

Success (200)

{
  "queued": true,
  "path": "/about",
  "message": "Re-render job queued"
}
The page will be re-rendered in the background. Fresh cached HTML is typically available within seconds.

Error Responses

StatusBodyDescription
400{ "error": "invalid_request" }Missing or invalid domain or path parameter
401{ "error": "invalid_api_key" }API key is missing, invalid, or revoked
403{ "error": "domain_not_authorized" }The API key’s owner does not have this domain in Hado SEO
429{ "error": "rate_limit_exceeded", "usage": 300, "limit": 300 }Monthly or per-minute rate limit exceeded
When you receive a 429, the usage and limit fields tell you where you stand against your monthly quota. Per-minute limits (60 req/min) reset automatically after 60 seconds.

Examples

JavaScript / Node.js

const response = await fetch("https://api.hadoseo.com/functions/v1/purge-cache", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.HADOSEO_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    domain: "yourapp.com",
    path: "/about",
  }),
});

const data = await response.json();
console.log(data); // { queued: true, path: "/about", message: "Re-render job queued" }