Skip to main content
Contents

Purge

Remove cached content from every edge location, by path or all at once. Purges run asynchronously.

Examples marked as generated are built from the schema with synthetic values.

GET/api/v2/sites/{site_id}/purge-requests

List purge requests

Returns the purge history of a site, one page at a time.

Authentication
API token or portal session
Required permission
sites.read

Parameters

Parameters listPurgeRequests
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$
limitQueryintegerNo
  • Minimum 1
  • Maximum 200
  • Default: 50
cursorQuerystringNo
  • At most 512 characters

Responses

  • 200OKapplication/json

    Fields (15)
    Responses listPurgeRequests 200
    FieldTypeRequiredRules
    dataarray<object>Yes
    data[].idstringYes
    data[].kindstringYes
    • One of: all, url
    data[].pathsarray<string>Yes
    data[].statusstringYes
    • One of: queued, in_progress, completed, partial, failed, cancelled
    data[].popsobjectYes
    data[].pops.totalintegerYes
    data[].pops.doneintegerYes
    data[].pops.failedintegerYes
    data[].created_atstringYes
    • Format: date-time
    data[].started_atstringYes
    • Format: date-time
    • Can be null
    data[].completed_atstringYes
    • Format: date-time
    • Can be null
    paginationobjectYes
    pagination.next_cursorstringYes
    • Can be null
    pagination.has_morebooleanYes
    Example (generated from the schema)
    {
      "data": [
        {
          "id": "id_example",
          "kind": "all",
          "paths": [
            "string"
          ],
          "status": "queued",
          "pops": {
            "total": 1,
            "done": 1,
            "failed": 1
          },
          "created_at": "2026-01-15T10:00:00Z",
          "started_at": "2026-01-15T10:00:00Z",
          "completed_at": "2026-01-15T10:00:00Z"
        }
      ],
      "pagination": {
        "next_cursor": "string",
        "has_more": false
      }
    }
  • 401Unauthorizedapplication/problem+json

    Headers: WWW-Authenticate

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/unauthenticated",
      "title": "Authentication required",
      "status": 401,
      "code": "unauthenticated",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
  • 404Not foundapplication/problem+json

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/not_found",
      "title": "Not found",
      "status": 404,
      "code": "not_found",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
curl
curl 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/purge-requests' \
  -H "Authorization: Bearer $CDNIFY_API_TOKEN"
POST/api/v2/sites/{site_id}/purge-requests

Purge cached content

Removes content from every edge location: everything (kind all) or a list of up to 500 paths (kind url). The purge runs asynchronously: the answer is 202 with a purge request you can follow.

Authentication
API token or portal session
Required permission
cache.purge

Parameters

Parameters createPurgeRequest
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$
Idempotency-KeyHeaderstringNo
  • At most 255 characters

Request body

Content types: application/json

Request body createPurgeRequest
FieldTypeRequiredRules
kindstringYes
  • One of: all, url
pathsarray<string>No
  • At most 500 items
Example (generated from the schema)
{
  "kind": "all",
  "paths": [
    "/"
  ]
}

Responses

  • 202Acceptedapplication/json

    Headers: Location

    Fields (11)
    Responses createPurgeRequest 202
    FieldTypeRequiredRules
    idstringYes
    kindstringYes
    • One of: all, url
    pathsarray<string>Yes
    statusstringYes
    • One of: queued, in_progress, completed, partial, failed, cancelled
    popsobjectYes
    pops.totalintegerYes
    pops.doneintegerYes
    pops.failedintegerYes
    created_atstringYes
    • Format: date-time
    started_atstringYes
    • Format: date-time
    • Can be null
    completed_atstringYes
    • Format: date-time
    • Can be null
    Example (generated from the schema)
    {
      "id": "id_example",
      "kind": "all",
      "paths": [
        "string"
      ],
      "status": "queued",
      "pops": {
        "total": 1,
        "done": 1,
        "failed": 1
      },
      "created_at": "2026-01-15T10:00:00Z",
      "started_at": "2026-01-15T10:00:00Z",
      "completed_at": "2026-01-15T10:00:00Z"
    }
  • 401Unauthorizedapplication/problem+json

    Headers: WWW-Authenticate

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/unauthenticated",
      "title": "Authentication required",
      "status": 401,
      "code": "unauthenticated",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
  • 403Forbiddenapplication/problem+json

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/insufficient_scope",
      "title": "Insufficient permissions",
      "status": 403,
      "code": "insufficient_scope",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
  • 404Not foundapplication/problem+json

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/not_found",
      "title": "Not found",
      "status": 404,
      "code": "not_found",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
  • 409Conflictapplication/problem+json

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/alias_in_use",
      "title": "Site name already in use",
      "status": 409,
      "code": "alias_in_use",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
  • 422Unprocessable contentapplication/problem+json

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/validation_failed",
      "title": "Validation failed",
      "status": 422,
      "code": "validation_failed",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
curl
curl -X POST 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/purge-requests' \
  -H "Authorization: Bearer $CDNIFY_API_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"kind":"all","paths":["/"]}'
GET/api/v2/sites/{site_id}/purge-requests/{purge_id}

Get a purge request

Returns the status of a purge and how many edge locations have completed it.

Authentication
API token or portal session
Required permission
sites.read

Parameters

Parameters getPurgeRequest
NameInTypeRequiredRules
site_idPathstringYes
  • Pattern: ^site_([0-9a-f]{7}|[0-9a-f]{12})$
purge_idPathstringYes

Responses

  • 200OKapplication/json

    Fields (11)
    Responses getPurgeRequest 200
    FieldTypeRequiredRules
    idstringYes
    kindstringYes
    • One of: all, url
    pathsarray<string>Yes
    statusstringYes
    • One of: queued, in_progress, completed, partial, failed, cancelled
    popsobjectYes
    pops.totalintegerYes
    pops.doneintegerYes
    pops.failedintegerYes
    created_atstringYes
    • Format: date-time
    started_atstringYes
    • Format: date-time
    • Can be null
    completed_atstringYes
    • Format: date-time
    • Can be null
    Example (generated from the schema)
    {
      "id": "id_example",
      "kind": "all",
      "paths": [
        "string"
      ],
      "status": "queued",
      "pops": {
        "total": 1,
        "done": 1,
        "failed": 1
      },
      "created_at": "2026-01-15T10:00:00Z",
      "started_at": "2026-01-15T10:00:00Z",
      "completed_at": "2026-01-15T10:00:00Z"
    }
  • 401Unauthorizedapplication/problem+json

    Headers: WWW-Authenticate

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/unauthenticated",
      "title": "Authentication required",
      "status": 401,
      "code": "unauthenticated",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
  • 404Not foundapplication/problem+json

    Error codes:

    Problem details body
    Example
    {
      "type": "https://www.cdnify.lat/docs/errors/not_found",
      "title": "Not found",
      "status": 404,
      "code": "not_found",
      "request_id": "req_01EXAMPLE00000000000000000"
    }
curl
curl 'https://api.cdnify.lat/api/v2/sites/site_0a1b2c3/purge-requests/purge_example' \
  -H "Authorization: Bearer $CDNIFY_API_TOKEN"