99Stack API

General notes

99Stack API provides all the features found in control panel and more. See this documentation for more information about how to use our API. API keys can be created in control panel.

API detail

Account

Manage account and sub-accounts. View status and enabled features. Create and remove API keys and more.

Account info

Returns a JSON formatted list over all snapshots on this account

curl -X GET -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" "https://api.99stack.com/v1/account/info"
GET /v1/account/info HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Status200
Content-Typeapplication/json
{
    "ID": "123",
    "balance": "500.0",
    "activated": true,
    "smtp_allowed": true,
    "blocked_ports": {
        "TCP": [
            17,
            19,
            1900
        ],
        "UDP": [
            17,
            19,
            1900,
            53413
        ]
    },
    "servers": {
        "limit": 100,
        "running": 40
    },
    "registerdate": "2016-08-17T07:41:31z",
    "lastlogin": "2017-11-27T15:16:44z"
}

Create auth key

Returns a JSON formatted list over all snapshots on this account

curl -X GET -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" "https://api.99stack.com/v1/account/createkey"
GET /v1/account/createkey HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Status200
Content-Typeapplication/json
{
    "message": "qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq",
    "response_type": "success",
    "response_code": 200
}

Information

Public information listing, request JSON formatted listings for data centers, plans, and templates. Requests in this section can be used without authentication headers.

List locations

Shows a JSON formatted list over available locations.

curl -X GET "https://api.99stack.com/v1/locations/list"
GET /v1/locations/list HTTP/1.1
Host: api.99stack.com
Status200
Content-Typeapplication/json
{
    "11": {
        "id": 11,
        "slug": 1,
        "city": "New Jersey",
        "country": "United States",
        "latitude": 40.0583238,
        "longitude": -74.4056612,
        "features": {
            "ddos_protection": true,
            "block_storage": true,
            "private_networking": true,
            "ipv6": true,
            "backups": true
        },
        "operator_id": "cbdfdc8f"
    },
    "21": {
        "id": 21,
        "slug": "sfo1",
        "city": "San Francisco",
        "country": "United States",
        "latitude": 37.7749295,
        "longitude": -122.4194155,
        "features": {
            "ddos_protection": false,
            "block_storage": false,
            "private_networking": true,
            "ipv6": true,
            "backups": true
        },
        "operator_id": "8db02fc9"
    },
    "385": {
        "id": 385,
        "slug": 85,
        "city": "London",
        "country": "GB",
        "latitude": 51.5072,
        "longitude": -0.0558075,
        "features": {
            "ddos_protection": false,
            "block_storage": false,
            "private_networking": false,
            "ipv6": false,
            "backups": false
        },
        "operator_id": "6a5dc1cb"
    }
}

List templates

Shows a list over available templates (applications and operating systems) in a given location

Parameters (GET)

DCID		DataCenter ID, see /v1/locations/list for options
curl -X GET "https://api.99stack.com/v1/templates/list/201"
GET /v1/templates/list/201 HTTP/1.1
Host: api.99stack.com
Status200
Content-Typeapplication/json
{
    "1": {
        "id": 1,
        "name": "LEMP",
        "os_type": "linux",
        "os_distro": "lemp",
        "onapp_os_distro": "centos",
        "min_memory": 1024,
        "min_disk": 25,
        "hourly_cost": 0
    },
    "215": {
        "id": 215,
        "name": "Ubuntu 16.04 x64",
        "os_type": "linux",
        "os_distro": "ubuntu",
        "onapp_os_distro": "ubuntu",
        "min_memory": 1024,
        "min_disk": 25,
        "hourly_cost": 0
    },
    "240": {
        "id": 240,
        "name": "Windows 2016 x64",
        "os_type": "windows",
        "os_distro": "windows",
        "onapp_os_distro": "windows",
        "min_memory": 1024,
        "min_disk": 25,
        "hourly_cost": 0.024657534246575
    }
}

List plans

Shows a list over available server plans in a given location.

Parameters (GET)

