v8

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

Update a Firewall

To update the configuration of an existing firewall, send a PUT request to /v2/firewalls/$FIREWALL_ID. The request should contain a full representation of the firewall including existing attributes. Note that any attributes that are not provided will be reset to their default values. <br><br>You must have read access (e.g. droplet:read) to all resources attached to the firewall to successfully update the firewall.

put/v2/firewalls/{firewall_id}

Path parameters

firewall_idstring uuid required

A unique ID that can be used to identify and reference a firewall.

Request body

OR

Example request

{
  "id": "bb4b2611-3d72-467b-8602-280330ecd65c",
  "status": "waiting",
  "created_at": "2020-05-23T21:24:00Z",
  "pending_changes": [
    {
      "droplet_id": 8043964,
      "removing": false,
      "status": "waiting"
    }
  ],
  "name": "firewall",
  "droplet_ids": [
    8043964
  ],
  "inbound_rules": [
    {
      "protocol": "tcp",
      "ports": "8000",
      "sources": {
        "addresses": [
          "1.2.3.4",
          "18.0.0.0/8"
        ],
        "droplet_ids": [
          8043964
        ],
        "load_balancer_uids": [
          "4de7ac8b-495b-4884-9a69-1050c6793cd6"
        ],
        "kubernetes_ids": [
          "41b74c5d-9bd0-5555-5555-a57c495b81a3"
        ],
        "tags": [
          "frontend"
        ]
      }
    }
  ],
  "outbound_rules": [
    {
      "protocol": "tcp",
      "ports": "8000",
      "destinations": {
        "addresses": [
          "1.2.3.4",
          "18.0.0.0/8"
        ],
        "droplet_ids": [
          8043964
        ],
        "load_balancer_uids": [
          "4de7ac8b-495b-4884-9a69-1050c6793cd6"
        ],
        "kubernetes_ids": [
          "41b74c5d-9bd0-5555-5555-a57c495b81a3"
        ],
        "tags": [
          "frontend"
        ]
      }
    }
  ]
}

Response

The response will be a JSON object with a firewall key. This will be set to an object containing the standard firewall attributes.

Example response

{
  "firewall": {
    "id": "bb4b2611-3d72-467b-8602-280330ecd65c",
    "status": "waiting",
    "created_at": "2020-05-23T21:24:00Z",
    "pending_changes": [
      {
        "droplet_id": 8043964,
        "removing": false,
        "status": "waiting"
      }
    ],
    "name": "firewall",
    "droplet_ids": [
      8043964
    ],
    "inbound_rules": [
      {
        "protocol": "tcp",
        "ports": "8000",
        "sources": {
          "addresses": [
            "1.2.3.4",
            "18.0.0.0/8"
          ],
          "droplet_ids": [
            8043964
          ],
          "load_balancer_uids": [
            "4de7ac8b-495b-4884-9a69-1050c6793cd6"
          ],
          "kubernetes_ids": [
            "41b74c5d-9bd0-5555-5555-a57c495b81a3"
          ],
          "tags": [
            "frontend"
          ]
        }
      }
    ],
    "outbound_rules": [
      {
        "protocol": "tcp",
        "ports": "8000",
        "destinations": {
          "addresses": [
            "1.2.3.4",
            "18.0.0.0/8"
          ],
          "droplet_ids": [
            8043964
          ],
          "load_balancer_uids": [
            "4de7ac8b-495b-4884-9a69-1050c6793cd6"
          ],
          "kubernetes_ids": [
            "41b74c5d-9bd0-5555-5555-a57c495b81a3"
          ],
          "tags": [
            "frontend"
          ]
        }
      }
    ]
  }
}