REST API v1
API Reference
Programmatic access to hextrap. Manage firewalls, query logs, and automate your security workflows.
Authentication
All API requests require authentication using a Bearer token. You can generate API tokens from your dashboard settings.
GET
/firewalls
curl -X GET https://api.hextrap.com/v1/firewalls \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Security Note: Keep your API tokens secure. Never commit them
to version control or expose them in client-side code.
Rate Limits
API requests are rate limited based on your plan:
| Plan | Requests/minute | Requests/day |
|---|---|---|
| Free | 60 | 1,000 |
| Team | 300 | 10,000 |
| Enterprise | 1,000 | Unlimited |
Rate limit headers are included in every response:
X-RateLimit-Limit: 300
X-RateLimit-Remaining: 299
X-RateLimit-Reset: 1640000000
Errors
The API uses standard HTTP status codes and returns errors in JSON format:
400 Bad Request
{
"error": {
"code": "invalid_request",
"message": "Missing required field: name",
"field": "name"
}
}
| Status Code | Description |
|---|---|
400 |
Bad Request - Invalid parameters |
401 |
Unauthorized - Invalid or missing token |
403 |
Forbidden - Insufficient permissions |
404 |
Not Found - Resource doesn't exist |
429 |
Too Many Requests - Rate limited |
500 |
Internal Server Error |
List Firewalls
Retrieve a list of all firewalls in your organization.
GET
/firewalls
curl -X GET https://api.hextrap.com/v1/firewalls \
-H "Authorization: Bearer YOUR_API_TOKEN"
200 OK
{
"data": [
{
"id": "fw_abc123",
"name": "Production API",
"description": "Main production firewall",
"status": "active",
"allowlist_enabled": true,
"denylist_enabled": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:22:00Z"
}
],
"meta": {
"total": 1,
"page": 1,
"per_page": 20
}
}
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page |
integer | Page number (default: 1) |
per_page |
integer | Results per page (default: 20, max: 100) |
status |
string | Filter by status: active, paused |
Create Firewall
Create a new firewall.
POST
/firewalls
curl -X POST https://api.hextrap.com/v1/firewalls \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Staging Environment",
"description": "Firewall for staging builds",
"allowlist_enabled": false,
"denylist_enabled": true
}'
201 Created
{
"data": {
"id": "fw_xyz789",
"name": "Staging Environment",
"description": "Firewall for staging builds",
"status": "active",
"allowlist_enabled": false,
"denylist_enabled": true,
"created_at": "2024-01-25T09:15:00Z"
}
}
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Firewall name (max 100 chars) |
description |
string | No | Optional description |
allowlist_enabled |
boolean | No | Enable allow list (default: false) |
denylist_enabled |
boolean | No | Enable deny list (default: true) |
Full API documentation coming soon. Contact us for early access.
Request Access