DCID		DataCenter ID, see /v1/locations/list for options
curl -X GET "https://api.99stack.com/v1/plans/list/201"
GET /v1/plans/list/201 HTTP/1.1
Host: api.99stack.com
Status200
Content-Typeapplication/json
{
    "115": {
        "id": 115,
        "name": "8192 MB RAM,110 GB SSD,10.00 TB BW",
        "plan_type": "DEDICATED",
        "windows": true,
        "cpu": "2",
        "ram": "8192",
        "disk": "110",
        "bandwidth": "10.00",
        "price_per_hour": 0.10958904109589
    },
    "201": {
        "id": 201,
        "name": "1024 MB RAM,25 GB SSD,1.00 TB BW",
        "plan_type": "SSD",
        "windows": true,
        "cpu": "1",
        "ram": "1024",
        "disk": "25",
        "bandwidth": "1.00",
        "price_per_hour": 0.013698630136986
    },
    "202": {
        "id": 202,
        "name": "2048 MB RAM,40 GB SSD,2.00 TB BW",
        "plan_type": "SSD",
        "windows": true,
        "cpu": "1",
        "ram": "2048",
        "disk": "40",
        "bandwidth": "2.00",
        "price_per_hour": 0.027397260273973
    }
}

Reserved IPs

Reserved IP’s allow you to create and assign additional IP addresses to your servers. Global limits apply, contact support if you get a message saying that maximum amount of IP’s has been assigned. We’ll order more ASAP.

List reserved IPs

Detach existing reserved IP from a server

curl -X GET -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" "https://api.99stack.com/v1/reservedip/list"
GET /v1/reservedip/list HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Status200
Content-Typeapplication/json
{
    "3": {
        "ID": 3,
        "IP": "138.68.202.242",
        "type": "v4",
        "created_at": "2017-11-29T08:00:02z",
        "attached_to": 61,
        "location_id": 21
    },
    "4": {
        "ID": 4,
        "IP": "138.68.198.157",
        "type": "v4",
        "created_at": "2017-11-29T08:00:02z",
        "attached_to": 61,
        "location_id": 21
    },
    "5": {
        "ID": 5,
        "IP": "138.68.202.241",
        "type": "v4",
        "created_at": "2017-11-29T08:00:02z",
        "attached_to": null,
        "location_id": 22
    }
}

Create reserved IP

Create a reserved IP at given location

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "DCID=21" "https://api.99stack.com/v1/reservedip/create"
POST /v1/reservedip/create HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

DCID=21
Status200
Content-Typeapplication/json
{
    "message": "IP address was successfully created",
    "response_type": "success",
    "response_code": 202
}

Remove reserved IP

Remove a reserved IP, billing stops immediately.

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "IP=138.68.202.242" "https://api.99stack.com/v1/reservedip/remove"
POST /v1/reservedip/remove HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

IP=138.68.202.242
Status200
Content-Typeapplication/json
{
    "message": "IP address was successfully removed",
    "response_type": "success",
    "response_code": 204
}

Attach reserved IP

Attach existing reserved IP to a server

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "IP=45.77.143.99&SUBID=60" "https://api.99stack.com/v1/reservedip/attach"
POST /v1/reservedip/attach HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

IP=45.77.143.99&SUBID=60
Status200
Content-Typeapplication/json
{
    "message": "IP address was successfully attached",
    "response_type": "success",
    "response_code": 201
}

Detach reserved IP

Detach existing reserved IP from a server

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "IP=138.68.198.157&SUBID=61" "https://api.99stack.com/v1/reservedip/detach"
POST /v1/reservedip/detach HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

IP=138.68.198.157&SUBID=61
Status200
Content-Typeapplication/json
{
    "message": "IP address was successfully detached",
    "response_type": "success",
    "response_code": 201
}

Server

Manage servers, create, remove, start, stop and more. See Information section for data required to create a new server.

List servers

Returns a JSON formatted list over all servers on this account

curl -X GET -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" "https://api.99stack.com/v1/server/list"
GET /v1/server/list HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Status200
Content-Typeapplication/json
{
    "61": {
        "ID": 61,
        "price": 8,
        "name": "lemp-server-1",
        "power": "active",
        "created": "2017-11-28T17:49:58z",
        "iface": {
            "v4": [
                {
                    "ip_address": "10.134.9.175",
                    "netmask": "255.255.0.0",
                    "gateway": "10.134.0.1",
                    "type": "private"
                },
                {
                    "ip_address": "104.131.140.252",
                    "netmask": "255.255.240.0",
                    "gateway": "104.131.128.1",
                    "type": "public"
                }
            ],
            "v6": [
                {
                    "ip_address": "2604:A880:0001:0020:0000:0000:0017:2001",
                    "netmask": 64,
                    "gateway": "2604:A880:0001:0020:0000:0000:0000:0001",
                    "type": "public"
                }
            ]
        },
        "bandwidth": {
            "usage": "0",
            "limit": "1000"
        },
        "password": "fqgZaQ9HeysnPbX7DjCvHsf64FkFiiBR",
        "ddos_protection": false
    }
}

