Create Backup Zone
Link a CDN zone to a critical backup job so its content is automatically backed up.
curl -X POST "https://api.5centscdn.com/v2/cb/42/zone" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"_METHOD": "PUT",
"zoneid": 2102,
"meta": {
"mode": "1",
"sync": "3",
"compare": "1",
"casesync": "2",
"directory": {
"source": "/",
"sink": "",
"backup": ""
},
"filters": "",
"backup": "Y",
"backupmode": "date"
}
}'
import requests
import json
url = "https://api.5centscdn.com/v2/cb/42/zone"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"_METHOD": "PUT",
"zoneid": 2102,
"meta": {
"mode": "1",
"sync": "3",
"compare": "1",
"casesync": "2",
"directory": {
"source": "/",
"sink": "",
"backup": ""
},
"filters": "",
"backup": "Y",
"backupmode": "date"
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/cb/42/zone", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"_METHOD": "PUT",
"zoneid": 2102,
"meta": {
"mode": "1",
"sync": "3",
"compare": "1",
"casesync": "2",
"directory": {
"source": "/",
"sink": "",
"backup": ""
},
"filters": "",
"backup": "Y",
"backupmode": "date"
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"_METHOD": "PUT",
"zoneid": 2102,
"meta": {
"mode": "1",
"sync": "3",
"compare": "1",
"casesync": "2",
"directory": {
"source": "/",
"sink": "",
"backup": ""
},
"filters": "",
"backup": "Y",
"backupmode": "date"
}
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/cb/42/zone", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.5centscdn.com/v2/cb/42/zone')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"_METHOD": "PUT",
"zoneid": 2102,
"meta": {
"mode": "1",
"sync": "3",
"compare": "1",
"casesync": "2",
"directory": {
"source": "/",
"sink": "",
"backup": ""
},
"filters": "",
"backup": "Y",
"backupmode": "date"
}
}'
response = http.request(request)
puts response.body
{
"result": "success",
"message": "CriticalBackup link added"
}
POST
/cb/{backupid}/zonePOST
Base URLstring
Target server for requests. Edit to use your own host.
API Key (header: X-API-Key)
X-API-Keystring
RequiredAPI key (sent in header)
path
backupidinteger
RequiredCritical Backup job ID
Content-Typestring
RequiredThe media type of the request body
Options: application/json
_METHODstring
RequiredHTTP method override for this request. Always set to PUT to link a new zone.
zoneidinteger
RequiredID of the existing CDN zone to link to this backup. Required.
metaobject
RequiredSync configuration for the linked zone.
Request Preview
Response
Response will appear here after sending the request
Authentication
header
X-API-Keystring
RequiredAPI Key for authentication. Provide your API key in the header.
Path Parameters
Body
application/json
_METHODstring
RequiredHTTP method override for this request. Always set to PUT to link a new zone.
Example:
PUTmetaobject
RequiredSync configuration for the linked zone.
Responses
resultstring
Status of the API response.
messagestring
Human-readable status or result message.
Was this page helpful?