Purge Endpoint Cache

POST /v1/endpoints/{uuid}/cache/purge

Drop cached responses for an endpoint. Pass an empty body to purge everything; pass a path_pattern regex to purge only matching paths.

Useful when you've deployed new content and want clients to see it sooner than the cache TTL. The purge is asynchronous: the call queues it for the edges of every region, each of which drops its own cached copies, and it takes effect within seconds. The response confirms the purge was requested; it does not report a count of removed entries.

Path parameters

uuid string (uuid) Req
Endpoint UUID.

Request body

path_pattern string (regex)
Optional regex matched against the cached request path. Only entries whose path matches are purged. Max length 500 chars; invalid regex returns 400. Example: "^/api/products" drops everything under /api/products. Omit to purge the whole endpoint.

Response (200 OK)

status string
Always "queued": the purge was requested and goes to the edges of every region.
message string
"Purge requested; it takes effect within seconds in every region."

Errors

400 Bad Request
path_pattern not valid regex, or longer than 500 chars.
401 Unauthorized
Missing auth.
403 Forbidden
Endpoint doesn't exist or belongs to another user.
503 Service Unavailable
The purge could not be queued right now. Safe to retry; a purge that was queued twice is harmless.
Request — purge everything
curl -X POST "https://api.ngris.com/v1/endpoints/<uuid>/cache/purge" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json"
Request — narrow to /api/products
curl -X POST "https://api.ngris.com/v1/endpoints/<uuid>/cache/purge" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"path_pattern": "^/api/products"}'
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") result = client._post_raw( "/endpoints/<endpoint_uuid>/cache/purge", {"path_pattern": "^/api/products"}, ) print(result["status"]) # "queued"
Response — 200 OK
{ "status": "queued", "message": "Purge requested; it takes effect within seconds in every region." }
Was this helpful?
On this page
Purge Endpoint Cache
Was this helpful?