Skip to content
Hoody.com

Manage ingress and egress firewall rules for a container. Use these endpoints to inspect existing rules, add new rules, toggle rule state without deletion, remove rules, or fully reset the firewall back to an open state.

All operations are scoped to a single container identified by {id}. Rules support three actions (allow, reject, drop) over tcp, udp, and icmp4 protocols, with optional filters for source, destination, ports, ICMP fields, and an enabled/disabled state.

GET /api/v1/containers/{id}/firewall/rules

Section titled “GET /api/v1/containers/{id}/firewall/rules”

Get all ingress and egress firewall rules for a container, along with rule and byte counts and the applicable limits for this container.

NameInTypeRequiredDescription
idpathstringYesContainer ID
Terminal window
curl -X GET "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/rules" \
-H "Authorization: Bearer <token>"

Add an ingress or egress rule. All rules default to state: "enabled" when not specified.

POST /api/v1/containers/{id}/firewall/ingress

Section titled “POST /api/v1/containers/{id}/firewall/ingress”

Add a new ingress (inbound) firewall rule to control which traffic can reach the container.

NameInTypeRequiredDescription
idpathstringYesContainer ID
NameTypeRequiredDescription
actionstringYesAction for matching traffic: allow, reject, or drop
protocolstringYesNetwork protocol: tcp, udp, or icmp4
descriptionstringYesHuman-readable rule description (max 255 chars)
destination_portstringNoPort number, range (e.g. 80-90), or comma-separated list (e.g. 80,443). Required for tcp/udp
sourcestringNoSource IPv4 address or CIDR range. Use 0.0.0.0/0 for any source
source_portstringNoSource port filter (rarely used)
statestringNoRule state: enabled or disabled. Defaults to enabled
icmp_typestringNoICMP type number (e.g. 8 for echo request/ping)
icmp_codestringNoICMP code number
Terminal window
curl -X POST "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/ingress" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"action": "allow",
"protocol": "tcp",
"description": "Allow HTTPS",
"destination_port": "443",
"source": "0.0.0.0/0"
}'

POST /api/v1/containers/{id}/firewall/egress

Section titled “POST /api/v1/containers/{id}/firewall/egress”

Add a new egress (outbound) firewall rule to control which traffic the container can send.

NameInTypeRequiredDescription
idpathstringYesContainer ID
NameTypeRequiredDescription
actionstringYesAction for matching traffic: allow, reject, or drop
protocolstringYesNetwork protocol: tcp, udp, or icmp4
descriptionstringYesHuman-readable rule description (max 255 chars)
destination_portstringNoPort number, range (e.g. 80-90), or comma-separated list (e.g. 80,443). Required for tcp/udp
destinationstringNoDestination IPv4 address or CIDR range. Use 0.0.0.0/0 for any destination
source_portstringNoSource port filter (rarely used)
statestringNoRule state: enabled or disabled. Defaults to enabled
icmp_typestringNoICMP type number
icmp_codestringNoICMP code number
Terminal window
curl -X POST "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/egress" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"action": "allow",
"protocol": "tcp",
"description": "Allow outbound HTTPS",
"destination_port": "443",
"destination": "0.0.0.0/0"
}'

Enable or disable an existing rule without deleting it. Provide the rule’s identifying fields plus a new state.

PATCH /api/v1/containers/{id}/firewall/ingress

Section titled “PATCH /api/v1/containers/{id}/firewall/ingress”

Toggle the state of an ingress (inbound) firewall rule.

NameInTypeRequiredDescription
idpathstringYesContainer ID
NameTypeRequiredDescription
statestringYesNew state for the rule: enabled or disabled
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoNetwork protocol: tcp, udp, or icmp4
destination_portstringNoDestination port, range (e.g. 80-90), or list (e.g. 80,443)
sourcestringNoSource IPv4 address or CIDR range
source_portstringNoSource port, range, or list
descriptionstringNoRule description
icmp_typestringNoICMP type number
icmp_codestringNoICMP code number
Terminal window
curl -X PATCH "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/ingress" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"state": "disabled",
"protocol": "tcp",
"destination_port": "443"
}'

PATCH /api/v1/containers/{id}/firewall/egress

Section titled “PATCH /api/v1/containers/{id}/firewall/egress”

Toggle the state of an egress (outbound) firewall rule.

NameInTypeRequiredDescription
idpathstringYesContainer ID
NameTypeRequiredDescription
statestringYesNew state for the rule: enabled or disabled
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoNetwork protocol: tcp, udp, or icmp4
destination_portstringNoDestination port, range (e.g. 80-90), or list (e.g. 80,443)
source_portstringNoSource port, range, or list
destinationstringNoDestination IPv4 address or CIDR range
descriptionstringNoRule description
icmp_typestringNoICMP type number
icmp_codestringNoICMP code number
Terminal window
curl -X PATCH "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/egress" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"state": "disabled",
"protocol": "tcp",
"destination_port": "25"
}'

Remove one or more rules that match the supplied filters. Pass all: true to remove every rule on the requested side, or combine all with other filters to bulk-remove a subset.

DELETE /api/v1/containers/{id}/firewall/ingress

Section titled “DELETE /api/v1/containers/{id}/firewall/ingress”

Remove ingress (inbound) firewall rules matching the supplied filters.

NameInTypeRequiredDescription
idpathstringYesContainer ID
NameTypeRequiredDefaultDescription
allbooleanNoRemove all matching rules. Set to true with no other filters to remove all ingress rules
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoNetwork protocol: tcp, udp, or icmp4
destination_portstringNoDestination port, range (e.g. 80-90), or list (e.g. 80,443)
sourcestringNoSource IPv4 address or CIDR range
source_portstringNoSource port, range, or list
descriptionstringNoRule description
statestringNo"enabled"Rule state: enabled or disabled
icmp_typestringNoICMP type number
icmp_codestringNoICMP code number
Terminal window
curl -X DELETE "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/ingress" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"protocol": "tcp",
"destination_port": "22",
"source": "192.168.1.0/24"
}'

DELETE /api/v1/containers/{id}/firewall/egress

Section titled “DELETE /api/v1/containers/{id}/firewall/egress”

Remove egress (outbound) firewall rules matching the supplied filters.

NameInTypeRequiredDescription
idpathstringYesContainer ID
NameTypeRequiredDefaultDescription
allbooleanNoRemove all matching rules. Set to true with no other filters to remove all egress rules
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoNetwork protocol: tcp, udp, or icmp4
destination_portstringNoDestination port, range (e.g. 80-90), or list (e.g. 80,443)
destinationstringNoDestination IPv4 address or CIDR range
source_portstringNoSource port, range, or list
descriptionstringNoRule description
statestringNo"enabled"Rule state: enabled or disabled
icmp_typestringNoICMP type number
icmp_codestringNoICMP code number
Terminal window
curl -X DELETE "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/egress" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"all": true
}'

POST /api/v1/containers/{id}/firewall/reset

Section titled “POST /api/v1/containers/{id}/firewall/reset”

Delete the firewall ACL and detach the container from its firewall bridge, returning the container to an open (unfiltered) state. This is destructive: every ingress and egress rule is removed and the firewall attachment is torn down.

NameInTypeRequiredDescription
idpathstringYesContainer ID

This endpoint takes no parameters beyond the path parameter and accepts no request body.

Terminal window
curl -X POST "https://api.hoody.com/api/v1/containers/c_abc123def456/firewall/reset" \
-H "Authorization: Bearer <token>"