Admin API Reference

Base URL: https://admin.avon.example.com/api/v1

Authentication: Bearer token (JWT) in the Authorization header.

Agents

MethodEndpointDescription
GET/agentsList all agents (supports ?status=online&page=1&per_page=20)
GET/agents/{id}Get agent details
DELETE/agents/{id}Remove an agent
POST/agents/{id}/revokeRevoke agent certificate

Example — List online agents:

curl -H "Authorization: Bearer $TOKEN" 
  "https://admin.avon.example.com/api/v1/agents?status=online"

Enrollment Tokens

MethodEndpointDescription
GET/enrollment-tokensList tokens
POST/enrollment-tokensCreate a token
DELETE/enrollment-tokens/{id}Revoke a token

Example — Create an enrollment token:

curl -X POST -H "Authorization: Bearer $TOKEN" 
  -H "Content-Type: application/json" 
  -d '{
    "name": "batch-engineering",
    "groups": ["engineering"],
    "expires_in": "24h",
    "max_uses": 50
  }' 
  "https://admin.avon.example.com/api/v1/enrollment-tokens"

Policies

MethodEndpointDescription
GET/policiesList all policies
POST/policiesCreate a policy
PUT/policies/{id}Update a policy
DELETE/policies/{id}Delete a policy
POST/policies/evaluateDry-run policy evaluation

Example — Dry-run a policy check:

curl -X POST -H "Authorization: Bearer $TOKEN" 
  -H "Content-Type: application/json" 
  -d '{
    "agent_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "resource": {
      "network": "10.100.5.0/24",
      "port": 443,
      "protocol": "tcp"
    }
  }' 
  "https://admin.avon.example.com/api/v1/policies/evaluate"

Sessions

MethodEndpointDescription
GET/sessionsList active sessions
DELETE/sessions/{id}Terminate a session
POST/sessions/terminate-allEmergency: terminate all sessions

Groups

MethodEndpointDescription
GET/groupsList groups
POST/groupsCreate a group

Health

MethodEndpointDescription
GET/healthHealth check
GET/metricsPrometheus metrics