v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Load Balancers

Update a Load Balancer

To update a load balancer's settings, send a PUT request to /v2/load_balancers/$LOAD_BALANCER_ID. The request should contain a full representation of the load balancer including existing attributes. It may contain one of the droplets_ids or tag attributes as they are mutually exclusive. Note that any attribute that is not provided will be reset to its default value.

put/v2/load_balancers/{lb_id}

Path parameters

lb_idstring required

A unique identifier for a load balancer.

Request body

OR

Example request

{
  "droplet_ids": [
    3164444,
    3164445
  ],
  "region": "nyc3",
  "id": "4de7ac8b-495b-4884-9a69-1050c6793cd6",
  "name": "example-lb-01",
  "project_id": "4de7ac8b-495b-4884-9a69-1050c6793cd6",
  "ip": "104.131.186.241",
  "ipv6": "2604:a880:800:14::85f5:c000",
  "size_unit": 3,
  "size": "lb-small",
  "algorithm": "round_robin",
  "status": "new",
  "created_at": "2017-02-01T22:22:58Z",
  "forwarding_rules": [
    {
      "entry_protocol": "https",
      "entry_port": 443,
      "target_protocol": "http",
      "target_port": 80,
      "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf"
    }
  ],
  "health_check": {
    "protocol": "http",
    "port": 80,
    "path": "/",
    "check_interval_seconds": 10,
    "response_timeout_seconds": 5,
    "unhealthy_threshold": 5,
    "healthy_threshold": 3
  },
  "sticky_sessions": {
    "type": "cookies",
    "cookie_name": "DO-LB",
    "cookie_ttl_seconds": 300
  },
  "redirect_http_to_https": true,
  "enable_proxy_protocol": true,
  "enable_backend_keepalive": true,
  "http_idle_timeout_seconds": 90,
  "vpc_uuid": "c33931f2-a26a-4e61-b85c-4e95a2ec431b",
  "disable_lets_encrypt_dns_records": true,
  "firewall": {
    "deny": [
      "ip:1.2.3.4",
      "cidr:2.3.0.0/16"
    ],
    "allow": [
      "ip:1.2.3.4",
      "cidr:2.3.0.0/16"
    ]
  },
  "network": "EXTERNAL",
  "network_stack": "IPV4",
  "type": "REGIONAL",
  "domains": [
    {
      "name": "example.com",
      "is_managed": true,
      "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf"
    }
  ],
  "glb_settings": {
    "target_protocol": "http",
    "target_port": 80,
    "cdn": {
      "is_enabled": true
    },
    "region_priorities": {
      "nyc1": 1,
      "fra1": 2,
      "sgp1": 3
    },
    "failover_threshold": 50
  },
  "target_load_balancer_ids": [
    "7dbf91fe-cbdb-48dc-8290-c3a181554905",
    "996fa239-fac3-42a2-b9a1-9fa822268b7a"
  ],
  "tls_cipher_policy": "STRONG"
}

Response

The response will be a JSON object with a key called load_balancer. The value of this will be an object containing the standard attributes of a load balancer.

Example response

{
  "load_balancer": {
    "id": "4de7ac8b-495b-4884-9a69-1050c6793cd6",
    "name": "example-lb-01",
    "project_id": "4de7ac8b-495b-4884-9a69-1050c6793cd6",
    "ip": "104.131.186.241",
    "ipv6": "2604:a880:800:14::85f5:c000",
    "size_unit": 3,
    "size": "lb-small",
    "algorithm": "round_robin",
    "status": "new",
    "created_at": "2017-02-01T22:22:58Z",
    "forwarding_rules": [
      {
        "entry_protocol": "https",
        "entry_port": 443,
        "target_protocol": "http",
        "target_port": 80,
        "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf"
      }
    ],
    "health_check": {
      "protocol": "http",
      "port": 80,
      "path": "/",
      "check_interval_seconds": 10,
      "response_timeout_seconds": 5,
      "unhealthy_threshold": 5,
      "healthy_threshold": 3
    },
    "sticky_sessions": {
      "type": "cookies",
      "cookie_name": "DO-LB",
      "cookie_ttl_seconds": 300
    },
    "redirect_http_to_https": true,
    "enable_proxy_protocol": true,
    "enable_backend_keepalive": true,
    "http_idle_timeout_seconds": 90,
    "vpc_uuid": "c33931f2-a26a-4e61-b85c-4e95a2ec431b",
    "disable_lets_encrypt_dns_records": true,
    "firewall": {
      "deny": [
        "ip:1.2.3.4",
        "cidr:2.3.0.0/16"
      ],
      "allow": [
        "ip:1.2.3.4",
        "cidr:2.3.0.0/16"
      ]
    },
    "network": "EXTERNAL",
    "network_stack": "IPV4",
    "type": "REGIONAL",
    "domains": [
      {
        "name": "example.com",
        "is_managed": true,
        "certificate_id": "892071a0-bb95-49bc-8021-3afd67a210bf"
      }
    ],
    "glb_settings": {
      "target_protocol": "http",
      "target_port": 80,
      "cdn": {
        "is_enabled": true
      },
      "region_priorities": {
        "nyc1": 1,
        "fra1": 2,
        "sgp1": 3
      },
      "failover_threshold": 50
    },
    "target_load_balancer_ids": [
      "7dbf91fe-cbdb-48dc-8290-c3a181554905",
      "996fa239-fac3-42a2-b9a1-9fa822268b7a"
    ],
    "tls_cipher_policy": "STRONG",
    "region": {
      "name": "New York 3",
      "slug": "nyc3",
      "features": [
        "private_networking",
        "backups",
        "ipv6",
        "metadata",
        "install_agent",
        "storage",
        "image_transfer"
      ],
      "available": true,
      "sizes": [
        "s-1vcpu-1gb",
        "s-1vcpu-2gb",
        "s-1vcpu-3gb",
        "s-2vcpu-2gb",
        "s-3vcpu-1gb",
        "s-2vcpu-4gb",
        "s-4vcpu-8gb",
        "s-6vcpu-16gb",
        "s-8vcpu-32gb",
        "s-12vcpu-48gb",
        "s-16vcpu-64gb",
        "s-20vcpu-96gb",
        "s-24vcpu-128gb",
        "s-32vcpu-192g"
      ]
    },
    "droplet_ids": [
      3164444,
      3164445
    ],
    "tag": "prod:web"
  }
}