Certain site features are accessible through the API. The API_KEY is required for queries, which can be obtained in your control panel after registration.
For GET authentication, the following parameter is added to the query: '?apikey=[API_KEY]'.
For POST queries, the parameter 'apikey' is added to POST.
If successful, the response is returned to JSON. If there are errors in the query parameters, the error description will be returned in the 'error' field.
HTTP code | Description |
200 | Reply received |
403 | Access denied: 'API_KEY' is not specified or there is insufficient permission for the function you requested. |
5xx | Server error. Something went wrong. We've been notified of the bug and will fix it soon. |
/api/account/balance
GET
import requests
requests.get("https://fornex.com/api/account/balance", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/account/balance" --get\
--data "apikey=PERSONAL_API_KEY"
{
"balance": 91.0,
"currency": "EUR"
}
/api/account/info
GET
import requests
requests.get("https://fornex.com/api/account/info", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/account/info" --get\
--data "apikey=PERSONAL_API_KEY"
{
"email": "example@fornex.com",
"name": "Example Account"
}
/api/account/invoices
GET
import requests
requests.get("https://fornex.com/api/account/invoices", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/account/invoices" --get\
--data "apikey=PERSONAL_API_KEY"
{
"unpaid_invoices_count": 1,
"unpaid_invoices_amount": 100,
"currency": "EUR"
}
/api/orders/list
GET
import requests
requests.get("https://fornex.com/api/orders/list", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/orders/list" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"cost_month": 148.0,
"expiration_date": "2015-12-18T17:21:46",
"id": "34-1234",
"ipaddress_set": [
"123.123.123.123"
],
"name": "user-defined-name",
"hostname": "srv-123.fornex.org",
"status": "active",
"tariff": "VPS Master",
"tariff_id": 33,
"tariff_price": 140,
"type": "vps"
}
]
/api/plans/backups
GET
import requests
requests.get("https://fornex.com/api/plans/backups", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/plans/backups" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"price": 3.0,
"space": 100,
"units": "Gb"
},
{
"price": 4.5,
"space": 150,
"units": "Gb"
},
{
"price": 6.0,
"space": 200,
"units": "Gb"
}
]
/api/plans/dedicated
GET
import requests
requests.get("https://fornex.com/api/plans/dedicated", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/plans/dedicated" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"bandwidth": "1 Gbit/s",
"cpu_model": "Intel Xeon E3-1270 (4×3.4Ghz)",
"cpu_count": 1,
"disk": "4 × 300 GB SAS 15k",
"name": "DS XeonSAS",
"id": 101,
"price": 198.0,
"ram": "16 GB",
"location": "DE"
}
]
/api/plans/vpn
GET
import requests
requests.get("https://fornex.com/api/plans/vpn", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/plans/vpn" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"available_locations": [
"DE",
"NL",
"US",
"RU"
],
"type": "dedicated",
"id": 1,
"price": 10.0
}
]
/api/plans/vps
GET
import requests
requests.get("https://fornex.com/api/plans/vps", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/plans/vps" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"bandwidth": "100 Mbit/s",
"cpu_count": 1,
"disk": "10 GB",
"id": 433,
"name": "SSD Cloud 1GB",
"price": 5.0,
"ram": "1 GB"
}
]
/api/plans/hosting
GET
import requests
requests.get("https://fornex.com/api/plans/hosting", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/plans/hosting" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"available_locations": [
"DE",
"RU"
],
"cpu_cores": 1,
"databases": 2,
"hdd_space": 1000,
"mail_domains": 2,
"mailboxes": 20,
"name": "VH-SSD-2",
"id": 33,
"price": 1.0,
"sites": 2
}
]
/api/vps/log_details/[order_id]/
GET
order_id
- order number
log_id
- record idimport requests
requests.get("https://fornex.com/api/vps/log_details/34-1234/", {
"log_id": 222287,
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps/log_details/34-1234/" --get\
--data "log_id=222287&apikey=PERSONAL_API_KEY"
{
"action": "Set root password",
"completed": false,
"job_action": "set_root_passwd",
"job_state": "ready",
"note": "Resetting root password",
"pk": 222287,
"time": "03.01.2019 11:10",
"user": "username"
}
/api/vps/stop/[order_id]/
POST
order_id
- order numberimport requests
requests.post("https://fornex.com/api/vps/stop/34-177054/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps/stop/34-177054/" \
--data "apikey=PERSONAL_API_KEY"
{
"ok": "True"
}
`Ok` field of the response contains the request status.
/api/vps/start/[order_id]/
POST
order_id
- order numberimport requests
requests.post("https://fornex.com/api/vps/start/34-177054/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps/start/34-177054/" \
--data "apikey=PERSONAL_API_KEY"
{
"ok": "True"
}
`Ok` field of the response contains the request status.
/api/vps/hard_reset/[order_id]/
POST
order_id
- order numberimport requests
requests.post("https://fornex.com/api/vps/hard_reset/34-177054/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps/hard_reset/34-177054/" \
--data "apikey=PERSONAL_API_KEY"
{
"ok": "True"
}
`Ok` field of the response contains the request status.
/api/vps/restart/[order_id]/
POST
order_id
- order numberimport requests
requests.post("https://fornex.com/api/vps/restart/34-177054/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps/restart/34-177054/" \
--data "apikey=PERSONAL_API_KEY"
{
"ok": "True"
}
`Ok` field of the response contains the request status.
/api/vps/passwd_reset/[order_id]/
GET
order_id
- order numberimport requests
requests.get("https://fornex.com/api/vps/passwd_reset/34-177054/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps/passwd_reset/34-177054/" --get\
--data "apikey=PERSONAL_API_KEY"
{
"resp_id": 1234,
"passwd": "newstrongpassword"
}
`passwd` - new password.
`resp_id` - command ID in logs for checking the request status, see vps_log_details
/api/vps_stat/[order_id]/[field]/[start]--[end].json
GET
order_id
- order numberfield
- statistics field ['cpu'|'memory'|'traffic'|'disk'|'inodes'|'io']start
- start dateend
- end dateimport requests
requests.get("https://fornex.com/api/vps_stat/34-177054/traffic/2015-11-16--2015-11-17.json", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps_stat/34-177054/traffic/2015-11-16--2015-11-17.json" --get\
--data "apikey=PERSONAL_API_KEY"
{
"series": [
{
"color": "#60B5FF",
"data": [
61410.9215552,
65379.49276,
67115.7455904
],
"name": "Incoming",
"pointEnd": 1447773600000,
"pointInterval": 300000,
"pointStart": 1447687200000
},
{
"color": "#61D561",
"data": [
4585.92634648,
4575.14841552,
4636.41519648
],
"name": "Outgoing",
"pointEnd": 1447773600000,
"pointInterval": 300000,
"pointStart": 1447687200000,
"type": "areaspline"
}
],
"subtitle": "November 16, 2015, 17:18 - November 17, 2015, 17:18 (Europe / Moscow)"
}
Поле `series` ответа структурированно в формате для Highcharts, параметры `pointStart`, `pointEnd`, указывают начало и конец в формате `unixtime * 1000`, `pointInterval` - интервал между значениями в поле data.
/api/vps/status/[order_id]/
GET
order_id
- order numberimport requests
requests.get("https://fornex.com/api/vps/status/34-177054/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vps/status/34-177054/" --get\
--data "apikey=PERSONAL_API_KEY"
{
"status": "off"
}
`Status` field in the response contains the VPS status.
/api/ssh_keys/add/
POST
title
- key namekey
- keyimport requests
requests.post("https://fornex.com/api/ssh_keys/add/", {
"title": "test key",
"key": "ssh-rsa tt3BPrBTUCasdasdGXsCXmiF03LD/f9 test@test",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ssh_keys/add/" \
--data "title=test+key&key=ssh-rsa+tt3BPrBTUCasdasdGXsCXmiF03LD%2Ff9+test%40test&apikey=PERSONAL_API_KEY"
{
"date": "December 19, 2017",
"id": 67,
"key": "ssh-rsa tt3BPrBTUCGXsCXmiF03LD/f9 test@test",
"title": "test@test"
}
/api/ssh_keys/[order_id]/add/
POST
order_id
- order number
key_pk
- key idimport requests
requests.post("https://fornex.com/api/ssh_keys/34-177054/add/", {
"key_pk": "99",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ssh_keys/34-177054/add/" \
--data "key_pk=99&apikey=PERSONAL_API_KEY"
{
"ok": true
}
/api/ssh_keys/delete/
POST
key_pk
- key idimport requests
requests.post("https://fornex.com/api/ssh_keys/delete/", {
"key_pk": "74",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ssh_keys/delete/" \
--data "key_pk=74&apikey=PERSONAL_API_KEY"
{
"ok": true
}
/api/ssh_keys/[order_id]/delete/
POST
order_id
- order number
key_pk
- key idimport requests
requests.post("https://fornex.com/api/ssh_keys/34-177054/delete/", {
"key_pk": "74",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ssh_keys/34-177054/delete/" \
--data "key_pk=74&apikey=PERSONAL_API_KEY"
{
"ok": true
}
/api/ssh_keys/[order_id]/
GET
order_id
- order numberimport requests
requests.get("https://fornex.com/api/ssh_keys/34-177054/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ssh_keys/34-177054/" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"date": "December 19, 2017",
"id": 67,
"key": "ssh-rsa tt3BPrBTUCGXsCXmiF03LD/f9 test@test",
"title": "test@test"
}
]
/api/ssh_keys/
GET
import requests
requests.get("https://fornex.com/api/ssh_keys/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ssh_keys/" --get\
--data "apikey=PERSONAL_API_KEY"
[
{
"date": "December 19, 2017",
"id": 67,
"key": "ssh-rsa tt3BPrBTUCGXsCXmiF03LD/f9 test@test",
"title": "test@test"
}
]
A POST request
ContentType: 'application/json' {text: 'New comment added to the ticket...'}
/api/tickets/webhook_set/
POST
url
- URL for submitting request, leave blank to deactivateimport requests
requests.post("https://fornex.com/api/tickets/webhook_set/", {
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/tickets/webhook_set/" \
--data "url=https%3A%2F%2Fhooks.slack.com%2Fservices%2FT00000000%2FB00000000%2FXXXXXXXXXXXXXXXXXXXXXXXX&apikey=PERSONAL_API_KEY"
{
"ok": true
}
/api/tickets/webhook_info/
GET
import requests
requests.get("https://fornex.com/api/tickets/webhook_info/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/tickets/webhook_info/" --get\
--data "apikey=PERSONAL_API_KEY"
{
"last_error_date": null,
"last_error_message": null,
"url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
}
/api/vpn/[order]/config-[proto].ovpn
GET
order
- order numberproto
- protocol ['tcp'|'udp']import requests
requests.get("https://fornex.com/api/vpn/301-12312/config-udp.ovpn", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/vpn/301-12312/config-udp.ovpn" --get\
--data "apikey=PERSONAL_API_KEY"
client dev tun <connection> remote 209.222.104.210 443 udp </connection> ...
To use this method, please contact technical support and request sufficient rights to edit the DNS.
/api/dns/v0.1/add_domain/
POST
name
- Domain nameip
- IPimport requests
requests.post("https://fornex.com/api/dns/v0.1/add_domain/", {
"name": "example.com",
"ip": "127.0.0.1",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/add_domain/" \
--data "name=example.com&ip=127.0.0.1&apikey=PERSONAL_API_KEY"
{
"ok": true,
"name": "example.com"
}
/api/dns/v0.1/[name]/entry_set/add/
POST
name
- domain
host
- Record hostname: '@, *, subdomain'type
- Тип записи: [`A`|`AAAA`|`TXT`|`CNAME`|`NS`|`MX`|`SRV`|`CAA`]value
- Record value according to type, for example IP for A recordsttl
- Время жизни (не обязательное, по умолчанию: 3600 сек.): [`120`(2 мин.) |`300`(5 мин.) |`600`(10 мин.) |`900`(15 мин.) |`1800`(30 мин.) |`3600`(1 час) |`7200`(2 часа) |`18000`(5 часов) |`43200`(12 часов) |`86400`(1 день) ]prio
- Priority, used only for SRV and MXimport requests
requests.post("https://fornex.com/api/dns/v0.1/example.com/entry_set/add/", {
"host": "example",
"type": "A",
"value": "1.2.3.4",
"ttl": "600",
"prio": "5",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/example.com/entry_set/add/" \
--data "host=example&type=A&value=1.2.3.4&ttl=600&prio=5&apikey=PERSONAL_API_KEY"
{
"ok": true,
"pk": 123
}
To use this method, please contact technical support and request sufficient rights to edit the DNS.
/api/dns/v0.1/[name]/delete_domain/
POST
name
- domainimport requests
requests.post("https://fornex.com/api/dns/v0.1/example.com/delete_domain/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/example.com/delete_domain/" \
--data "apikey=PERSONAL_API_KEY"
{
"ok": true
}
/api/dns/v0.1/[name]/entry_set/[pk]/delete/
POST
name
- domainpk
- Record IDimport requests
requests.post("https://fornex.com/api/dns/v0.1/example.com/entry_set/366182/delete/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/example.com/entry_set/366182/delete/" \
--data "apikey=PERSONAL_API_KEY"
{
"ok": true
}
/api/dns/v0.1/domain_list.json
GET
q
- search by name or IPtag
- filter by tagimport requests
requests.get("https://fornex.com/api/dns/v0.1/domain_list.json", {
"q": "10.10.10.18",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/domain_list.json" --get\
--data "q=10.10.10.18&apikey=PERSONAL_API_KEY"
[
{
"name": "test.com",
"created": "2013-04-16T19:07:10",
"updated": "2017-02-05T21:41:25",
"entry_set": [
{
"host": "",
"id": 366182,
"type": "A",
"ttl": null,
"value": "10.10.10.18"
}
],
"tags": []
}
]
/api/dns/v0.1/[name]/entry_set.json
GET
name
- domain
q
- record filterimport requests
requests.get("https://fornex.com/api/dns/v0.1/example.com/entry_set.json", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/example.com/entry_set.json" --get\
--data "apikey=PERSONAL_API_KEY"
{
"entry_set": [
{
"id": 12344,
"host": "",
"prio": null,
"type": "A",
"ttl": 600,
"value": "127.0.0.1"
},
{
"id": 12345,
"host": "",
"type": "MX",
"prio": 1,
"ttl": null,
"value": "aspmx.l.google.com"
}
]
}
/api/dns/v0.1/[name]/entry_set/[pk]/
POST
name
- domainpk
- Record ID
host
- Record hostname: '@, *, subdomain'type
- Тип записи: [`A`|`AAAA`|`TXT`|`CNAME`|`NS`|`MX`|`SRV`|`CAA`]value
- Record value according to type, for example IP for A recordsttl
- Время жизни (не обязательное, по умолчанию: 3600 сек.): [`120`(2 мин.) |`300`(5 мин.) |`600`(10 мин.) |`900`(15 мин.) |`1800`(30 мин.) |`3600`(1 час) |`7200`(2 часа) |`18000`(5 часов) |`43200`(12 часов) |`86400`(1 день) ]prio
- Priority, used only for SRV and MXimport requests
requests.post("https://fornex.com/api/dns/v0.1/example.com/entry_set/366182/", {
"host": "example",
"type": "A",
"value": "1.2.3.4",
"ttl": "600",
"prio": "5",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/example.com/entry_set/366182/" \
--data "host=example&type=A&value=1.2.3.4&ttl=600&prio=5&apikey=PERSONAL_API_KEY"
{
"ok": true
}
/api/dns/v0.1/[name]/zone_file/
GET
name
- domainimport requests
requests.get("https://fornex.com/api/dns/v0.1/example.com/zone_file/", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/dns/v0.1/example.com/zone_file/" --get\
--data "apikey=PERSONAL_API_KEY"
$TTL 21600 @ IN SOA ns1.fornex.com. hostmaster.fornex.com. ( ...
/api/change_ns/[order_id]/
POST
order_id
- order number
nss
- List of NS, separated by a commaimport requests
requests.post("https://fornex.com/api/change_ns/375-13/", {
"nss": "ns1.company.com,ns2.company.com",
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/change_ns/375-13/" \
--data "nss=ns1.company.com%2Cns2.company.com&apikey=PERSONAL_API_KEY"
[
{
"ok": true
}
]
/api/ds/34-[order_id]/traffic.json
GET
order_id
- order number
period
- period for displaying statistics ['month'|'year'], 'month' by defaultport
- sequential port number, '0' by defaultimport requests
requests.get("https://fornex.com/api/ds/34-1234/traffic.json", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ds/34-1234/traffic.json" --get\
--data "apikey=PERSONAL_API_KEY"
{
"data": [
[
"2015-11-11",
{
"input": 41348840999.42331,
"output": 969929788001.3163
}
],
[
"2015-11-12",
{
"input": 44384423647.10196,
"output": 1019910108491.1565
}
]
],
"order": "34-1234 DS HyperXeon (example.net)",
"period": "month"
}
Response: 'input', 'output' - traffic in bytes.
/api/ds/34-[order_id]/traffic_used.json
GET
order_id
- order numberimport requests
requests.get("https://fornex.com/api/ds/34-1234/traffic_used.json", {
"apikey": "PERSONAL_API_KEY"
})
$ curl "https://fornex.com/api/ds/34-1234/traffic_used.json" --get\
--data "apikey=PERSONAL_API_KEY"
{
"limit": 14293651161088.0,
"order": "34-1234 DS XeonNeon (example.net)",
"range_end": "2015-11-21",
"range_start": "2015-10-21",
"used": 3508146044885.079,
"used_rate": 0.24543386468220252
}