Quick Start guide to Gigas Api

Summary

In this tutorial we will go through all the required steps to create a virtual machine and confirm its creation.

Requirements

In order to follow this tutorial you’ll need some application that allows to make requests to a web server through different HTTP methods (GET, POST, PUT, DELETE). Some examples are:

  • Curl.

  • An app called Postman.

  • Any other rest client or programming library.

Conventions through the tutorial

We will be using curl through this document as it is commonly installed in many linux distributions, but everything should be easily translated to any other tool you decide to use.

url

https://api.gigas.com

For brevity we will write the API key as:

apikey

YOUR_API_KEY

Authentication

The recommended way to authenticate with the API is using an API key. API keys are long-lived credentials that do not require a login step. See the API Keys section for full details on how to create and manage them.

Pass the API key in the Authorization header with the Bearer prefix on every request:

curl --request GET \
  --url https://api.gigas.com/accounts \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json'

Use this header in all subsequent requests throughout this tutorial.

Alternative authentication

You can also authenticate using your username and password to obtain a session token. Follow the instructions in the Authentication section for full details.

Your username and password for the API are the email and password you used for registering in Gigas.

As a quick example, if your account does not have two-factor authentication (2FA) enabled, you can obtain a token with a single request:

curl --request POST \
  --url https://api.gigas.com/token \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{
    "login": "email",
    "password": "password",
    "readonly": false
  }'

Which will return something like:

{
    "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expires": 1772035400,
    "refresh_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refresh_expires": 1772036900
}

Use the value of token in the Authorization header in all subsequent requests.

Note

If two-factor authentication (2FA) is enabled for your account, the request above will fail. In this case, you must include an additional totp parameter in the JSON body containing the 6-digit code generated by your mobile authenticator app:

{
    "login": "email",
    "password": "password",
    "totp": "123456",
    "readonly": false
}

Identifying your Account

Most API endpoints are scoped to a specific account, which represents a contracted service in Gigas (a virtual machine plan, a backup service, etc.). A single user can have multiple accounts.

Before proceeding, you need to know the id of the account you want to operate on. Refer to the Accounts section for a full explanation and to learn how to retrieve your account list.

In short, you can list all your accounts with:

curl --request GET \
  --url https://api.gigas.com/accounts \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Which returns something like:

[
    {
        "id": 22666,
        "client_id": 7741,
        "order_id": 125879,
        "product_id": 193,
        "category_slug": "cloud-datacenter",
        "date_created": "2025-11-06",
        "domain": "activitydc.dc",
        "status": "Active",
        "billingcycle": "Monthly",
        "next_due": "2025-12-06",
        "location_id": "Global",
        "is_trial": false,
        "ppu_activated": true
    }
]

Pick the id of the account you want to use and replace ACCOUNT_ID with it in all subsequent calls throughout this tutorial.

Listing Locations

Before creating a virtual machine you need to choose a location (datacenter) where it will be hosted. You can retrieve the available locations for your account with:

curl --request GET \
  --url https://api.gigas.com/account/ACCOUNT_ID/locations \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json'

Which returns:

[
    {
        "id": "226661012",
        "label": "Spain",
        "updated_at": "2017-01-16T12:03:49",
        "created_at": "2017-01-16T12:03:49",
        "account_id": 22666
    },
    {
        "id": "226661013",
        "label": "Miami",
        "updated_at": null,
        "created_at": "2017-01-16T12:03:53",
        "account_id": 22666
    }
]

Pick the id of the desired location and replace LOCATION_ID with it in the creation command below.

Listing Templates

You also need a template (operating system image) for the virtual machine. To list available templates:

curl --request GET \
  --url 'https://api.gigas.com/account/ACCOUNT_ID/templates' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json'

Which will produce output like:

