Request
POST /v1/fences
Authenticate with a bearer token. Create one with POST /v1/tokens or cluck login.
Parameters
| Name | Type | Description |
|---|---|---|
action | string | allow or deny |
port | integer | Destination port |
from | string | Source CIDR |
expires_at | string | Optional expiry timestamp |
Example
curl -X POST https://api.pollosoft.example/v1/fences \
-H "Authorization: Bearer $COOP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"action": "example-action", "port": 10, "from": "example-from", "expires_at": "example-expires_at"}'
Response
A successful call returns 201 Created with JSON like this:
{
"id": "fr_91d",
"action": "allow",
"port": 443,
"status": "active"
}
Errors
HEN-2001(401): Not logged inHEN-2004(403): Insufficient pecking orderHEN-5001(429): Too many pecksHEN-1002(400): Missing required field
IdempotencySend an
Idempotency-Key header to make retries safe. We will return the original result instead of laying a second egg.