Skip to content

API Overview

The NGFW.sh API provides programmatic access to all firewall configuration and monitoring features.

https://api.ngfw.sh

All API requests require a Bearer token in the Authorization header:

Terminal window
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
https://api.ngfw.sh/api/system/status

Tokens are JWTs issued by WorkOS AuthKit with the following claims:

  • sub - User ID
  • org_id - Organization ID (for business plans)
  • plan - Subscription plan identifier
  • exp - Expiration timestamp

The complete OpenAPI 3.1 specification is available at:

Endpoint PatternLimit
/api/auth/*10/min
/api/traffic/logs60/min
/api/*/stream5 concurrent
All other endpoints120/min

All errors follow a consistent format:

{
"error": {
"code": "INVALID_CONFIG",
"message": "Invalid subnet mask",
"field": "subnet_mask",
"details": {}
}
}
CodeHTTP StatusDescription
UNAUTHORIZED401Invalid or expired token
FORBIDDEN403Insufficient permissions
NOT_FOUND404Resource not found
INVALID_CONFIG400Configuration validation failed
DEVICE_OFFLINE503Router agent not connected
PLAN_LIMIT403Plan limit exceeded
RATE_LIMIT429Too many requests
Terminal window
curl https://api.ngfw.sh/api/system/status \
-H "Authorization: Bearer $TOKEN"
Terminal window
curl https://api.ngfw.sh/api/firewall/rules \
-H "Authorization: Bearer $TOKEN"
Terminal window
curl -X POST https://api.ngfw.sh/api/firewall/rules \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Block Telnet",
"zone_from": "WAN",
"zone_to": "LAN",
"protocol": "tcp",
"port": "23",
"action": "drop"
}'

Official SDKs are coming soon for:

  • TypeScript/JavaScript
  • Python
  • Go

In the meantime, you can generate clients from the OpenAPI spec using tools like openapi-generator.