Create Zone
Create a new HTTP Push Zone
curl -X POST "https://api.5centscdn.com/v2/zones/http/push/new" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"_METHOD": "PUT",
"alias": "my-push-zone",
"server": 30,
"profiles": [
"12",
"15"
],
"ssl": {
"http2": "Y",
"redirect": "N",
"mode": "S"
},
"cache": {
"cache": "1h",
"expiry": ""
},
"webhook": "https://hooks.example.com/webhook",
"cnames": "cdn.example.com",
"domainlock": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"noreferer": "N"
},
"geoblock": {
"enabled": "N",
"policy": "Y",
"list": [],
"ips": ""
},
"bwlimit": {
"enabled": "N",
"policy": "0",
"rate": 0,
"rateafter": 0
},
"ipaccess": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": ""
},
"securetoken": {
"enabled": "N",
"policy": "Q",
"keyip": "N",
"list": "",
"timeout": 5,
"session": "0",
"ips": ""
},
"useragent": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"casesensitive": "N"
}
}'
import requests
import json
url = "https://api.5centscdn.com/v2/zones/http/push/new"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"_METHOD": "PUT",
"alias": "my-push-zone",
"server": 30,
"profiles": [
"12",
"15"
],
"ssl": {
"http2": "Y",
"redirect": "N",
"mode": "S"
},
"cache": {
"cache": "1h",
"expiry": ""
},
"webhook": "https://hooks.example.com/webhook",
"cnames": "cdn.example.com",
"domainlock": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"noreferer": "N"
},
"geoblock": {
"enabled": "N",
"policy": "Y",
"list": [],
"ips": ""
},
"bwlimit": {
"enabled": "N",
"policy": "0",
"rate": 0,
"rateafter": 0
},
"ipaccess": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": ""
},
"securetoken": {
"enabled": "N",
"policy": "Q",
"keyip": "N",
"list": "",
"timeout": 5,
"session": "0",
"ips": ""
},
"useragent": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"casesensitive": "N"
}
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/zones/http/push/new", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"_METHOD": "PUT",
"alias": "my-push-zone",
"server": 30,
"profiles": [
"12",
"15"
],
"ssl": {
"http2": "Y",
"redirect": "N",
"mode": "S"
},
"cache": {
"cache": "1h",
"expiry": ""
},
"webhook": "https://hooks.example.com/webhook",
"cnames": "cdn.example.com",
"domainlock": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"noreferer": "N"
},
"geoblock": {
"enabled": "N",
"policy": "Y",
"list": [],
"ips": ""
},
"bwlimit": {
"enabled": "N",
"policy": "0",
"rate": 0,
"rateafter": 0
},
"ipaccess": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": ""
},
"securetoken": {
"enabled": "N",
"policy": "Q",
"keyip": "N",
"list": "",
"timeout": 5,
"session": "0",
"ips": ""
},
"useragent": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"casesensitive": "N"
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"_METHOD": "PUT",
"alias": "my-push-zone",
"server": 30,
"profiles": [
"12",
"15"
],
"ssl": {
"http2": "Y",
"redirect": "N",
"mode": "S"
},
"cache": {
"cache": "1h",
"expiry": ""
},
"webhook": "https://hooks.example.com/webhook",
"cnames": "cdn.example.com",
"domainlock": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"noreferer": "N"
},
"geoblock": {
"enabled": "N",
"policy": "Y",
"list": [],
"ips": ""
},
"bwlimit": {
"enabled": "N",
"policy": "0",
"rate": 0,
"rateafter": 0
},
"ipaccess": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": ""
},
"securetoken": {
"enabled": "N",
"policy": "Q",
"keyip": "N",
"list": "",
"timeout": 5,
"session": "0",
"ips": ""
},
"useragent": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"casesensitive": "N"
}
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/zones/http/push/new", 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/zones/http/push/new')
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",
"alias": "my-push-zone",
"server": 30,
"profiles": [
"12",
"15"
],
"ssl": {
"http2": "Y",
"redirect": "N",
"mode": "S"
},
"cache": {
"cache": "1h",
"expiry": ""
},
"webhook": "https://hooks.example.com/webhook",
"cnames": "cdn.example.com",
"domainlock": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"noreferer": "N"
},
"geoblock": {
"enabled": "N",
"policy": "Y",
"list": [],
"ips": ""
},
"bwlimit": {
"enabled": "N",
"policy": "0",
"rate": 0,
"rateafter": 0
},
"ipaccess": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": ""
},
"securetoken": {
"enabled": "N",
"policy": "Q",
"keyip": "N",
"list": "",
"timeout": 5,
"session": "0",
"ips": ""
},
"useragent": {
"enabled": "N",
"policy": "Y",
"list": "",
"ips": "",
"casesensitive": "N"
}
}'
response = http.request(request)
puts response.body
{
"result": "success",
"message": "Zone Created",
"zone": {
"type": "push",
"id": 12345,
"serviceid": 67890,
"alias": "my-cdn-zone",
"hashid": "abc123def456",
"mode": "http",
"optimizer": "0",
"cnames": "",
"edgeruleids": 0,
"rclone": 0,
"disabled": "0",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-06-01T08:00:00Z",
"deleted": null,
"router": "mycdn",
"remaining": 0,
"status": "active",
"name": "my-cdn-zone",
"fqdn": "cdn.example.com",
"ssl": {
"http": "N",
"http2": "Y",
"redirect": "Y",
"mode": "S",
"certid": null,
"zerossl": null,
"enabled": "Y",
"warning": false
},
"cnamesArr": [
"cdn.example.com"
],
"cnamesArrFqdn": [
"cdn.example.com"
],
"waf": {
"enabled": "N"
},
"defaultBehaviors": {},
"edgeRules": [],
"cache": {
"smart": "0",
"cache": "4h",
"expiry": "1M",
"querystring": "N",
"cachecontrol": "Y",
"usestale": "Y",
"revalidate": "Y",
"cacheInSecs": 14400,
"cacheInMins": 240,
"expiryInSecs": 2592000,
"expiryInMins": 43200
},
"edge": {
"compression": "N",
"compressionlevel": 5,
"disposition": "N",
"stripcookie": "N",
"xff": "N",
"cors": "Y",
"webp": "N",
"pseudostreaming": "N",
"wp": "N",
"lfo": "Y",
"prefresh": "N"
},
"domainlock": {
"policy": "N",
"list": "example.com,cdn.example.com",
"ips": "203.0.113.10",
"noreferer": "N",
"type": "push",
"enabled": "N",
"active": "N"
},
"geoblock": {
"policy": "N",
"list": [
"US",
"GB"
],
"ips": "203.0.113.10",
"enabled": "N",
"active": "N"
},
"ipaccess": {
"enabled": "Y",
"policy": "N",
"list": "203.0.113.10,10.0.0.0/8",
"ips": "",
"active": "N"
},
"useragent": {
"enabled": "Y",
"policy": "N",
"list": "*Chrome*;;;*Firefox*",
"casesensitive": "N",
"ips": "",
"active": "N",
"listArr": [
"*Chrome*",
"*Firefox*"
]
},
"securetoken": {
"policy": "F",
"keyip": "N",
"list": "ab12cd34ef56gh78",
"timeout": 3600,
"session": "0",
"ips": "",
"dirs": "",
"enabled": "N",
"active": "N"
},
"bwlimit": {
"enabled": "Y",
"policy": 0,
"rate": 0,
"rateafter": 0
},
"eac": {
"policy": "N",
"list": "http://example.com/auth.script",
"ips": "203.0.113.10",
"enabled": "N",
"active": "N"
},
"behaviorId": 11111,
"linkedVideoManager": null,
"hostHeader": "cdn.example.com",
"storageHost": "storage.example.com",
"storageHostBackup": "storage-eu.example.com",
"osAuthUrl": "https://storage.example.com/v3/",
"horizonUrl": "https://storage.example.com/horizon/",
"cdnservice": {
"purgeurls": [
"/dashboard/67890/zones/http/push/12345/purge"
],
"purgeurl": "["\\/dashboard\\/67890\\/zones\\/http\\/push\\/12345\\/purge"]",
"authtoken": "c2FtcGxlLWF1dGh0b2tlbi1oZXJl",
"infourl": "https://cdn-service.example.com/service.php/info/5/push/12345",
"listurl": "https://cdn-service.example.com/service.php/list/5/push/12345",
"rawlisturl": "https://cdn-service.example.com/service.php/raw/list/5/push/12345",
"transcodelisturl": "https://cdn-service.example.com/service.php/transcode/list/5/push/12345",
"addurl": "https://cdn-service.example.com/service.php/add/5/push/12345",
"editurl": "https://cdn-service.example.com/service.php/edit/5/push/12345",
"deleteurl": "https://cdn-service.example.com/service.php/delete/5/push/12345",
"uploadurl": "https://cdn-service.example.com/upload.php",
"playlisturl": "https://cdn-service.example.com/service.php/playlist"
},
"ftpdetails": {
"username": "user_67890_push_12345",
"password": "â¢â¢â¢â¢â¢â¢â¢â¢"
},
"playbackurls": {},
"s3details": {
"relid": 12345,
"type": "push",
"projectid": "abc123def456789012345678abcdef12",
"token": "sample-access-token",
"projectid2": "def456abc789012345678901abcdef34",
"token2": "sample-access-token",
"active": "1",
"updated_at": "2024-06-01T08:00:00Z",
"last_modified": ""
},
"transcodefile": {
"profiles": [
"1",
"2"
],
"emails": [
"admin@example.com"
],
"webhooks": [
"https://hooks.example.com/webhook"
]
},
"server": {
"code": "206",
"name": "Singapore",
"country": "SouthEast Asia",
"meta": {
"uploadPort": "21",
"uploadHost": "upload.example.com"
}
},
"hasEdgeRules": false
},
"warnings": [
"SSL Certificate Create Failed"
]
}
/zones/http/push/new
Target server for requests. Edit to use your own host.
API key (sent in header)
The media type of the request body
Must always be PUT.
Label for the zone.
Server location code. 30 = North America, 31 = Europe, 206 = SE Asia.
Transcoding profile IDs. Leave empty to disable auto transcoding.
SSL certificate settings for HTTPS delivery.
Cache configuration settings for the zone.
HTTP/HTTPS URL to notify after files are transcoded.
Comma-separated verified CNAMEs.
Domain lock / referrer restriction settings.
Geo-blocking settings to restrict access by country.
Bandwidth limit settings for the zone.
IP access control settings to allow or block specific IPs.
Secure token settings for URL authentication.
User-agent filter settings to restrict access by browser/client.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Body
Server location code. 30 = North America, 31 = Europe, 206 = SE Asia.
3031206SSL certificate settings for HTTPS delivery.
Cache configuration settings for the zone.
HTTP/HTTPS URL to notify after files are transcoded.
https://hooks.example.com/webhookDomain lock / referrer restriction settings.
Geo-blocking settings to restrict access by country.
Bandwidth limit settings for the zone.
IP access control settings to allow or block specific IPs.
Secure token settings for URL authentication.
User-agent filter settings to restrict access by browser/client.
Responses
Status of the API response.
Human-readable status or result message