Skip to content
cloudhostDocs
API reference

Next.js cache

A Next.js app's cached pages and data (ISR, the data cache) and renewing them by tag or path from outside the app.

POST/v1/projects/{project}/apps/{name}/revalidate

Revalidate a Next.js app's cached pages and data#

Renew tags and page paths of a Next.js app's cache now; every edge serves the new page on its next request. type is revalidatePath's second argument and applies to every path. Errors 400 bad_revalidate, bad_tag, bad_page, too_many, no_deploy, 404 not_found, 409 no_cache.

Credential
An API key or a dashboard session
Roles
owner, admin, developer

Parameters

  • any
  • namestringpathrequired

    the app's name in the project (any case) or its id

  • environmentstringquery

    production (default) or preview-<branch>

Request bodyapplication/json

  • tagsstring[]

    0–128 items

  • pathsstring[]

    0–128 items

  • typestring

    one of page, layout

Response

200object

  • appstring
  • environmentstring
  • revalidatedobject
  • tag_countinteger
  • atstring (date-time)

Errors

StatusDescription
400bad_revalidate, bad_tag, bad_page, too_many or no_deploy
401unauthorized: missing, invalid, expired or revoked credential
403forbidden
404not_found
409no_cache
500internal: an unexpected failure

Example

curl -X POST "https://api.ibel.ai/v1/projects/my-api/apps/my-api/revalidate" \
  -H "Authorization: Bearer $KEY" \
  -d '{"tags":["…"],"paths":["…"],"type":"page"}'