dots.v2.firewalls.post()
Generated on 13 Nov 2026
from DoTs version
v1.24.0
Usage
client.v2.firewalls.post(body: Firewall, requestConfiguration?: RequestConfiguration<object>): Promise<undefined | FirewallsPostResponse>Description
To create a new firewall, send a POST request to /v2/firewalls. The request
must contain at least one inbound or outbound access rule.
Parameters
idstring optional read-onlyExample:
bb4b2611-3d72-467b-8602-280330ecd65cA unique ID that can be used to identify and reference a firewall.
statusstring optional read-onlyA status string indicating the current state of the firewall. This can be "waiting", "succeeded", or "failed".
createdAtstring optional read-onlyExample:
2020-05-23T21:24:00ZA time value given in ISO8601 combined date and time format that represents when the firewall was created.
pendingChangesarray of objects optional read-onlyExample:
[{"droplet_id": 8043964, "removing": false, "status": "waiting"}]An array of objects each containing the fields "droplet_id", "removing", and "status". It is provided to detail exactly which Droplets are having their security policies updated. When empty, all changes have been successfully applied.
Show child properties
dropletIdinteger optionalExample:
8043964removingboolean optionalExample:
falsestatusstring optionalExample:
waiting
namestring requiredExample:
firewallA human-readable name for a firewall. The name must begin with an alphanumeric character. Subsequent characters must either be alphanumeric characters, a period (.), or a dash (-).
dropletIdsarray of integers or null optionalExample:
[8043964]An array containing the IDs of the Droplets assigned to the firewall.
Requiresdroplet:readscope.tagsarray of strings or null optionalExample:
["base-image", "prod"]A flat array of tag names as strings to be applied to the resource. Tag names must exist in order to be referenced in a request.
Requirestag:createandtag:readscopes.inboundRulesarray of objects or null optionalShow child properties
protocolstring requiredThe type of traffic to be allowed. This may be one of
tcp,udp, oricmp.portsstring requiredExample:
8000The 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".
actionstring optionalThe action to be taken when traffic matches the rule. This may be one of
allowordeny. For backward compatibility, this field is optional. When not set, it defaults toallow.sourcesobject requiredAn object specifying locations from which inbound traffic will be accepted.
outboundRulesarray of objects or null optionalShow child properties
protocolstring requiredThe type of traffic to be allowed. This may be one of
tcp,udp, oricmp.portsstring requiredExample:
8000The 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".
actionstring optionalThe action to be taken when traffic matches the rule. This may be one of
allowordeny. For backward compatibility, this field is optional. When not set, it defaults toallow.destinationsobject requiredAn object specifying locations to which outbound traffic that will be allowed.
Request Sample
Response Example
More Information
See /v2/firewalls in the API reference for additional detail on responses, headers, parameters, and more.