[
    {
        "id": "226661012",
        "label": "CentOS 6.0 x64 (Linux)",
        "status": "active",
        "operating_system": "linux",
        "operating_system_arch": "x64",
        "operating_system_distro": "rhel",
        "min_disk_size": 0,
        "min_memory_size": 0,
        "allowed_swap": 1,
        "public": true,
        "account_id": 22666
    },
    {
        "id": "226661014",
        "label": "CentOS 6.9 + cPanel 11 x64 (Linux) (NL)",
        "status": "active",
        "operating_system": "linux",
        "operating_system_arch": "x64",
        "operating_system_distro": "rhel",
        "min_disk_size": 5,
        "min_memory_size": 0,
        "allowed_swap": 1,
        "public": true,
        "account_id": 22666
    },
    {
        "id": "2266610116",
        "label": "Debian 7 x64 (Linux)",
        "status": "active",
        "operating_system": "linux",
        "operating_system_arch": "x64",
        "operating_system_distro": "ubuntu",
        "min_disk_size": 5,
        "min_memory_size": 0,
        "allowed_swap": 1,
        "public": true,
        "account_id": 22666
    }
]

Pick the id of the desired template and replace TEMPLATE_ID with it in the creation command below. Also note min_disk_size and min_memory_size for minimum requirements.

Creation of a virtual machine

As an example of a POST request with queue, we will be creating a virtual machine.

Checking out the documentation for creating a virtual machine we can see the following information:

Method

POST

Url

/account/<account_id>/virtual_machine

Success Code

202

Returned Data

Virtual machine resource

Has Token

Yes

From that section we know it is a POST method request, its url, and that it will return a queue token meaning that it will take a small amount of time until the virtual machine is fully built.

With the ACCOUNT_ID, LOCATION_ID and TEMPLATE_ID values gathered in previous steps, we can create a virtual machine with the following command:

curl --request POST \
  --url https://api.gigas.com/account/ACCOUNT_ID/virtual_machine \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "label": "mynewserver",
    "note": "",
    "memory": 512,
    "cpus": 1,
    "cpu_type": "intel",
    "template_id": "TEMPLATE_ID",
    "hostname": "mynewserver",
    "location_id": "LOCATION_ID",
    "primary_disk_size": 5,
    "swap_disk_size": 1,
    "default_firewall_policy": "ACCEPT",
    "initial_root_password": "yourpassword"
  }'

Which will output something like:

{
    "id": "226661014786",
    "label": "mynewserver",
    "hostname": "mynewserver",
    "status": "unbuilt",
    "locked": true,
    "memory": 512,
    "cpus": 1,
    "cpu_type": "intel",
    "disk_type": "virtio",
    "disk_prefix": "vd",
    "boot_type": "default",
    "booted_from": "hd",
    "location_id": "226661012",
    "hypervisor_id": "226661013",
    "template_id": "2266610116",
    "initial_password": "yourpassword",
    "remote_access_password": null,
    "local_remote_access_port": null,
    "operating_system": null,
    "operating_system_distro": null,
    "identifier": "4uxj2anxy5ddxp",
    "type": "standard",
    "cpu_shares": 1,
    "account_id": 22666,
    "user_id": "226661014577",
    "created_at": "2026-02-25T15:55:33",
    "updated_at": "2026-02-25T15:55:33",
    "error": 0,
    "queue_token": "dd8014ab-82ca-4f0b-a5f4-588d1237dc3c"
}

Note the id of the virtual machine — you will need it for future operations. The queue_token serves as the transaction identifier; you will need to use this value in the next step to poll the build status via the transactions endpoint.

Checking queue status

Having copied the queue_token value from the response, you can query the build status with:

curl --request GET \
  --url https://api.gigas.com/account/ACCOUNT_ID/transaction/dd8014ab-82ca-4f0b-a5f4-588d1237dc3c/status \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json'

While the virtual machine is being built it will output:

{"status": "pending"}

And once it is ready:

{
    "status": "Completed",
    "updated_at": "2026-02-25 15:56:54"
}

Ask for help if you need it

At Gigas Hosting, we hope to have provided you with all the information you need to use the Api to your best interests, but in case something is not clear enough or there is any inaccuracy, please contact our awesome support team so we can solve it as soon as possible.