Purge Cache
curl --request POST \
--url https://api.vertracloud.app/v1/apps/{id}/network/purge-cache \
--header 'Content-Type: application/json' \
--data '
{
"hostnames": [
{}
],
"paths": [
{}
]
}
'import requests
url = "https://api.vertracloud.app/v1/apps/{id}/network/purge-cache"
payload = {
"hostnames": [{}],
"paths": [{}]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({hostnames: [{}], paths: [{}]})
};
fetch('https://api.vertracloud.app/v1/apps/{id}/network/purge-cache', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/apps/{id}/network/purge-cache",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'hostnames' => [
[
]
],
'paths' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/apps/{id}/network/purge-cache"
payload := strings.NewReader("{\n \"hostnames\": [\n {}\n ],\n \"paths\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/apps/{id}/network/purge-cache")
.header("Content-Type", "application/json")
.body("{\n \"hostnames\": [\n {}\n ],\n \"paths\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/apps/{id}/network/purge-cache")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"hostnames\": [\n {}\n ],\n \"paths\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": null
}
Network
Purge Cache
Purges the cache for an application’s subdomain or custom domain, optionally for specific paths.
POST
/
v1
/
apps
/
{id}
/
network
/
purge-cache
Purge Cache
curl --request POST \
--url https://api.vertracloud.app/v1/apps/{id}/network/purge-cache \
--header 'Content-Type: application/json' \
--data '
{
"hostnames": [
{}
],
"paths": [
{}
]
}
'import requests
url = "https://api.vertracloud.app/v1/apps/{id}/network/purge-cache"
payload = {
"hostnames": [{}],
"paths": [{}]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({hostnames: [{}], paths: [{}]})
};
fetch('https://api.vertracloud.app/v1/apps/{id}/network/purge-cache', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.vertracloud.app/v1/apps/{id}/network/purge-cache",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'hostnames' => [
[
]
],
'paths' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/apps/{id}/network/purge-cache"
payload := strings.NewReader("{\n \"hostnames\": [\n {}\n ],\n \"paths\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.vertracloud.app/v1/apps/{id}/network/purge-cache")
.header("Content-Type", "application/json")
.body("{\n \"hostnames\": [\n {}\n ],\n \"paths\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/apps/{id}/network/purge-cache")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"hostnames\": [\n {}\n ],\n \"paths\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"response": null
}
string
required
The ID of the application to purge the cache for.
array
The hostnames to purge. Optional — omit it (an empty body is fine) and every hostname the
application owns is purged, which is what a plain “purge this app’s cache” wants. When you do send
it, each entry must be one of the application’s own hostnames: its
subdomain, already a full
host (myapp.vertraweb.app — do not append the zone again), or its attached custom domain.
Anything else is rejected with INVALID_HOSTNAME_FOR_APP.array
An optional array of full URLs to purge (e.g.,
["https://example.com/path1", "https://example.com/path2"]).
URLs whose host is not among the hostnames being purged are dropped; if nothing is left the
request fails with NO_AUTHORIZED_PATHS. If omitted, everything under each hostname is purged.Response
A success returns200 with { "response": null }.
{
"response": null
}
Error Responses
string
The error code indicating the reason for failure. Possible values:
VALIDATION_ERROR: The path parameter or the body failed validation (400). The response also carriesmessageandpath.UNAUTHORIZED: The request is not authenticated (401).USER_NOT_FOUND: The authenticated user could not be resolved (401).ACCESS_DENIED: The user does not have permission to act on the application (403).INVALID_HOSTNAME_FOR_APP: One of thehostnamesdoes not belong to the application (403).APP_NOT_FOUND: The specified application does not exist (404).APP_NOT_PUBLISHED: The application has no subdomain and no custom domain, so it has no edge cache to purge (400).NO_AUTHORIZED_PATHS: None of the providedpathsbelong to the given hostnames (400).INTERNAL_SERVER_ERROR: The CDN rejected the purge (500).INTERNAL_SERVER_ERROR: Unexpected failure (500).
string
A descriptive message providing additional details about the error.
{
"code": "UNAUTHORIZED"
}
{
"code": "INVALID_HOSTNAME_FOR_APP"
}
{
"code": "INTERNAL_SERVER_ERROR"
}
This route has its own budget of 10 requests per minute. See Rate Limiting.