API manual
The PrivateFlare API allows you to work with domains. Interaction with the service is carried out using the HTTP REST API protocol. Request and result format is JSON. There is no limit on the number of requests.
The PrivateFlare API allows you to work with domains. Interaction with the service is carried out using the HTTP REST API protocol. Request and result format is JSON. There is no limit on the number of requests.
For authorization, you must pass the X-Auth-Key header with the value of the API key:
X-Auth-Key: meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz
To get an API key, click on your name in the upper right corner, select "Get API key" and copy the key.
Basic URL: https://api.privateflare.com
Request | Path | Description |
---|---|---|
GET | /me |
User information |
GET | /domains/ |
Domains list |
GET | /domains/{domain} |
Details on the selected domain |
POST | /domains/ |
Create a new domain |
PATCH | /domains/{domain} |
Update domain settings |
DELETE | /domains/{domain} |
Delete domain |
URL: GET https://api.privateflare.com/me
The function returns information about the user, his balance and available slots.
Example request via CURL:
curl --location 'https://api.privateflare.com/me' \ --header 'X-Auth-Key: meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz'
Successful server responce example:
{ "name": "Meow Nyan", "slot_limit": 1000, "slot_used": 1, "user_token": "wl3ezSTggb9vmtnW98O3iceqFX3GN52q", "balance": 1.0, "api_key": "meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz", "success": true }
Error response example:
{ "success": false, "msg": "invalid api key" }
URL: GET https://api.privateflare.com/domains/
The function returns a list of active domains in the domains
field. Each domain is rendered as an object with the fields described in the next function.
Example request via CURL:
curl --location 'https://api.privateflare.com/domains/' \ --header 'X-Auth-Key: meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz'
Successful server responce example:
{ "domains": [{ "id": 12345, "enabled": true, "domain": "meow.life", "mask": "purr.me", "ssl": true, "backend": "51.15.14.88", "fhttps": true, "created": 1671273182, "online": true, "tags": [ "meow", "parked" ], "cachelevel": 0, "ratelimit": 1000, "serverheader": "", "imageconvert": false, "minify": false, "node": 123 }], "success": true }
URL: GET https://api.privateflare.com/domains/{domain}
The function returns the data of the selected domain in the domain
object with the fields:
id
- internal domain identifier.enabled
- domain activity flag.domain
- domain address.mask
- target domain to mask.ssl
- SSL certificate generation flag.backend
- IP address of the target server.fhttps
- mandatory switch to HTTPS flag.created
- domain creation time in UNIX timestamp format.online
- current status of the domain.tags
- an array with tags.cachelevel
- caching level (0
- disabled, 1
- basic, 2
- enhanced) li>
ratelimit
- limit on the number of requests.serverheader
- server header.imageconvert
- flag for image converter to WebP activity.minify
- JS, CSS and HTML minification activity flag.node
- identifier of the node to which the domain is linked.Example request via CURL:
curl --location 'https://api.privateflare.com/domains/meow.life' \ --header 'X-Auth-Key: meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz'
Successful server responce example:
{ "domain": { "id": 12345, "enabled": true, "domain": "meow.life", "mask": "purr.me", "ssl": true, "backend": "51.15.14.88", "fhttps": true, "created": 1671273182, "online": true, "tags": [ "meow", "parked" ], "cachelevel": 0, "ratelimit": 1000, "serverheader": "", "imageconvert": false, "minify": false, "node": 123 }, "success": true }
Error response example:
{ "success": false, "msg": "domain not exists" }
URL: POST https://api.privateflare.com/domains/
The function creates a new domain according to the specified data:
enabled
- domain activity flag (true
or false
).domain
- domain address (string).mask
- target domain to mask (string).ssl
- SSL certificate generation flag (true
or false
).backend
- IP address of the target server (string).fhttps
- mandatory switch to HTTPS flag (true
or false
).tags
- array with tags (array of strings).cachelevel
- caching level (0
- disabled, 1
- basic, 2
- enhanced) li>
ratelimit
- limit on the number of requests (number).serverheader
- server header (string).imageconvert
- flag of image converter to WebP activity (true
or false
).minify
- JS, CSS and HTML minification activity flag (true
or false
).Example request via CURL:
curl --location 'https://api.privateflare.com/domains/' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Key: meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz' \ --data '{ "enabled": true, "domain": "meow.life", "mask": "purr.me", "ssl": true, "backend": "51.15.14.88", "fhttps": true, "tags": [ "meow", "parked" ], "cachelevel": 1 }'
Successful server responce example:
{ "success": true }
Error response example:
{ "success": false, "msg": "domain exists" }
URL: PATCH https://api.privateflare.com/domains/{domain}
The function changes the domain settings. The field list and submit methods are similar to the domain creation function. You can only pass the parameters you want to change.
Example request via CURL:
curl --location --request PATCH 'https://api.privateflare.com/domains/meow.life' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Key: meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz' \ --data '{ "ssl": false, "fhttps": false, "cachelevel": 0 }'
Successful server responce example:
{ "success": true }
Error response example:
{ "success": false, "msg": "domain not exists" }
URL: DELETE https://api.privateflare.com/domains/{domain}
The function deletes a domain by its name.
Example request via CURL:
curl --location --request DELETE 'https://api.privateflare.com/domains/meow.life' \ --header 'X-Auth-Key: meowyeVV9FEkGb2zRwNXetEeWVChrMky6Szz'
Successful server responce example:
{ "success": true }
Error response example:
{ "success": false, "msg": "domain not exists" }