API

Regions

Civo will be hosted in multiple datacentres (a.k.a. regions), with more coming online all the time. You can choose when creating an instance which region to have it hosted in (necessary if you want to share a private network between your instances) - or you can leave it for Civo to allocate you to a region if you don't care.


Listing available regions

Listing the available regions is possible by making a GET request to the https://api.civo.com/v2/regions resource.

Request

This request doesn't take any parameters.

Response

The response from the server will be a JSON array of regions.

[
  {
    "code":"svg1",
  },
  // ...
]

Example of listing available regions

curl -H "Authorization: bearer 12345" https://api.civo.com/v2/regions
var request = require('request');

request.get(
  'https://api.civo.com/v2/regions',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
http = Net::HTTPS.new('api.civo.com', 443)
headers = {
  'Authorization' => 'bearer 123456',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = get('v2/regions', headers)