Getting Your Key#

Get your token in the user settings.

image

And copy the generated key.

image

Specification#

Base URL: https://api.privateflare.com

For authorization, you must pass the X-Auth-Key header with your API key value.

Available Methods#

MethodPathDescription
GET/meUser information
GET/domains/List of domains
GET/domains/{domain}Details for a specific domain
POST/domains/Create a new domain
PATCH/domains/{domain}Update domain parameters
DELETE/domains/{domain}Delete a domain
GET/domains/{domain}/uptimeServer response time statistics
GET/tasks/Active certificate generation tasks
GET/security/iplist/List of IP lists
POST/security/iplist/Create an IP list
PATCH/security/iplist/{listid}Update an IP list
DELETE/security/iplist/{listid}Delete an IP list
PUT/security/iplist/{listid}/{ip}Add IP to block list
DELETE/security/iplist/{listid}/{ip}Remove IP from block list
GET/nodes/List of nodes
GET/domains/{domain}/dnsrecordsDomain DNS records
POST/domains/{domain}/dnsrecordsCreate a DNS record
PATCH/domains/{domain}/dnsrecords/{id}Update a DNS record
DELETE/domains/{domain}/dnsrecords/{id}Delete a DNS record
GET/domains/{domain}/certexportExport SSL certificate (ZIP)
GET/domains/{domain}/activatensActivate NS records
GET/domains/{domain}/deactivatensDeactivate NS records
Information#
# cURL example
curl --location 'https://api.privateflare.com/me/' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'
List of Domains#
# cURL example
curl --location 'https://api.privateflare.com/domains/' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'
Single Domain#
# cURL example
curl --location 'https://api.privateflare.com/domains/domain.com' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'
Create a Domain#
# cURL example
curl --location 'https://api.privateflare.com/domains/' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx' \
--data '{
    "enabled": true,
    "domain": "domain.com",
    "mask": "yandex.info",
    "ssl": true,
    "tags": ["tag1","tag2"],
    "backend": "127.0.0.1",
    "fhttps": true,
    "cachelevel": 1
}'
FieldTypeDescription
enabledboolDomain activity
domainstringDomain name
maskstringDomain mask
sslboolSSL activity
tagsstring[]List of tags
backendstringBackend IP
failoverstringFailover backend IP
fhttpsboolForced redirect from HTTP to HTTPS
cachelevelintCache level (0-3)
sjschallengeboolJS Challenge (similar to Under Attack)
baseprotectionboolBasic WAF protection
bwlimitintBandwidth limit, KB/s (0 = no limit)
geomodeintGeo-filtering: 0=off, 1=allow only, 2=block
geoliststring[]List of country codes (ISO 3166-1 alpha-2)
bind_nodeint[]Binding to specific nodes (empty = all nodes)
cachelargefilesboolLarge file caching on nodes
Modify Domain Parameters#
# cURL example
curl --location 'https://api.privateflare.com/domains/domain.com' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx' \
--data '{
    "enabled": true
}'

Note that you can pass ONLY THE PARAMETERS YOU WANT TO CHANGE.

Delete a Domain#
# cURL example
curl --location --request DELETE 'https://api.privateflare.com/domains/domain.com' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'
Create a Block List#
# cURL example
curl --location 'https://api.privateflare.com/security/iplist/' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
    "name": "list name",
    "ips": ["1.1.1.1"],
    "allnodes": true,
    "nodes": []
}'
FieldDescription
nameList name
ipsList of IPs
allnodesApply to all nodes
nodesList of nodes where the list will be applied
Domain DNS Records#
curl --location 'https://api.privateflare.com/domains/domain.com/dnsrecords' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'
Create a DNS Record#
curl --location 'https://api.privateflare.com/domains/domain.com/dnsrecords' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx' \
--data '{
    "name": "@",
    "type": 1,
    "value": "1.2.3.4",
    "ttl": 3600,
    "target": []
}'
FieldTypeDescription
namestringRecord name (@ for root)
typeintRecord type: 1=A, 2=AAAA, 3=CNAME, 4=MX, 5=NS, 6=TXT, 7=SOA, 8=SRV
valuestringRecord value
ttlintTTL in seconds
priorityintPriority (for MX, SRV)
targetint[]Geo-binding: country/continent IDs for GeoDNS (empty = general record)
Activate NS Records#

To use the PrivateFlare DNS service (ns1.privateflare.com, ns2.privateflare.com):

curl --location 'https://api.privateflare.com/domains/domain.com/activatens' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'
Add IP to Block List#
curl --location --request PUT 'https://api.privateflare.com/security/iplist/6/2.2.2.2' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'
Remove IP from Block List#
curl --location --request DELETE 'https://api.privateflare.com/security/iplist/6/2.2.2.2' \
--header 'X-Auth-Key: xxxxxxxxxxxxxxxxxxxxxxxx'