Create server

Create a new server, billing will start immediately

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "label=api_test&hostname=api_test&OSID=48&DCID=201&PLAN=1&ipv6_networking=false&private_networking=false&ddos_protection=true&cloud_init_script=" "https://api.99stack.com/v1/server/create"
POST /v1/server/create HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

label=api_test&hostname=api_test&OSID=48&DCID=201&PLAN=1&ipv6_networking=false&private_networking=false&ddos_protection=true&cloud_init_script=
Status200
Content-Typeapplication/json
{
    "message": "LEMP Server (sfo1) was successfully deployed",
    "response_type": "success",
    "response_code": 202
}

Remove server

Delete a server, billing will stop immediately

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "SUBID=61" "https://api.99stack.com/v1/server/remove"
POST /v1/server/remove HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

SUBID=61
Status200
Content-Typeapplication/json
{
    "message": "lemp-server-1 was successfully removed",
    "response_type": "success",
    "response_code": 204
}

Start/Reboot server

Restart a running server or start a stopped server

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "SUBID=61" "https://api.99stack.com/v1/server/reboot"
POST /v1/server/reboot HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

SUBID=61
Status200
Content-Typeapplication/json
{
    "message": "lemp-server-1 successfully rebooted",
    "response_type": "success",
    "response_code": 201
}

Stop server

Force a server to halt, this is the same as pressing the stop button

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "SUBID=47" "https://api.99stack.com/v1/server/stop"
POST /v1/server/stop HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

SUBID=47
Status200
Content-Typeapplication/json
{
    "message": "lemp-server-1 successfully stopped",
    "response_type": "success",
    "response_code": 201
}

Snapshot

Manage snapshots and automatic backups. Create, remove and restore both snapshots and backups.

List snapshots

Returns a JSON formatted list over all snapshots on this account

curl -X GET -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" "https://api.99stack.com/v1/snapshot/list"
GET /v1/snapshot/list HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Status200
Content-Typeapplication/json
{
    "32": {
        "ID": 32,
        "label": "lemp-snapshot",
        "created": "2017-11-28T17:54:22z"
    }
}

Create snapshot

Create a snapshot of a server

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "SUBID=61&label=lemp-snapshot" "https://api.99stack.com/v1/snapshot/create"
POST /v1/snapshot/create HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

SUBID=61&label=lemp-snapshot
Status200
Content-Typeapplication/json
{
    "message": "lemp-snapshot was successfully created from: lemp-server-1",
    "response_type": "success",
    "response_code": 201
}

Remove snapshot

Create a snapshot of a server

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "SNAPSHOTID=32" "https://api.99stack.com/v1/snapshot/remove"
POST /v1/snapshot/remove HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

SNAPSHOTID=32
Status200
Content-Typeapplication/json
{
    "message": "lemp-snapshot was successfully deleted",
    "response_type": "success",
    "response_code": 204
}

Restore snapshot

Restore a server from provided snapshot image

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "SUBID=61&SNAPSHOTID=32" "https://api.99stack.com/v1/snapshot/restore"
POST /v1/snapshot/restore HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

SUBID=61&SNAPSHOTID=32
Status200
Content-Typeapplication/json
{
    "message": "lemp-snapshot was successfully restored to: lemp-server-1",
    "response_type": "success",
    "response_code": 201
}

Restore backup

Restore a server from provided backup image

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq" -d "SUBID=39&BACKUPID=24" "https://api.99stack.com/v1/backup/restore"
POST /v1/backup/restore HTTP/1.1
Host: api.99stack.com
Authorization: Bearer qd9EzSM8V0rBU1vXeX1Kk3dlEZKHFP6wqtkaKPwt67Tsh0mq
Content-Type: application/x-www-form-urlencoded

SUBID=39&BACKUPID=24
Status200
Content-Typeapplication/json
{
    "message": "lemp-snapshot was successfully restored to: lemp-server-1",
    "response_type": "success",
    "response_code": 201
}