Update User Agent
Update user agent access control of HTTP pull zone
curl -X POST "https://api.5centscdn.com/v2/zones/http/pull/42/useragent" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"enabled": "Y",
"policy": "Y",
"list": "Googlebot,curl",
"ips": "192.168.1.1",
"casesensitive": "Y",
"mode": "save"
}'
import requests
import json
url = "https://api.5centscdn.com/v2/zones/http/pull/42/useragent"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"enabled": "Y",
"policy": "Y",
"list": "Googlebot,curl",
"ips": "192.168.1.1",
"casesensitive": "Y",
"mode": "save"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.5centscdn.com/v2/zones/http/pull/42/useragent", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"enabled": "Y",
"policy": "Y",
"list": "Googlebot,curl",
"ips": "192.168.1.1",
"casesensitive": "Y",
"mode": "save"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"enabled": "Y",
"policy": "Y",
"list": "Googlebot,curl",
"ips": "192.168.1.1",
"casesensitive": "Y",
"mode": "save"
}`)
req, err := http.NewRequest("POST", "https://api.5centscdn.com/v2/zones/http/pull/42/useragent", 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/pull/42/useragent')
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 = '{
"enabled": "Y",
"policy": "Y",
"list": "Googlebot,curl",
"ips": "192.168.1.1",
"casesensitive": "Y",
"mode": "save"
}'
response = http.request(request)
puts response.body
{
"result": "success",
"message": "Zone Updated",
"zone": {
"type": "pull",
"id": 12345,
"serviceid": 67890,
"mode": "http",
"cnames": "",
"edgeruleids": 0,
"deleted": null,
"name": "my-cdn-zone",
"hashid": "abc123def456",
"fqdn": "cdn.example.com",
"edgerules": {
"enabled": "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"
},
"securetoken": {
"policy": "F",
"keyip": "N",
"list": "ab12cd34ef56gh78",
"timeout": 3600,
"session": "0",
"ips": "",
"dirs": "",
"enabled": "N",
"active": "N"
},
"eac": {
"policy": "N",
"list": "http://example.com/auth.script",
"ips": "203.0.113.10",
"enabled": "N",
"active": "N"
},
"ssl": {
"http": "N",
"http2": "Y",
"redirect": "Y",
"mode": "S",
"certid": null,
"zerossl": null,
"enabled": "Y",
"warning": false
},
"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"
},
"shield": {
"shields": [
"CA",
"FR"
]
},
"waf": {
"enabled": "N"
},
"seo": {
"id": 12345,
"type": "pull",
"canonical": "N",
"mode": "default",
"robots": "N",
"robotstxt": "N",
"robotstxtcustom": ""
},
"ftpdetails": {
"username": "user_67890_push_12345",
"password": "••••••••"
},
"ssl_enabled": "Y"
}
}
/zones/http/pull/{zoneid}/useragentTarget server for requests. Edit to use your own host.
API key (sent in header)
Zone ID
The media type of the request body
Enable or disable user agent access control.
User agent filtering mode. Y = Block mode (block requests from listed user agents). N = Allow mode (allow only requests from listed user agents, block all others).
Comma-separated user agent strings to block (Y) or allow (N).
Comma-separated IP addresses excluded from user agent control.
User agent string matching precision. Y = case-sensitive matching. N = case-insensitive matching.
Configuration persistence mode. save = replace current list. append = add entries to existing list. overwrite = reset and replace entirely.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Path Parameters
Body
User agent filtering mode. Y = Block mode (block requests from listed user agents). N = Allow mode (allow only requests from listed user agents, block all others).
YNUser agent string matching precision. Y = case-sensitive matching. N = case-insensitive matching.
YNConfiguration persistence mode. save = replace current list. append = add entries to existing list. overwrite = reset and replace entirely.
saveappendoverwriteResponses
Status of the API response.
Human-readable status or result message