Skip to content
Hoody.com

The Container Firewall API controls the ingress and egress rules attached to a container. Use these endpoints to inspect the live rule set, append new rules, toggle rules on and off without deleting them, remove specific or bulk rules, or fully reset the firewall back to an open 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.

NameInTypeRequiredDescription
idpathstringYesContainer ID
{
"statusCode": 200,
"message": "Firewall rules retrieved successfully",
"data": {
"ingress": [
{
"action": "allow",
"protocol": "tcp",
"description": "Allow HTTPS traffic",
"destination_port": "443",
"source": "0.0.0.0/0",
"state": "enabled",
"direction": "ingress"
},
{
"action": "allow",
"protocol": "icmp4",
"description": "Allow ping from any source",
"source": "0.0.0.0/0",
"state": "enabled",
"icmp_type": "8",
"icmp_code": "0",
"direction": "ingress"
}
],
"egress": [
{
"action": "allow",
"protocol": "tcp",
"description": "Allow outbound HTTPS",
"destination_port": "443",
"destination": "0.0.0.0/0",
"state": "enabled",
"direction": "egress"
},
{
"action": "drop",
"protocol": "tcp",
"description": "Block outbound SMTP",
"destination_port": "25",
"destination": "0.0.0.0/0",
"state": "enabled",
"direction": "egress"
}
],
"rule_count": 4,
"byte_count": 412,
"max_rules": 500,
"max_bytes": 262144
}
}
Terminal window
curl -X GET https://api.hoody.com/api/v1/containers/{id}/firewall/rules \
-H "Authorization: Bearer <token>"

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

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

Add a new ingress (inbound) firewall rule to a container. Use this endpoint to control which traffic can reach your container. All rules default to state: "enabled" if not specified.

NameInTypeRequiredDescription
idpathstringYesContainer ID
FieldTypeRequiredDescription
actionstringYesAction to take: allow (permit), reject (deny with response), drop (deny silently)
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
{
"action": "allow",
"protocol": "tcp",
"description": "Allow HTTPS",
"destination_port": "443",
"source": "0.0.0.0/0"
}
{
"statusCode": 200,
"message": "Rule already exists",
"data": {}
}
Terminal window
curl -X POST https://api.hoody.com/api/v1/containers/{id}/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"
}'

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

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

Enable or disable an ingress (inbound) firewall rule without deleting it. Provide filters to identify which rule to toggle. Useful for temporarily disabling rules.

NameInTypeRequiredDescription
idpathstringYesContainer ID
FieldTypeRequiredDescription
statestringYesNew state for the rule: enabled or disabled
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoProtocol type: tcp, udp, or icmp4
destination_portstringNoDestination port, range (e.g. 80-90), or list (e.g. 80,443)
source_portstringNoSource port, range, or list
sourcestringNoSource IPv4 address or CIDR range
descriptionstringNoRule description (max 255 chars)
icmp_typestringNoICMP type number
icmp_codestringNoICMP code number
{
"state": "disabled",
"protocol": "tcp",
"destination_port": "443"
}
{
"statusCode": 200,
"message": "Ingress rule state toggled successfully",
"data": {
"direction": "ingress",
"new_state": "disabled",
"updated": {
"action": "allow",
"protocol": "tcp",
"description": "Allow HTTPS traffic",
"destination_port": "443",
"source": "0.0.0.0/0",
"state": "disabled"
}
}
}
Terminal window
curl -X PATCH https://api.hoody.com/api/v1/containers/{id}/firewall/ingress \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"state": "disabled",
"protocol": "tcp",
"destination_port": "443"
}'

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

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

Remove one or more ingress (inbound) firewall rules. Provide filters to match specific rules, or use all: true to remove all ingress rules. Not equivalent to reset — this only deletes rules and leaves the firewall/ACL attached.

