---
title: "Remove Rules from a Firewall"
method: DELETE
path: "/v2/firewalls/{firewall_id}/rules"
tags: ["DigitalOcean-public.v2-new_Firewalls"]
---

# Remove Rules from a Firewall

`DELETE /v2/firewalls/{firewall_id}/rules`

To remove access rules from a firewall, send a DELETE request to
`/v2/firewalls/$FIREWALL_ID/rules`. The body of the request may include an
`inbound_rules` and/or `outbound_rules` attribute containing an array of rules
to be removed.

No response body will be sent back, but the response code will indicate
success. Specifically, the response code will be a 204, which means that the
action was successful with no returned body data.

## Path parameters

- `firewall_id` string, uuid, required

## Request body

- union
  - object
    - `inbound_rules` object[], nullable, required
      - `protocol` 'tcp' | 'udp' | 'icmp', required — The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
      - `ports` string, required — The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
      - `sources` object, required — An object specifying locations from which inbound traffic will be accepted.
        - `addresses` string[] — An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
        - `droplet_ids` integer[] — An array containing the IDs of the Droplets to which the firewall will allow traffic.
        - `load_balancer_uids` string[] — An array containing the IDs of the load balancers to which the firewall will allow traffic.
        - `kubernetes_ids` string[] — An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
        - `tags` string[], nullable — An array containing the names of Tags corresponding to groups of Droplets to which the firewall will allow traffic.
    - `outbound_rules` object[], nullable
      - `protocol` 'tcp' | 'udp' | 'icmp', required — The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
      - `ports` string, required — The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
      - `destinations` object, required — An object specifying locations to which outbound traffic that will be allowed.
        - `addresses` string[] — An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
        - `droplet_ids` integer[] — An array containing the IDs of the Droplets to which the firewall will allow traffic.
        - `load_balancer_uids` string[] — An array containing the IDs of the load balancers to which the firewall will allow traffic.
        - `kubernetes_ids` string[] — An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
        - `tags` string[], nullable — An array containing the names of Tags corresponding to groups of Droplets to which the firewall will allow traffic.
  - object
    - `inbound_rules` object[], nullable
      - `protocol` 'tcp' | 'udp' | 'icmp', required — The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
      - `ports` string, required — The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
      - `sources` object, required — An object specifying locations from which inbound traffic will be accepted.
        - `addresses` string[] — An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
        - `droplet_ids` integer[] — An array containing the IDs of the Droplets to which the firewall will allow traffic.
        - `load_balancer_uids` string[] — An array containing the IDs of the load balancers to which the firewall will allow traffic.
        - `kubernetes_ids` string[] — An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
        - `tags` string[], nullable — An array containing the names of Tags corresponding to groups of Droplets to which the firewall will allow traffic.
    - `outbound_rules` object[], nullable, required
      - `protocol` 'tcp' | 'udp' | 'icmp', required — The type of traffic to be allowed. This may be one of `tcp`, `udp`, or `icmp`.
      - `ports` string, required — The ports on which traffic will be allowed specified as a string containing a single port, a range (e.g. "8000-9000"), or "0" when all ports are open for a protocol. For ICMP rules this parameter will always return "0".
      - `destinations` object, required — An object specifying locations to which outbound traffic that will be allowed.
        - `addresses` string[] — An array of strings containing the IPv4 addresses, IPv6 addresses, IPv4 CIDRs, and/or IPv6 CIDRs to which the firewall will allow traffic.
        - `droplet_ids` integer[] — An array containing the IDs of the Droplets to which the firewall will allow traffic.
        - `load_balancer_uids` string[] — An array containing the IDs of the load balancers to which the firewall will allow traffic.
        - `kubernetes_ids` string[] — An array containing the IDs of the Kubernetes clusters to which the firewall will allow traffic.
        - `tags` string[], nullable — An array containing the names of Tags corresponding to groups of Droplets to which the firewall will allow traffic.

## Response `204`

The action was successful and the response body is empty.

## Other responses

- `400` — There was an error parsing the request body.
- `401` — Authentication failed due to invalid credentials.
- `404` — The resource was not found.
- `429` — The API rate limit has been exceeded.
- `500` — There was a server error.
- `default` — There was an unexpected error.

---

[API](https://skmtc.net/digitalocean/apis/digitalocean-api.md) · [All operations](https://skmtc.net/digitalocean/apis/digitalocean-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitalocean/digitalocean-api/revisions/cb3bf9b21459/schema)
