Servebolt API (v1)
Submit feedback
Submit feedback
  1. Sites
  • Introduction
  • Auth
    • Signup
      POST
    • Login
      POST
    • User Info
      GET
    • Heartbeat
      GET
    • Refresh Token
      POST
    • Reset Password
      POST
    • Resend SMS verification code
      POST
    • Verify your phone number
      POST
    • MFA Challenge (OTP)
      POST
  • Bolts
    • Access
      • Invite User Contact
      • List Contacts
      • Update Contact Role
      • Delete Contact
    • Databases
      • List Bolt Databases
      • Get Bolt Database
      • Create Bolt Database
      • Update Bolt Database
      • Delete Bolt Database
    • Statistics
      • Dynamic Requests Statistics
      • TTFB Statistics
      • Storage Statistics
      • Content Type Statistics
      • Cache Statistics
      • Sites Dynamic Requests Statistics
      • Sites TTFB Statistics
      • Sites Storage Statistics
    • List Bolts
    • Bolt Name Validate
    • Available CMS
    • Create Bolt
    • Get Bolt
    • Get Bolt Sites
    • Update Bolt
    • Archive Bolt
    • Available PHP Versions
    • Get Bolt Subscription
    • Bolt Usage
    • Update Bolt Quota
    • Transfer Bolt Request
    • Transfer Bolt Request Copy
  • Sites
    • Git
      • Get Git Status
      • Create Git Configuration
      • Update Git Configuration
      • Delete Git Repository
      • Deploy Git Repository
      • Regenerate Git Public Key
      • Retrieve Git Repository Branches
      • Test Git Repository Connection
    • Domains
      • List Domains
      • List Site Domains
      • Get Site Domain
      • Create Domain Validation
      • Create Site Domain
      • Delete Domain
      • Get Domain Certificates
      • Link Certificate to Domain
      • Unlink Certificate from Domain
    • Logs
      • Get Apache Access Logs
      • Get Apache Error Logs
      • Get Cron Errors
    • List Sites
      GET
    • Create Site
      POST
    • Get Site
      GET
    • Update Site
      PATCH
    • Delete Site
      DELETE
    • Purge Site Cache
      POST
    • List Site Cronjobs
      GET
    • Get Site Statistics
      GET
    • Get Environment Available Settings
      GET
    • Get Site Available PHP Versions
      GET
    • Get Site Usage
      GET
    • Get Site SSH Accesses
      GET
    • Create Site SSH Access
      POST
    • Remove Site SSH Access
      DELETE
    • List Site Databases
      GET
    • Toggle Site Dev Mode
      POST
    • Site Install Wordpress
      POST
    • Site Optimize Wordpress
      POST
  • Locations
    • List Locations
    • Check SL8 Availability
    • Available Countries
  • Databases
    • List Databases
    • Get Database
    • Create Database
    • Update Database
    • Delete Database
    • Link Database
    • Unlink Database
    • Get Slow Queries
  • Cronjobs
    • List Cronjobs
    • Create Cronjob
    • Get Cronjob
    • Update Cronjob
    • Delete Cronjob
  • SSH Keys
    • List SSH Keys
    • Add a new SSH Key
    • Get SSH Key
    • Delete SSH Key
  • Certificates
    • List Certificate Orders
    • Get Certificate Order
    • Order new Certificate
    • Store custom certificate
    • Update Auto-Renewal
    • Verify DNS challenge
    • Delete Certificate Order
  • Billing
    • Pricing Calculator
    • Get Billing Customer Info
    • Update Bolt Subscription
    • List Invoices
    • Download Invoice
  • Profile
    • Get User Profile
    • Update User Profile
    • Update Profile Picture
    • Delete Profile Picture
  1. Sites

Purge Site Cache

POST
https://api.servebolt.io/v1/environments/{id}/purge_cache

Purge an site HTTP and CloudFlare cache by prefix, host, cache tag or file path.#

It is important to note that Servebolt CDN users can only purge by Tags, or by Host. For full access to all types of purging, the website must be setup on the Accelerated Domains CDN.

Use only the correct CDN#

Servebolt CDN and Accelerated Domains use different Zones inside Cloudflare, sending requests to the wrong zone will fail. Make sure to set the Type to be 'serveboltcdn' when on Servebolt CDN.

Add uniquness to your cache tags#

To confirm uniqueness of the cache tags, make sure to use a prefix when adding them to HTTP headers on reponses, and again when requesting a purge. In the example the Environment ID has been used as a prefix. On Servebolt hosted services, the enviroment.json file can be found in the ~/ home of the SSH/FTP user on the server. In this file there is both the API bearer key and the Site ID.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params
id
string 
required
the Environement id can be found in the ~/environment.json file under the key id
Example:
1234
Header Params
Accept
string 
required
Example:
application/json
Content-Type
string 
required
Example:
application/json
Authorization
string 
required
The API token can be found in the ~/environement.json file on servebolt hosting
Example:
Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379
Body Params application/json
files
array[string]
optional
prefixes
array[string]
optional
Hosts
array[string]
optional
tags
array[string]
optional
type
string 
optional
Use "serveboltcdn" to define that you are on Servebolt CDN and not Accelerated Domains
Example
{
    "files": ["https://example.com/image.jpg", "https://example.com/article/about-caching", "https://example.com/"],
    "prefixes" : ["https://example.com/static/files/", "https://example.com/product/release/micro-site/"],
    "hosts" : ["staging.example.com", "acceptance.example.com"],
    "tags" : ["1234-home", "1234-post-archive", "1234-term-caching" , "1234-term-performance"]    
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.servebolt.io/v1/environments/1234/purge_cache' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 2f68dbbf-519d-4f01-9636-e2421b68f379' \
--header 'Content-Type: application/json' \
--data-raw '{
    "files": ["https://example.com/image.jpg", "https://example.com/article/about-caching", "https://example.com/"],
    "prefixes" : ["https://example.com/static/files/", "https://example.com/product/release/micro-site/"],
    "hosts" : ["staging.example.com", "acceptance.example.com"],
    "tags" : ["1234-home", "1234-post-archive", "1234-term-caching" , "1234-term-performance"]    
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2025-06-25 09:03:05
Previous
Delete Site
Next
List Site Cronjobs
Built with