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#

Method Path Description
GET /me User 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}/uptime Server 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}/dnsrecords Domain DNS records
POST /domains/{domain}/dnsrecords Create a DNS record
PATCH /domains/{domain}/dnsrecords/{id} Update a DNS record
DELETE /domains/{domain}/dnsrecords/{id} Delete a DNS record
GET /domains/{domain}/certexport Export SSL certificate (ZIP)
GET /domains/{domain}/activatens Activate NS records
GET /domains/{domain}/deactivatens Deactivate 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
}'
Field Type Description
enabled bool Domain activity
domain string Domain name
mask string Domain mask
ssl bool SSL activity
tags string[] List of tags
backend string Backend IP
failover string Failover backend IP
fhttps bool Forced redirect from HTTP to HTTPS
cachelevel int Cache level (0-3)
sjschallenge bool JS Challenge (similar to Under Attack)
baseprotection bool Basic WAF protection
bwlimit int Bandwidth limit, KB/s (0 = no limit)
geomode int Geo-filtering: 0=off, 1=allow only, 2=block
geolist string[] List of country codes (ISO 3166-1 alpha-2)
bind_node int[] Binding to specific nodes (empty = all nodes)
cachelargefiles bool Large 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": []
}'
Field Description
name List name
ips List of IPs
allnodes Apply to all nodes
nodes List 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": []
}'
Field Type Description
name string Record name (@ for root)
type int Record type: 1=A, 2=AAAA, 3=CNAME, 4=MX, 5=NS, 6=TXT, 7=SOA, 8=SRV
value string Record value
ttl int TTL in seconds
priority int Priority (for MX, SRV)
target int[] 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'