VPC

VPC (Virtual Private Cloud) is the product umbrella containing networking-related features in Civo. The /v2/vpc/* endpoints provide a unified namespace for managing all VPC-related resources.

These endpoints are aliases for the existing networking endpoints. Both paths work identically and return the same data. The original paths remain as the primary endpoints with no breaking changes.

VPC Resource Structure

/v2/vpc/
├── networks       (alias for /v2/networks)
├── firewalls      (alias for /v2/firewalls)
├── loadbalancers  (alias for /v2/loadbalancers)
└── ips            (alias for /v2/ips)

VPC Networks

VPC Networks allow you to manage private networks for your account. The /v2/vpc/networks endpoints are aliases for /v2/networks — both paths work identically and return the same data.


List VPC networks

A list of all networks is available by sending a GET request to https://api.civo.com/v2/vpc/networks.

Request

This request accepts an optional region parameter (query string) containing the name of the region.

Response

The response is a JSON array of network objects.

[
    {
        "id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
        "name": "cust-default-12f8eee7-7505a5e9e49b",
        "default": true,
        "cidr": "192.168.1.0/24",
        "gateway_ipv4": "192.168.1.1",
        "label": "default",
        "status": "Active",
        "ipv4_enabled": true,
        "nameservers_v4": [
            "8.8.8.8",
            "1.1.1.1"
        ],
        "free_ip_count": 253
    }
]

Example of listing VPC networks

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/networks?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/networks?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/networks?region=LON1', headers)

Retrieve a VPC network

A single network's details are available by sending a GET request to https://api.civo.com/v2/vpc/networks/:id.

Request

This request requires the ID parameter in the URL.

Response

The response is a JSON object with the network details.

{
    "id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
    "name": "cust-default-12f8eee7-7505a5e9e49b",
    "default": true,
    "cidr": "192.168.1.0/24",
    "gateway_ipv4": "192.168.1.1",
    "label": "default",
    "status": "Active",
    "ipv4_enabled": true,
    "nameservers_v4": [
        "8.8.8.8",
        "1.1.1.1"
    ],
    "free_ip_count": 253
}

Example of retrieving a VPC network

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/networks/5c0dfd42-bbf1-495b-b39c-1de1b087962c
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/networks/5c0dfd42-bbf1-495b-b39c-1de1b087962c',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/networks/5c0dfd42-bbf1-495b-b39c-1de1b087962c', headers)

Create a VPC network

Creating a VPC network is done by sending a POST request to https://api.civo.com/v2/vpc/networks.

Request

The following parameters should be sent along with the request:

Name Description
label (required) a string that will be the displayed name/reference for the network
region (optional) the identifier for the region, from the current region list
ipv4_enabled (optional) whether IPv4 is enabled for this network (defaults to true)
cidr_v4 (optional) an RFC 1918-compliant CIDR for the IP address range
nameservers_v4 (optional) a comma-separated list of IPv4 addresses for DNS name servers

Response

The response is a JSON object confirming the creation.

{
    "id": "89843320-78dd-44e4-956e-96f79dd5a928",
    "result": "success",
    "name": "cust-my-network-12f8eee7-62373dcf0621",
    "label": "my-network"
}

Example of creating a VPC network

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X POST https://api.civo.com/v2/vpc/networks?region=LON1 \
  -d '{"label": "my-network", "ipv4_enabled": true}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.post(
  'https://api.civo.com/v2/vpc/networks?region=LON1',
  {
    json: {
      label: 'my-network',
      ipv4_enabled: true
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { label: 'my-network', ipv4_enabled: true }.to_json
resp, data = http.post('/v2/vpc/networks?region=LON1', body, headers)

Update a VPC network

Updating a VPC network is done by sending a PUT request to https://api.civo.com/v2/vpc/networks/:id.

Request

Name Description
label (required) a string that will be the new displayed name/reference for the network
region (required) the identifier for the region

Response

The response is a JSON object confirming the update.

{
    "id": "89843320-78dd-44e4-956e-96f79dd5a928",
    "result": "success",
    "label": "my-updated-network"
}

Example of updating a VPC network

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X PUT https://api.civo.com/v2/vpc/networks/8c97b398-3aaf-4e53-beb1-c40500dc0065 \
  -d '{"label": "my-updated-network", "region": "LON1"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.put(
  'https://api.civo.com/v2/vpc/networks/8c97b398-3aaf-4e53-beb1-c40500dc0065',
  {
    json: {
      label: 'my-updated-network',
      region: 'LON1'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { label: 'my-updated-network', region: 'LON1' }.to_json
resp, data = http.put('/v2/vpc/networks/8c97b398-3aaf-4e53-beb1-c40500dc0065', body, headers)

Delete a VPC network

Deleting a VPC network is done by sending a DELETE request to https://api.civo.com/v2/vpc/networks/:id.

Request

This request requires the ID parameter in the URL and a region query parameter.

Response

{
    "result": "success"
}

Example of deleting a VPC network

curl -H "Authorization: bearer 12345" \
  -X DELETE https://api.civo.com/v2/vpc/networks/8c97b398-3aaf-4e53-beb1-c40500dc0065?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.del(
  'https://api.civo.com/v2/vpc/networks/8c97b398-3aaf-4e53-beb1-c40500dc0065?region=LON1',
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.delete('/v2/vpc/networks/8c97b398-3aaf-4e53-beb1-c40500dc0065?region=LON1', headers)

VPC Firewalls

VPC Firewalls allow you to manage security rules for your network. The /v2/vpc/firewalls endpoints are aliases for /v2/firewalls — both paths work identically and return the same data.


List VPC firewalls

A list of all firewalls is available by sending a GET request to https://api.civo.com/v2/vpc/firewalls.

Request

This request accepts an optional region parameter (query string).

Response

[
    {
        "id": "b771934a-e396-40b7-b7d4-256176f40932",
        "name": "my-firewall",
        "account_id": "12f8eee7-4968-4d1e-ba3c-171c0741fa57",
        "rules_count": 6,
        "instance_count": 0,
        "cluster_count": 0,
        "loadbalancer_count": 0,
        "default": "false",
        "label": "",
        "network_id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
        "rules": [
            {
                "id": "41246d56-9b38-4aa6-b5da-bb92b54e5767",
                "protocol": "tcp",
                "start_port": "443",
                "cidr": ["0.0.0.0/0"],
                "direction": "ingress",
                "label": "HTTPS",
                "end_port": "443",
                "action": "allow",
                "ports": "443"
            }
        ]
    }
]

Example of listing VPC firewalls

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/firewalls?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/firewalls?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/firewalls?region=LON1', headers)

Create a VPC firewall

Creating a VPC firewall is done by sending a POST request to https://api.civo.com/v2/vpc/firewalls.

Request

Name Description
name (required) a unique name for this firewall
network_id (required) the network ID for the network to create the firewall in
region (required) the identifier for the region
create_default_rules (optional) whether to create default firewall rules (defaults to true)

Response

{
    "id": "b771934a-e396-40b7-b7d4-256176f40932",
    "result": "success",
    "name": "my-firewall"
}

Example of creating a VPC firewall

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X POST https://api.civo.com/v2/vpc/firewalls?region=LON1 \
  -d '{"name": "my-firewall", "network_id": "5c16ab17-933a-46ed-96c6-8a093a0179e1"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.post(
  'https://api.civo.com/v2/vpc/firewalls?region=LON1',
  {
    json: {
      name: 'my-firewall',
      network_id: '5c16ab17-933a-46ed-96c6-8a093a0179e1'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { name: 'my-firewall', network_id: '5c16ab17-933a-46ed-96c6-8a093a0179e1' }.to_json
resp, data = http.post('/v2/vpc/firewalls?region=LON1', body, headers)

Retrieve a VPC firewall

Get firewall details by sending a GET request to https://api.civo.com/v2/vpc/firewalls/:id.

Request

This request requires the ID parameter in the URL and accepts a region query parameter.

Response

{
    "id": "b771934a-e396-40b7-b7d4-256176f40932",
    "name": "my-firewall",
    "account_id": "12f8eee7-4968-4d1e-ba3c-171c0741fa57",
    "rules_count": 6,
    "instance_count": 0,
    "cluster_count": 0,
    "loadbalancer_count": 0,
    "default": "false",
    "label": "",
    "network_id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
    "rules": [
        {
            "id": "41246d56-9b38-4aa6-b5da-bb92b54e5767",
            "protocol": "tcp",
            "start_port": "443",
            "cidr": ["0.0.0.0/0"],
            "direction": "ingress",
            "label": "HTTPS",
            "end_port": "443",
            "action": "allow",
            "ports": "443"
        }
    ]
}

Example of retrieving a VPC firewall

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1', headers)

Update a VPC firewall

Update a VPC firewall by sending a PUT request to https://api.civo.com/v2/vpc/firewalls/:id.

Request

Name Description
name (optional) a new name for this firewall
region (required) the identifier for the region

Response

{
    "id": "b771934a-e396-40b7-b7d4-256176f40932",
    "result": "success",
    "name": "my-updated-firewall"
}

Example of updating a VPC firewall

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X PUT https://api.civo.com/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1 \
  -d '{"name": "my-updated-firewall"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.put(
  'https://api.civo.com/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1',
  {
    json: {
      name: 'my-updated-firewall'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { name: 'my-updated-firewall' }.to_json
resp, data = http.put('/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1', body, headers)

Delete a VPC firewall

Delete a firewall by sending a DELETE request to https://api.civo.com/v2/vpc/firewalls/:id.

Request

This request requires the ID parameter in the URL and a region query parameter.

Response

{
    "result": "success"
}

Example of deleting a VPC firewall

curl -H "Authorization: bearer 12345" \
  -X DELETE https://api.civo.com/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.del(
  'https://api.civo.com/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1',
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.delete('/v2/vpc/firewalls/af5f3bae-38f7-496c-9561-283ae1349915?region=LON1', headers)

VPC Firewall Rules

Manage firewall rules within VPC firewalls.


List firewall rules

A list of firewall rules is available by sending a GET request to https://api.civo.com/v2/vpc/firewalls/:firewall_id/rules.

Request

This request requires the firewall ID parameter in the URL and accepts a region query parameter.

Response

[
    {
        "id": "5494d4cc-01cd-49fc-9419-1b08c4a15ee2",
        "firewall_id": "b771934a-e396-40b7-b7d4-256176f40932",
        "protocol": "tcp",
        "start_port": "443",
        "cidr": ["0.0.0.0/0"],
        "direction": "ingress",
        "label": "HTTPS",
        "end_port": "443",
        "action": "allow",
        "ports": "443"
    }
]

Example of listing firewall rules

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules?region=LON1', headers)

Create a firewall rule

Creating a firewall rule is done by sending a POST request to https://api.civo.com/v2/vpc/firewalls/:firewall_id/rules.

Request

Name Description
region (required) the identifier for the region
protocol (required) the protocol: tcp, udp or icmp
start_port (required) the start of the port range (or single port)
end_port (optional) the end of the port range
cidr (optional) the CIDR notation (defaults to 0.0.0.0/0)
direction (optional) ingress or egress (defaults to ingress)
label (optional) a label for the rule
action (optional) allow or deny (defaults to allow)

Response

{
    "id": "5494d4cc-01cd-49fc-9419-1b08c4a15ee2",
    "firewall_id": "b771934a-e396-40b7-b7d4-256176f40932",
    "protocol": "tcp",
    "start_port": "443",
    "cidr": ["0.0.0.0/0"],
    "direction": "ingress",
    "label": "HTTPS",
    "end_port": "443",
    "action": "allow"
}

Example of creating a firewall rule

curl -H "Authorization: bearer 12345" \
  -X POST https://api.civo.com/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules \
  -d "region=LON1&protocol=tcp&start_port=443"
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.post(
  'https://api.civo.com/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules',
  {
    form: {
      region: 'LON1',
      protocol: 'tcp',
      start_port: '443'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'uri'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

body = URI.encode_www_form(region: 'LON1', protocol: 'tcp', start_port: '443')
resp, data = http.post('/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules', body, headers)

Update a firewall rule

Update a firewall rule by sending a PUT request to https://api.civo.com/v2/vpc/firewalls/:firewall_id/rules/:rule_id.

Request

Name Description
region (required) the identifier for the region
protocol (optional) the protocol: tcp, udp or icmp
start_port (optional) the start of the port range (or single port)
end_port (optional) the end of the port range
cidr (optional) the CIDR notation
direction (optional) ingress or egress
label (optional) a label for the rule

Response

{
    "id": "5494d4cc-01cd-49fc-9419-1b08c4a15ee2",
    "result": "success"
}

Example of updating a firewall rule

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X PUT https://api.civo.com/v2/vpc/firewalls/b771934a-e396-40b7-b7d4-256176f40932/rules/5494d4cc-01cd-49fc-9419-1b08c4a15ee2?region=LON1 \
  -d '{"protocol": "tcp", "start_port": "8080", "label": "Updated rule"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.put(
  'https://api.civo.com/v2/vpc/firewalls/b771934a-e396-40b7-b7d4-256176f40932/rules/5494d4cc-01cd-49fc-9419-1b08c4a15ee2?region=LON1',
  {
    json: {
      protocol: 'tcp',
      start_port: '8080',
      label: 'Updated rule'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { protocol: 'tcp', start_port: '8080', label: 'Updated rule' }.to_json
resp, data = http.put('/v2/vpc/firewalls/b771934a-e396-40b7-b7d4-256176f40932/rules/5494d4cc-01cd-49fc-9419-1b08c4a15ee2?region=LON1', body, headers)

Delete a firewall rule

Delete a firewall rule by sending a DELETE request to https://api.civo.com/v2/vpc/firewalls/:firewall_id/rules/:rule_id.

Request

This request requires the firewall ID and rule ID parameters in the URL and a region query parameter.

Response

{
    "id": "b771934a-e396-40b7-b7d4-256176f40932",
    "result": "success",
    "name": "my-firewall"
}

Example of deleting a firewall rule

curl -H "Authorization: bearer 12345" \
  -X DELETE https://api.civo.com/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules/becc5419-510e-4385-9c69-d038622e4e08?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.del(
  'https://api.civo.com/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules/becc5419-510e-4385-9c69-d038622e4e08?region=LON1',
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.delete('/v2/vpc/firewalls/663ee5a0-d3a6-4b5b-9a93-144fcd48d6a7/rules/becc5419-510e-4385-9c69-d038622e4e08?region=LON1', headers)

VPC Load Balancers

VPC Load Balancers allow you to distribute traffic across multiple instances. The /v2/vpc/loadbalancers endpoints are aliases for /v2/loadbalancers — both paths work identically and return the same data.


List VPC load balancers

A list of all load balancers is available by sending a GET request to https://api.civo.com/v2/vpc/loadbalancers.

Request

This request requires a region parameter (query string).

Response

The response is a JSON array of load balancer objects.

[
    {
        "id": "108c493b-e2af-4a99-87be-6bf56dad1249",
        "name": "my-loadbalancer",
        "network_id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
        "service_name": "my-loadbalancer",
        "algorithm": "round_robin",
        "backends": [
            {
                "ip": "192.168.1.10",
                "protocol": "TCP",
                "source_port": 80,
                "target_port": 80
            }
        ],
        "public_ip": "31.28.88.164",
        "private_ip": "192.168.1.2",
        "firewall_id": "7799cc54-e0bc-4217-a53c-d358e22b3f8b",
        "state": "available",
        "max_concurrent_requests": 10000,
        "created_at": "2026-02-05T15:00:56Z"
    }
]

Example of listing load balancers

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/loadbalancers?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/loadbalancers?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/loadbalancers?region=LON1', headers)

Create a VPC load balancer

Create a load balancer by sending a POST request to https://api.civo.com/v2/vpc/loadbalancers.

Request

Name Description
name (required) a name for the load balancer
network_id (required) the network ID to create the load balancer in
region (required) the identifier for the region
algorithm (optional) load balancing algorithm: round_robin, least_connections (defaults to round_robin)
external_traffic_policy (optional) Cluster or Local
session_affinity (optional) None or ClientIP
session_affinity_config_timeout (optional) timeout in seconds for session affinity
enable_proxy_protocol (optional) send, accept, or send_accept
backends (required) an array of backend objects, each containing ip, protocol (TCP or UDP), source_port, and target_port
max_concurrent_requests (optional) maximum number of concurrent requests (defaults to 10000)

Response

{
    "id": "108c493b-e2af-4a99-87be-6bf56dad1249",
    "name": "my-loadbalancer",
    "network_id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
    "algorithm": "round_robin",
    "backends": [
        {
            "ip": "192.168.1.10",
            "protocol": "TCP",
            "source_port": 80,
            "target_port": 80
        }
    ],
    "public_ip": "",
    "private_ip": "",
    "firewall_id": "7799cc54-e0bc-4217-a53c-d358e22b3f8b",
    "state": "",
    "max_concurrent_requests": 10000,
    "created_at": "2026-02-05T15:00:56Z"
}

Example of creating a load balancer

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X POST https://api.civo.com/v2/vpc/loadbalancers?region=LON1 \
  -d '{
    "name": "my-loadbalancer",
    "network_id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
    "backends": [
        {"ip": "192.168.1.10", "protocol": "TCP", "source_port": 80, "target_port": 80}
    ]
}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.post(
  'https://api.civo.com/v2/vpc/loadbalancers?region=LON1',
  {
    json: {
      name: 'my-loadbalancer',
      network_id: 'fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370',
      backends: [
        { ip: '192.168.1.10', protocol: 'TCP', source_port: 80, target_port: 80 }
      ]
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = {
  name: 'my-loadbalancer',
  network_id: 'fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370',
  backends: [
    { ip: '192.168.1.10', protocol: 'TCP', source_port: 80, target_port: 80 }
  ]
}.to_json
resp, data = http.post('/v2/vpc/loadbalancers?region=LON1', body, headers)

Retrieve a VPC load balancer

Get load balancer details by sending a GET request to https://api.civo.com/v2/vpc/loadbalancers/:id.

Request

This request requires the ID parameter in the URL and accepts a region query parameter.

Response

{
    "id": "108c493b-e2af-4a99-87be-6bf56dad1249",
    "name": "my-loadbalancer",
    "network_id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
    "service_name": "my-loadbalancer",
    "algorithm": "round_robin",
    "backends": [
        {
            "ip": "192.168.1.10",
            "protocol": "TCP",
            "source_port": 80,
            "target_port": 80
        }
    ],
    "public_ip": "31.28.88.164",
    "private_ip": "192.168.1.2",
    "firewall_id": "7799cc54-e0bc-4217-a53c-d358e22b3f8b",
    "state": "available",
    "max_concurrent_requests": 10000,
    "created_at": "2026-02-05T15:00:56Z"
}

Example of retrieving a load balancer

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/loadbalancers/abc123?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/loadbalancers/abc123?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/loadbalancers/abc123?region=LON1', headers)

Update a VPC load balancer

Update a load balancer by sending a PUT request to https://api.civo.com/v2/vpc/loadbalancers/:id.

Request

Name Description
name (optional) a new name for the load balancer
algorithm (optional) load balancing algorithm
external_traffic_policy (optional) Cluster or Local
session_affinity (optional) None or ClientIP
enable_proxy_protocol (optional) send, accept, or send_accept
backends (optional) an array of backend objects to update

Response

{
    "id": "108c493b-e2af-4a99-87be-6bf56dad1249",
    "name": "my-updated-loadbalancer",
    "network_id": "fb7d9b34-d7a0-4f99-8a0f-c8d59dec9370",
    "service_name": "my-loadbalancer",
    "algorithm": "least_connections",
    "backends": [
        {
            "ip": "192.168.1.10",
            "protocol": "TCP",
            "source_port": 80,
            "target_port": 80
        }
    ],
    "public_ip": "31.28.88.164",
    "private_ip": "192.168.1.2",
    "firewall_id": "7799cc54-e0bc-4217-a53c-d358e22b3f8b",
    "state": "available",
    "max_concurrent_requests": 10000,
    "created_at": "2026-02-05T15:00:56Z"
}

Example of updating a load balancer

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X PUT https://api.civo.com/v2/vpc/loadbalancers/108c493b-e2af-4a99-87be-6bf56dad1249?region=LON1 \
  -d '{"name": "my-updated-loadbalancer", "algorithm": "least_connections"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.put(
  'https://api.civo.com/v2/vpc/loadbalancers/108c493b-e2af-4a99-87be-6bf56dad1249?region=LON1',
  {
    json: {
      name: 'my-updated-loadbalancer',
      algorithm: 'least_connections'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { name: 'my-updated-loadbalancer', algorithm: 'least_connections' }.to_json
resp, data = http.put('/v2/vpc/loadbalancers/108c493b-e2af-4a99-87be-6bf56dad1249?region=LON1', body, headers)

Delete a VPC load balancer

Delete a load balancer by sending a DELETE request to https://api.civo.com/v2/vpc/loadbalancers/:id.

Request

This request requires the ID parameter in the URL and a region query parameter.

Response

{
    "result": "success"
}

Example of deleting a load balancer

curl -H "Authorization: bearer 12345" \
  -X DELETE https://api.civo.com/v2/vpc/loadbalancers/108c493b-e2af-4a99-87be-6bf56dad1249?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.del(
  'https://api.civo.com/v2/vpc/loadbalancers/108c493b-e2af-4a99-87be-6bf56dad1249?region=LON1',
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.delete('/v2/vpc/loadbalancers/108c493b-e2af-4a99-87be-6bf56dad1249?region=LON1', headers)

VPC Reserved IPs

VPC Reserved IPs allow you to reserve and manage static IP addresses. The /v2/vpc/ips endpoints are aliases for /v2/ips — both paths work identically and return the same data.


List VPC reserved IPs

A list of all reserved IPs is available by sending a GET request to https://api.civo.com/v2/vpc/ips.

Request

This request requires a region parameter (query string). Optional pagination parameters page and per_page are also supported.

Response

The response is a paginated JSON object containing an array of reserved IP items.

{
    "page": 1,
    "per_page": 20,
    "pages": 1,
    "items": [
        {
            "id": "c4edf741-1436-42a1-b145-dcfa23264a82",
            "name": "my-reserved-ip",
            "ip": "31.28.88.216"
        }
    ]
}

Example of listing reserved IPs

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/ips?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/ips?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/ips?region=LON1', headers)

Create a VPC reserved IP

Creating a reserved IP is done by sending a POST request to https://api.civo.com/v2/vpc/ips.

Request

Name Description
name (required) a name for the reserved IP
region (required) the identifier for the region

Response

{
    "id": "c4edf741-1436-42a1-b145-dcfa23264a82",
    "name": "my-reserved-ip"
}

Example of creating a reserved IP

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X POST https://api.civo.com/v2/vpc/ips?region=LON1 \
  -d '{"name": "my-reserved-ip"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.post(
  'https://api.civo.com/v2/vpc/ips?region=LON1',
  {
    json: {
      name: 'my-reserved-ip'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { name: 'my-reserved-ip' }.to_json
resp, data = http.post('/v2/vpc/ips?region=LON1', body, headers)

Retrieve a VPC reserved IP

Get reserved IP details by sending a GET request to https://api.civo.com/v2/vpc/ips/:id.

Request

This request requires the ID parameter in the URL and accepts a region query parameter.

Response

{
    "id": "c4edf741-1436-42a1-b145-dcfa23264a82",
    "name": "my-reserved-ip",
    "ip": "31.28.88.216",
    "assigned_to": {}
}

Example of retrieving a reserved IP

curl -H "Authorization: bearer 12345" \
  https://api.civo.com/v2/vpc/ips/abc123?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.get(
  'https://api.civo.com/v2/vpc/ips/abc123?region=LON1',
  {},
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.get('/v2/vpc/ips/abc123?region=LON1', headers)

Update a VPC reserved IP

Update a reserved IP by sending a PUT request to https://api.civo.com/v2/vpc/ips/:id.

Request

Name Description
name (optional) a new name for the reserved IP
region (required) the identifier for the region

Response

{
    "id": "c4edf741-1436-42a1-b145-dcfa23264a82",
    "name": "my-updated-ip"
}

Example of updating a reserved IP

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X PUT https://api.civo.com/v2/vpc/ips/abc123?region=LON1 \
  -d '{"name": "my-updated-ip"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.put(
  'https://api.civo.com/v2/vpc/ips/abc123?region=LON1',
  {
    json: {
      name: 'my-updated-ip'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { name: 'my-updated-ip' }.to_json
resp, data = http.put('/v2/vpc/ips/abc123?region=LON1', body, headers)

Delete a VPC reserved IP

Delete a reserved IP by sending a DELETE request to https://api.civo.com/v2/vpc/ips/:id.

Request

This request requires the ID parameter in the URL and a region query parameter.

Response

{
    "result": "success"
}

Example of deleting a reserved IP

curl -H "Authorization: bearer 12345" \
  -X DELETE https://api.civo.com/v2/vpc/ips/abc123?region=LON1
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.del(
  'https://api.civo.com/v2/vpc/ips/abc123?region=LON1',
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/x-www-form-urlencoded'
}

resp, data = http.delete('/v2/vpc/ips/abc123?region=LON1', headers)

Perform an action on a VPC reserved IP

Perform an action (such as assign or unassign) on a reserved IP by sending a POST request to https://api.civo.com/v2/vpc/ips/:id/actions.

Request

Name Description
action (required) the action to perform: assign or unassign
assign_to_id (required for assign) the ID of the resource to assign the IP to
region (required) the identifier for the region

Response

{
    "result": "success"
}

Example of assigning a reserved IP

curl -H "Authorization: bearer 12345" \
  -H "Content-Type: application/json" \
  -X POST https://api.civo.com/v2/vpc/ips/abc123/actions?region=LON1 \
  -d '{"action": "assign", "assign_to_id": "instance-uuid"}'
// At a shell prompt run:
// npm init -y
// npm i --save request

var request = require('request');

request.post(
  'https://api.civo.com/v2/vpc/ips/abc123/actions?region=LON1',
  {
    json: {
      action: 'assign',
      assign_to_id: 'instance-uuid'
    }
  },
  function (error, response, body) {
    if (!error && response.statusCode == 200) {
      console.log(body)
    }
  }
).auth(null, null, true, '12345');
require 'net/http'
require 'json'

http = Net::HTTP.new('api.civo.com', 443)
http.use_ssl = true

headers = {
  'Authorization' => 'bearer 12345',
  'Content-Type' => 'application/json'
}

body = { action: 'assign', assign_to_id: 'instance-uuid' }.to_json
resp, data = http.post('/v2/vpc/ips/abc123/actions?region=LON1', body, headers)