NameInTypeRequiredDescription
idpathstringYesContainer ID
FieldTypeRequiredDefaultDescription
allbooleanNoRemove all matching rules (default: first match only). Set to true with no other filters to remove all ingress rules.
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoProtocol type: tcp, udp, or icmp4
destination_portstringNoDestination port, range, or list
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
{
"protocol": "tcp",
"destination_port": "22",
"source": "192.168.1.0/24"
}
{
"statusCode": 200,
"message": "Ingress rule removed successfully",
"data": {
"direction": "ingress",
"removed_count": 1,
"removed": [
{
"action": "allow",
"protocol": "tcp",
"description": "Allow SSH from office",
"destination_port": "22",
"source": "192.168.1.0/24",
"state": "enabled"
}
]
}
}
Terminal window
curl -X DELETE https://api.hoody.com/api/v1/containers/{id}/firewall/ingress \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"protocol": "tcp",
"destination_port": "22",
"source": "192.168.1.0/24"
}'

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

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

Add a new egress (outbound) firewall rule to a container. Use this endpoint to control which traffic your container can send. All rules default to state: "enabled" if not specified.

NameInTypeRequiredDescription
idpathstringYesContainer ID
FieldTypeRequiredDescription
actionstringYesAction to take: allow (permit), reject (deny with response), drop (deny silently)
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
{
"action": "allow",
"protocol": "tcp",
"description": "Allow outbound HTTPS",
"destination_port": "443",
"destination": "0.0.0.0/0"
}
{
"statusCode": 200,
"message": "Rule already exists",
"data": {}
}
Terminal window
curl -X POST https://api.hoody.com/api/v1/containers/{id}/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"
}'

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

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

Enable or disable an egress (outbound) firewall rule without deleting it. Provide filters to identify which rule to toggle. Useful for temporarily disabling rules.

NameInTypeRequiredDescription
idpathstringYesContainer ID
FieldTypeRequiredDescription
statestringYesNew state for the rule: enabled or disabled
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoProtocol type: 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 (max 255 chars)
icmp_typestringNoICMP type number
icmp_codestringNoICMP code number
{
"state": "disabled",
"protocol": "tcp",
"destination_port": "25"
}
{
"statusCode": 200,
"message": "Egress rule state toggled successfully",
"data": {
"direction": "egress",
"new_state": "enabled",
"updated": {
"action": "allow",
"protocol": "tcp",
"description": "Allow outbound HTTPS",
"destination_port": "443",
"destination": "0.0.0.0/0",
"state": "enabled"
}
}
}
Terminal window
curl -X PATCH https://api.hoody.com/api/v1/containers/{id}/firewall/egress \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"state": "disabled",
"protocol": "tcp",
"destination_port": "25"
}'

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

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

Remove one or more egress (outbound) firewall rules. Provide filters to match specific rules, or use all: true to remove all egress rules. Not equivalent to reset — this only deletes rules and leaves the firewall/ACL attached.

NameInTypeRequiredDescription
idpathstringYesContainer ID
FieldTypeRequiredDefaultDescription
allbooleanNoRemove all matching rules (default: first match only). Set to true with no other filters to remove all egress rules.
actionstringNoAction for matching traffic: allow, reject, or drop
protocolstringNoProtocol type: tcp, udp, or icmp4
destination_portstringNoDestination port, range, or list
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
{
"protocol": "tcp",
"destination_port": "25"
}
{
"statusCode": 200,
"message": "Egress rules removed successfully",
"data": {
"direction": "egress",
"removed_count": 2,
"removed": [
{
"action": "allow",
"protocol": "tcp",
"description": "Allow outbound HTTPS",
"destination_port": "443",
"destination": "0.0.0.0/0",
"state": "enabled"
},
{
"action": "allow",
"protocol": "tcp",
"description": "Allow outbound DNS",
"destination_port": "53",
"destination": "8.8.8.8",
"state": "enabled"
}
]
}
}
Terminal window
curl -X DELETE https://api.hoody.com/api/v1/containers/{id}/firewall/egress \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"protocol": "tcp",
"destination_port": "25"
}'

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

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

Delete the ACL and detach the container from its firewall bridge, returning the container to an open state. Use this to wipe a misconfigured rule set quickly; rebuilding the rule set afterwards requires adding rules one by one.

NameInTypeRequiredDescription
idpathstringYesContainer ID
{
"statusCode": 200,
"message": "Firewall reset successfully",
"data": {
"rules": {
"ingress": [],
"egress": []
}
}
}
Terminal window
curl -X POST https://api.hoody.com/api/v1/containers/{id}/firewall/reset \
-H "Authorization: Bearer <token>"