Cache API

Recache or purge pages when you publish changes, from your deployment, CMS or a script.

Markdown

When you change your website, cached pages keep showing the previous version until the next automatic recache. With this API you tell Jazui to render them again (or remove them) right away. Requests create a task processed in the background, whose status you can check.

Included in plans with the Cache API (Plans and limits). Use the account render token or a site token (with a site token, you can only touch that site).

Endpoints

MethodPathWhat it does
POST/v2/cache/recacheRenders the pages again. Pages that weren't cached are rendered for the first time.
POST/v2/cache/purgeRemoves the pages from the cache (the next bot triggers a new render).
GET/v2/cache/tasks/{id}Status of a task.
GET/v2/cache/tasks?limit=20Latest tasks (1 to 100). With a site token, only that site's.

Which pages

The body has exactly one of these three options:

  • urls: a list of up to 1,000 full addresses (normalized, duplicates removed).
  • prefix: every cached page that starts with that address (also the address without the trailing slash). Useful for a section: /blog/, /products/…
  • site: every cached page of a site.

With prefix and site, at most 10,000 pages are processed per task.

urls
{ "urls": ["https://misitio.com/", "https://misitio.com/precios"] }
prefix
{ "prefix": "https://misitio.com/blog/" }
site
{ "site": "misitio.com" }

Example

Terminal
curl -X POST https://api.jazui.com/v2/cache/recache \
  -H "Authorization: Bearer $JAZUI_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://misitio.com/","https://misitio.com/precios"]}'
202 Accepted
{
  "id": "01a1842d-5d0b-4d6e-9a7f-2c3b4d5e6f70",
  "action": "Recache",
  "scope": "Urls",
  "target": null,
  "state": "Queued",
  "total": 2,
  "processed": 0,
  "failed": 0,
  "createdAt": "2026-11-03T20:22:17Z",
  "startedAt": null,
  "finishedAt": null,
  "error": null,
  "statusUrl": "https://api.jazui.com/v2/cache/tasks/01a1842d-5d0b-4d6e-9a7f-2c3b4d5e6f70"
}
Terminal
curl https://api.jazui.com/v2/cache/tasks/01a1842d-5d0b-4d6e-9a7f-2c3b4d5e6f70 \
  -H "Authorization: Bearer $JAZUI_TOKEN"
JSON
{
  "id": "01a1842d-5d0b-4d6e-9a7f-2c3b4d5e6f70",
  "action": "Recache",
  "scope": "Urls",
  "state": "Done",
  "total": 2,
  "processed": 2,
  "failed": 0,
  "createdAt": "2026-11-03T20:22:17Z",
  "startedAt": "2026-11-03T20:22:18Z",
  "finishedAt": "2026-11-03T20:22:31Z",
  "error": null
}

The task

FieldDescription
actionRecache or Purge.
scope and targetUrls, Prefix or Site, with the prefix or site.
stateQueued, Running, Done or Failed (with the reason in error).
total, processed, failedTotal pages, done and failed. Progress is saved every 10 pages.
statusUrlAddress to check the task (also in the Location header).

Tasks are processed one at a time, in arrival order. Recaching uses renders from your plan like any other render; if they run out, those pages count as failed.

Errors

CodecodeReason
400invalid_requestNot exactly one option, more than 1,000 addresses, or one isn't absolute.
403planYour plan doesn't include the cache API.
403forbiddenThe domain isn't in your account (or the token's site), or the site isn't verified.
429too_many_tasksYou already have 10 queued or running tasks: wait for them to finish.

On deployment

The usual approach is to recache the whole site (or the section that changed) at the end of your deployment. Store the token as a CI secret:

GitHub Actions
# .github/workflows/deploy.yml (después de publicar la web)
- name: Recachear en Jazui
  run: |
    curl -fsS -X POST https://api.jazui.com/v2/cache/recache \
      -H "Authorization: Bearer ${{ secrets.JAZUI_TOKEN }}" \
      -H "Content-Type: application/json" \
      -d '{"site":"misitio.com"}'